[canon_wrapper] un peu de doc
This commit is contained in:
parent
adebfe1ea0
commit
c03e0187b3
4 changed files with 33 additions and 4 deletions
5
doc/source/impression/canon_wrapper.rst
Normal file
5
doc/source/impression/canon_wrapper.rst
Normal file
|
@ -0,0 +1,5 @@
|
|||
canon_wrapper
|
||||
=============
|
||||
|
||||
.. automodule:: impression.canon_wrapper
|
||||
:members:
|
11
doc/source/impression/index.rst
Normal file
11
doc/source/impression/index.rst
Normal file
|
@ -0,0 +1,11 @@
|
|||
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
|
||||
==================
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
#!/usr/bin/python
|
||||
# -*- encoding: utf-8 -*-
|
||||
#canon_wrapper.py
|
||||
# Authors: Daniel STAN <dstan@crans.org>
|
||||
# Antoine Durand-Gasselin <adg@crans.org>
|
||||
# License: GPLv3
|
||||
"""
|
||||
.. 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'))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue