Mercurial > hg > PaInt
comparison paint/main.py @ 0:96362e527bd6
initial package
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Tue, 21 Feb 2012 20:30:10 -0800 |
| parents | |
| children | a011af5e765a |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:96362e527bd6 |
|---|---|
| 1 #!/usr/bin/env python | |
| 2 | |
| 3 """ | |
| 4 python PAckage INTrospection | |
| 5 """ | |
| 6 | |
| 7 import sys | |
| 8 import optparse | |
| 9 | |
| 10 def main(args=sys.argv[:]): | |
| 11 | |
| 12 # parse command line options | |
| 13 usage = '%prog [options]' | |
| 14 | |
| 15 # description formatter | |
| 16 class PlainDescriptionFormatter(optparse.IndentedHelpFormatter): | |
| 17 def format_description(self, description): | |
| 18 if description: | |
| 19 return description + '\n' | |
| 20 else: | |
| 21 return '' | |
| 22 | |
| 23 parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter()) | |
| 24 options, args = parser.parse_args(args) | |
| 25 | |
| 26 if __name__ == '__main__': | |
| 27 main() | |
| 28 |
