Mercurial > hg > MakeItSo
annotate makeitso/python_module/{{module}}.py @ 129:57834c2b0937
add a single-file module to the thingy
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Fri, 08 Jul 2011 10:43:48 -0700 |
parents | |
children | d9201f911458 |
rev | line source |
---|---|
129
57834c2b0937
add a single-file module to the thingy
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
1 #!/usr/bin/env python |
57834c2b0937
add a single-file module to the thingy
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
2 |
57834c2b0937
add a single-file module to the thingy
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
3 """ |
57834c2b0937
add a single-file module to the thingy
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
4 {{module}} |
57834c2b0937
add a single-file module to the thingy
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
5 """ |
57834c2b0937
add a single-file module to the thingy
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
6 |
57834c2b0937
add a single-file module to the thingy
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
7 import sys |
57834c2b0937
add a single-file module to the thingy
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
8 from optparse import OptionParser |
57834c2b0937
add a single-file module to the thingy
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
9 |
57834c2b0937
add a single-file module to the thingy
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
10 def main(args=sys.argv[1:]): |
57834c2b0937
add a single-file module to the thingy
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
11 |
57834c2b0937
add a single-file module to the thingy
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
12 # parse command line arguments |
57834c2b0937
add a single-file module to the thingy
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
13 usage = '%prog [options] ...' |
57834c2b0937
add a single-file module to the thingy
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
14 parser = OptionParser(usage=usage, description=__doc__) |
57834c2b0937
add a single-file module to the thingy
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
15 options, args = parser.parse_args(args) |
57834c2b0937
add a single-file module to the thingy
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
16 |
57834c2b0937
add a single-file module to the thingy
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
17 if __name__ == '__main__': |
57834c2b0937
add a single-file module to the thingy
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
18 main() |