annotate paint/main.py @ 2:4be44827e436

stubbing
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 21 Feb 2012 21:07:09 -0800
parents a011af5e765a
children 583f678eb0c9
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
2
4be44827e436 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
9 import tempfile
4be44827e436 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
10
4be44827e436 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
11 class InspectPackages(object):
4be44827e436 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
12 def __init__(self):
4be44827e436 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
13 pass
4be44827e436 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
14
4be44827e436 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
15 def cleanup(self):
4be44827e436 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
16 pass
4be44827e436 stubbing
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
17 __del__ = cleanup
0
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19 def main(args=sys.argv[:]):
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
20
1
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
21 # parse command line options
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
22 usage = '%prog [options]'
0
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
23
1
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
24 # description formatter
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
25 class PlainDescriptionFormatter(optparse.IndentedHelpFormatter):
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
26 def format_description(self, description):
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
27 if description:
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
28 return description + '\n'
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
29 else:
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
30 return ''
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
31
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
32 parser = optparse.OptionParser(usage=usage, description=__doc__, formatter=PlainDescriptionFormatter())
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
33 options, args = parser.parse_args(args)
0
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
34
96362e527bd6 initial package
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
35 if __name__ == '__main__':
1
a011af5e765a spacing
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
36 main()