Mercurial > hg > MakeItSo
view makeitso/python_package/{{package}}/{{main}}.py @ 187:74f41d53b057
STUB: makeitso/python_package/{{package}}/{{main}}.py
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Fri, 11 Apr 2014 17:06:22 -0700 |
parents | a5d058957734 |
children | 1bcf60bcc455 |
line wrap: on
line source
#!/usr/bin/env python # -*- coding: utf-8 -*- """ {{description}} """ # imports import optparse import os import subprocess import sys __all__ = ['main'] here = os.path.dirname(os.path.realpath(__file__)) def add_options(parser): """add options to the OptionParser instance""" def main(args=sys.argv[1:]): # parse command line options usage = '%prog [options] ...' class PlainDescriptionFormatter(optparse.IndentedHelpFormatter): """description formatter for console script entry point""" 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()