comparison makeitso/python_package/{{package}}/main.py @ 140:3046e15c3dd7

fix up sectioning
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 21 Feb 2012 21:06:11 -0800
parents 23652cbfdfad
children d37ee77a9317
comparison
equal deleted inserted replaced
139:23652cbfdfad 140:3046e15c3dd7
9 9
10 def main(args=sys.argv[:]): 10 def main(args=sys.argv[:]):
11 11
12 # parse command line options 12 # parse command line options
13 usage = '%prog [options]' 13 usage = '%prog [options]'
14
15 # description formatter
16 class PlainDescriptionFormatter(optparse.IndentedHelpFormatter): 14 class PlainDescriptionFormatter(optparse.IndentedHelpFormatter):
15 """description formatter for console script entry point"""
17 def format_description(self, description): 16 def format_description(self, description):
18 if description: 17 if description:
19 return description + '\n' 18 return description + '\n'
20 else: 19 else:
21 return '' 20 return ''
22
23 parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter()) 21 parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter())
24 options, args = parser.parse_args(args) 22 options, args = parser.parse_args(args)
25 23
26 if __name__ == '__main__': 24 if __name__ == '__main__':
27 main() 25 main()