nirizr / argparseweb Goto Github PK
View Code? Open in Web Editor NEWweb.py based tool to automatically convert argparse-like command line interfaces to simple web interfaces
web.py based tool to automatically convert argparse-like command line interfaces to simple web interfaces
As web
appears unsupported and abandoned it should be replaced with a suitable alternative (e.g. pyramid
/ pylons
): https://github.com/Pylons/pyramid
When including %s
in the help string for an argparse
option, the string is being reformatted.
Example:
parser.add_argument("-loglevel",help="%s Logging level: None, Error, Warning, Info, Verbose, Debug or Progress [Info]",nargs=1,type=str)
actually results in the help
text:
{'const': None, 'help': '%s Logging level: None, Error, Warning, Info, Verbose, Debug or Progress [Info]', 'option_strings': ['-loglevel'], 'dest': 'loglevel', 'required': False, 'nargs': 1, 'choices': None, 'default': None, 'container': <argparse._ArgumentGroup object at 0x1fac47cdaf865f>, 'type': <type 'str'>, 'metavar': None} Logging level: None, Error, Warning, Info, Verbose, Debug or Progress [Info]
When installing argparseweb
(e.g. through pip install argparseweb
) and then using it with import argparse
the following error is shown:
IOError: [Errno 2] No such file or directory: '../lib/python2.7/site-packages/argparseweb/templates/input.html'
Which appears to be called from: https://github.com/nirizr/argparseweb/blob/master/argparseweb/page.py#L20
_form_template = web.template.frender(os.path.join(os.path.dirname(__file__), "templates/input.html"), globals={'type': type, 'basestring': basestring})
The reason is most likely a missing templates/input.html
file, which has not been installed as part of setup.py
.
Hey there,
I first installed web.py using pip install web.py
, then installed this repo using pip install argparseweb
.
Getting the following error during argparseweb install:
Collecting argparseweb
Using cached argparseweb-0.1.2.tar.gz (8.8 kB)
ERROR: Command errored out with exit status 1:
command: /Users/saadbazaz/.virtualenvs/deepdub1/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/s9/k339_45j0ygg3zls9jn91xqm0000gn/T/pip-install-enl7cjw8/argparseweb_dd594d92584743acb991194d8e03e2c9/setup.py'"'"'; __file__='"'"'/private/var/folders/s9/k339_45j0ygg3zls9jn91xqm0000gn/T/pip-install-enl7cjw8/argparseweb_dd594d92584743acb991194d8e03e2c9/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/s9/k339_45j0ygg3zls9jn91xqm0000gn/T/pip-pip-egg-info-et5r22bn
cwd: /private/var/folders/s9/k339_45j0ygg3zls9jn91xqm0000gn/T/pip-install-enl7cjw8/argparseweb_dd594d92584743acb991194d8e03e2c9/
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/s9/k339_45j0ygg3zls9jn91xqm0000gn/T/pip-install-enl7cjw8/argparseweb_dd594d92584743acb991194d8e03e2c9/setup.py", line 3, in <module>
import argparseweb
File "/private/var/folders/s9/k339_45j0ygg3zls9jn91xqm0000gn/T/pip-install-enl7cjw8/argparseweb_dd594d92584743acb991194d8e03e2c9/argparseweb/__init__.py", line 2, in <module>
from .webui import *
File "/private/var/folders/s9/k339_45j0ygg3zls9jn91xqm0000gn/T/pip-install-enl7cjw8/argparseweb_dd594d92584743acb991194d8e03e2c9/argparseweb/webui.py", line 3, in <module>
import page
ModuleNotFoundError: No module named 'page'
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/ec/0a/cb8d85a0b3e9829f9c444f17cd4aea673c2b1e980e5a7f3e5e98eb5885aa/argparseweb-0.1.2.tar.gz#sha256=06b5775e77797d8468a5c9a0e2c5b6aa2ed534f391818b705aae1ef148244b48 (from https://pypi.org/simple/argparseweb/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement argparseweb (from versions: 0.1.2)
I ruled out that there's an error in finding the module "page", which is dependent on web.py. And from what I read on the Internet, web.py is deprecated.
Are there any plans to update this repo? I have some ideas in mind, maybe they could help out.
It is probably desirable to specify the requirements / dependencies this project is build upon. When trying to install through pip install argparseweb
people are likely being greeted by this message:
ImportError: No module named web
I am assuming web
is this module here: https://pypi.python.org/pypi/web (pypi lists version 0.6.0, but it appears this was last released in 2009 as version 0.5.3 (http://pythonweb.org). That same website also discourages people actually using web
and instead to use what is now called pyramid
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.