say you have a script (for example a python program created with argparse)
that lists the options with the -h option. Can you write Python function
that takes as input the output of the script and generate a web2py form,
parses the form.vars and calls the script with the proper arguments?
For example
convert -v -d=3 input output
into
form = SQLFORM.factory(Field('v','boolean',default=False),
Field('d','integer',default=3))
if form.process().accepted:
command = "command"
if form.vars.v: command+=" -v"
if form.vars.d: command+="-d=%s" % form.vars.d
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.