Flask: Georgia for text, Garamond for titles
Werkzeug: Lucida Grande for text, Ubuntu for titles
And now click: Ubuntu Mono for text, Open Sans for titles
71–80 of 105 posts
Flask: Georgia for text, Garamond for titles
Werkzeug: Lucida Grande for text, Ubuntu for titles
And now click: Ubuntu Mono for text, Open Sans for titles
Earlier quoted context omitted.
> The biggest gripe I have with using Python for rich command-line tool is the startup time. What startup time? I even have a python script running on every shell prompt drawing (that checks mercurial on top of starting the python interpreter), and the latency is negligible.
I just tried on an app at work (Django app): > time python manage.py --help real 0m0.473s user 0m0.240s sys 0m0.148s Half of a second is very noticeable (and annoying). I had similar perception in my previous work. You can try to only load enough to display the help text without really loading everything, but that doesn't work that well (you have to organize things differently, and `--help` requires to load a lot of…
Earlier quoted context omitted.
Yeah, plenty: - Cliff http://cliff.readthedocs.org/en/latest/ - docopt http://docopt.org - argparse - optparse etc etc etc...
And the author acknowledges that: "There are many alternatives to click and you can have a look at them if you enjoy them better. The obvious ones are optparse and argparse from the standard library. click is actually implemented as a wrapper around optparse and does not implement any parsing itself. The reason it’s not based on argparse is that argparse‘s design does not allow proper nesting of commands by design an…
Little unfortunate naming. Isn't Click a trademark of ASF? http://click.apache.org/
I don't blame this particular offering, since I don't think release was actually planned just yet and any number of other projects have made the same subtle mistake.
Command Name Extensions are Harmful. Don't expose such an implementation detail in every example, lest everyone actually follow them. Use the "#!/usr/bin/env python" or whatever at the top of your scripts. And yes, you can keep the .py if what you have is a library, not just a command (but it's nice to then make a wrapper the doesn't expose the implementation language). And obviously in other OSes where the command extension can be omitted and still work this isn't such a big deal.
But in Unix/Linux, commands should be reimplementable in a different language without making some .(extension) a like, retained to keep from breaking other things that depend on it. Just say no :-)
Earlier quoted context omitted.
> The biggest gripe I have with using Python for rich command-line tool is the startup time. What startup time? I even have a python script running on every shell prompt drawing (that checks mercurial on top of starting the python interpreter), and the latency is negligible.
I just tried on an app at work (Django app): > time python manage.py --help real 0m0.473s user 0m0.240s sys 0m0.148s Half of a second is very noticeable (and annoying). I had similar perception in my previous work. You can try to only load enough to display the help text without really loading everything, but that doesn't work that well (you have to organize things differently, and `--help` requires to load a lot of…
Sadly, both pypy and python3 are slower than python2.7. Also worth nothing that the sys time fluctates for me -- in other words when it is > 0.00s it doesn't appear to have anything to do with the command run.
Ahh.. I really like pocoo's products. But I've found manage.py ( https://github.com/Birdback/manage.py ) to be far leaner and simple. What do you guys think?
don't like that, clashes with Django
Django's manage command is already extensible, so if you're using Django then perhaps it's best to use its tool chain.
I did not expect this to be on hackernews this early. I want to point out that I have not made a release yet and it's not yet feature complete. Mainly I want to ask for feedback on the general design.
The main idea behind it is make it easy to write a "getopt" style program with arbitrary command nesting. I have found that although argparse and sisters are nice libraries they don't allow me to do many of things I like to do in my interfaces. For instance sometimes like options such as
foo -x a -x y -x q ...
where I would process that into like so: extras = list()
for opt, arg in opts:
if opt in ('-h', '--help',):
util.usage()
...
elif opt in ('-x', '--extra'):
extras.append(validate_or_die(arg))
I also believe that you should have "fast fail" validators. So I have several in `optutils` which are like: util.assert_dir_exists(path)
which if a directory doesn't exist on the path it creates it. If there is already a file there and it isn't a directory it dies with an error. When it dies, I try and have unique exit codes for various errors (for testability) and provide usage information immediately. This style is nice because it provides immediate feedback to the user with no fuss. I think a lot of "option parser frameworks" miss the point in having lots of things for parsing ints and things. Most of the time I deal with files, directories, and "string" parameters which these libraries don't help with.In general, the standard libraries make it way to hard to write really nice command line tools. I like some things about your library, but I think that you need to increase the flexibitly for how options are processsed to you can do whatever you want with them. I also think that option parsing and configuration should be integrated. I am working to support that but I am not there yet. (see optutils/conf.py for my current ideas)
Earlier quoted context omitted.
And the author acknowledges that: "There are many alternatives to click and you can have a look at them if you enjoy them better. The obvious ones are optparse and argparse from the standard library. click is actually implemented as a wrapper around optparse and does not implement any parsing itself. The reason it’s not based on argparse is that argparse‘s design does not allow proper nesting of commands by design an…
Does that mean optparse will be maintained along with click? optparse has been deprecated in favor of argparse since 2.7/3.2.