Optparse and help formatting?
Tim Chase
python.list at tim.thechases.com
Sun Sep 30 09:51:11 EDT 2007
More information about the Python-list mailing list
Sun Sep 30 09:51:11 EDT 2007
- Previous message (by thread): Optparse and help formatting?
- Next message (by thread): Optparse and help formatting?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>> def format_option(self, option): >> # The help for each option consists of two parts: >> # * the opt strings and metavars > [snip] > > Tim, I notice you're using lots of # lines as comments to describe the > function. Perhaps you should consider using docstrings instead. > > Pardon me if I'm telling you what you already know... Yes, I do know about and use docstrings, and no, no offense taken. You'll have to persuade the [Debian/Python] maintainer of optparse.py from whom I pilfered the code. :) tim at rubbish:~$ sed -n '/def format_option(/{N;N;N;N;N;p}' /usr/lib/python2.4/optparse.py def format_option(self, option): # The help for each option consists of two parts: # * the opt strings and metavars # eg. ("-x", or "-fFILENAME, --file=FILENAME") # * the user-supplied help string # eg. ("turn on expert mode", "read data from FILENAME") -tim
- Previous message (by thread): Optparse and help formatting?
- Next message (by thread): Optparse and help formatting?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list