Commit Graph

9 Commits

Author SHA1 Message Date
THE-Spellchecker
5eba4b48cf Typographical and Grammatical fixes 2023-11-28 15:00:04 -07:00
Todd C. Miller
02a117f336 Avoid using typing annotations so tests run with Python 3.4. 2020-04-07 14:03:58 -06:00
Robert Manner
bbbcb39334 plugins/python/example_*.py: document returning error string 2020-02-10 05:24:16 -07:00
Robert Manner
45d2638571 plugins/python/example*.py: pep8 fixes (mainly line too long) 2020-02-10 05:24:16 -07:00
Robert Manner
21c02e1732 plugins/python/sudo_python_module.c: use IntEnums instead of constants
It is a bit more code, but it is more "pythonic" and easier to debug
as the enum values also know their names.

It is also an API break, eg. sudo.RC_OK becomes sudo.RC.OK as sudo.RC will
be the "type" of the enum, but I guess that is acceptable before the
initial release.
2020-02-10 05:24:16 -07:00
Robert Manner
0b2d0334b7 plugins/python/example_policy_plugin.py: extend user env changing example
Make the demonstration extend the environment with a new variable.
Easier to read, and makes the testing able to check for that it is working.
2020-01-20 06:30:20 -07:00
Robert Manner
35c85596d7 plugins/python/example_policy_plugin.py: make allowed_commands ordered
Storing them as "tuple" instead of "set", so they have a fix order.
This makes the output of the list() example stable. ("set" is printed out
in random order)
2020-01-20 06:30:20 -07:00
Robert Manner
2ee1dd3ec3 plugins/python: fix confusing version display
IO/Group/Policy Python API version is displayed instead of sudo version,
because that is not very meaningful in this context.

They are only displayed in verbose mode.

Example plugins express it more concrete that they are displaying their
version, not the API version.
2020-01-20 06:30:20 -07:00
Robert Manner
d8432fca34 plugins/python: add example python policy plugin 2019-12-14 12:55:42 -07:00