diff --git a/doc/source/impression/canon_wrapper.rst b/doc/source/impression/canon_wrapper.rst new file mode 100644 index 00000000..3e0e12f8 --- /dev/null +++ b/doc/source/impression/canon_wrapper.rst @@ -0,0 +1,5 @@ +canon_wrapper +============= + +.. automodule:: impression.canon_wrapper + :members: diff --git a/doc/source/impression/index.rst b/doc/source/impression/index.rst new file mode 100644 index 00000000..97ff1b2f --- /dev/null +++ b/doc/source/impression/index.rst @@ -0,0 +1,11 @@ +Impression +=========== + +Table des matières : + +.. toctree:: + :maxdepth: 2 + :glob: + + * + diff --git a/doc/source/index.rst b/doc/source/index.rst index 3cdb424e..3a66723d 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -12,6 +12,7 @@ Table des matières : :maxdepth: 5 gestion/index + impression/index Indices and tables ================== diff --git a/impression/canon_wrapper.py b/impression/canon_wrapper.py index dfcdccd7..c4cb30ca 100755 --- a/impression/canon_wrapper.py +++ b/impression/canon_wrapper.py @@ -1,9 +1,13 @@ #!/usr/bin/python # -*- encoding: utf-8 -*- -# canon_wrapper.py -# Authors: Daniel STAN -# Antoine Durand-Gasselin -# License: GPLv3 +#canon_wrapper.py +""" +.. codeauthor:: Daniel STAN +.. codeauthor:: Antoine Durand-Gasselin + + +License: GPLv3 +""" import requests #pip install requests # See: @@ -106,6 +110,7 @@ def build_url(name): def range_checker(a, b): + """Type function for a given range""" def cast(x): try: v = int(x) @@ -117,6 +122,7 @@ def range_checker(a, b): return cast def build_parser(): + """Make argparse object""" parser = argparse.ArgumentParser( description="HTTP printing driver for irc3580, with compatibility mode.", epilog="logs are sent to syslog (eg /var/log/canon_wrapper.log)", @@ -159,6 +165,7 @@ def build_parser(): return parser def do_print(args): + """Effectively compatibilize then print the file""" opt=build_options(args) syslog('Options: %s' % repr(opt)) #syslog('Starting ghostscript compat, piped mode') @@ -205,3 +212,8 @@ if __name__ == '__main__': syslog('Caught exception %s' % repr(e)) raise +else: + parser = build_parser() + __doc__ += 'Help message::\n' +\ + '\n'.join(' ' + l for l in parser.format_help().split('\n')) +