changeset 154:ebc5cfe17d95

order imports and add an add_options() API
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 01 Dec 2012 19:35:46 -0800
parents a5ea79f3221f
children 386a44a52139
files makeitso/python_module/{{module}}.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/makeitso/python_module/{{module}}.py	Sat Dec 01 19:15:48 2012 -0800
+++ b/makeitso/python_module/{{module}}.py	Sat Dec 01 19:35:46 2012 -0800
@@ -5,8 +5,12 @@
 {{description}}
 """
 
+import optparse
 import sys
-import optparse
+
+def add_options(parser):
+    """add {{module}} options to an OptionParser instance"""
+
 
 def main(args=sys.argv[1:]):
 
@@ -20,6 +24,7 @@
             else:
                 return ''
     parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter())
+    add_options(parser)
     options, args = parser.parse_args(args)
 
 if __name__ == '__main__':