Commit c03e0187 authored by Daniel STAN's avatar Daniel STAN
Browse files

[canon_wrapper] un peu de doc

parent adebfe1e
canon_wrapper
=============
.. automodule:: impression.canon_wrapper
:members:
Impression
===========
Table des matières :
.. toctree::
:maxdepth: 2
:glob:
*
......@@ -12,6 +12,7 @@ Table des matières :
:maxdepth: 5
gestion/index
impression/index
Indices and tables
==================
......
#!/usr/bin/python
# -*- encoding: utf-8 -*-
# canon_wrapper.py
# Authors: Daniel STAN <dstan@crans.org>
# Antoine Durand-Gasselin <adg@crans.org>
# License: GPLv3
#canon_wrapper.py
"""
.. codeauthor:: Daniel STAN <dstan@crans.org>
.. codeauthor:: Antoine Durand-Gasselin <adg@crans.org>
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'))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment