Mercurial > hg > MakeItSo
view makeitso/python_module/{{module}}.py @ 153:a5ea79f3221f
.strip() the description
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sat, 01 Dec 2012 19:15:48 -0800 |
parents | 88f5bab340a1 |
children | ebc5cfe17d95 |
line wrap: on
line source
#!/usr/bin/env python """ {{module}} {{description}} """ import sys import optparse def main(args=sys.argv[1:]): # parse command line arguments usage = '%prog [options] ...' class PlainDescriptionFormatter(optparse.IndentedHelpFormatter): """description formatter""" def format_description(self, description): if description: return description.strip() + '\n' else: return '' parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter()) options, args = parser.parse_args(args) if __name__ == '__main__': main()