Mercurial > hg > MakeItSo
diff makeitso/python_package/{{package}}/{{main}}.py @ 160:9033a5f11b92
wip
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 30 Jul 2013 15:29:56 -0700 |
parents | makeitso/python_package/{{package}}/main.py@cfd4f1e91090 |
children | a5d058957734 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/makeitso/python_package/{{package}}/{{main}}.py Tue Jul 30 15:29:56 2013 -0700 @@ -0,0 +1,31 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +{{description}} +""" + +import optparse +import os +import subprocess +import sys + +def add_options(parser): + """add {{package}} options to an 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()