annotate paint/main.py @ 1:a011af5e765a

spacing
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 21 Feb 2012 20:56:02 -0800
parents 96362e527bd6
children 4be44827e436
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 #!/usr/bin/env python
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 """
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4 python PAckage INTrospection
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5 """
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 import sys
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 import optparse
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 def main(args=sys.argv[:]):
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11
1
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
12 # parse command line options
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
13 usage = '%prog [options]'
0
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14
1
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
15 # description formatter
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
16 class PlainDescriptionFormatter(optparse.IndentedHelpFormatter):
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
17 def format_description(self, description):
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
18 if description:
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
19 return description + '\n'
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
20 else:
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
21 return ''
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
22
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
23 parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter())
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
24 options, args = parser.parse_args(args)
0
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
25
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
26 if __name__ == '__main__':
1
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
27 main()