Mercurial > hg > MakeItSo
comparison makeitso/makeitso.py @ 12:a6fd93354f23
add options for starting and ending braces (unused)
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Mon, 15 Nov 2010 07:55:45 -0800 |
parents | a77630b2b491 |
children | 99588f138993 |
comparison
equal
deleted
inserted
replaced
11:dac04742996b | 12:a6fd93354f23 |
---|---|
7 import re | 7 import re |
8 import subprocess | 8 import subprocess |
9 import sys | 9 import sys |
10 | 10 |
11 from optparse import OptionParser | 11 from optparse import OptionParser |
12 from tempita import Template | 12 |
13 | |
14 try: | |
15 import tempita | |
16 except ImportError: | |
17 raise NotImplementedError | |
13 | 18 |
14 # URL of this file | 19 # URL of this file |
15 location = 'http://k0s.org/mozilla/hg/MakeItSo/raw-file/tip/makeitso/makeitso.py' | 20 location = 'http://k0s.org/mozilla/hg/MakeItSo/raw-file/tip/makeitso/makeitso.py' |
16 | 21 |
17 # regular expressions for finding the shebang | 22 # regular expressions for finding the shebang |
92 def main(args=sys.argv[1:]): | 97 def main(args=sys.argv[1:]): |
93 | 98 |
94 # create option parser | 99 # create option parser |
95 usage = '%prog [options] template <template> <...>' | 100 usage = '%prog [options] template <template> <...>' |
96 parser = OptionParser(usage, description=__doc__) | 101 parser = OptionParser(usage, description=__doc__) |
102 parser.add_option('-[', '--start-braces', dest='start_braces', | |
103 help='starting delimeter') | |
104 parser.add_option('-]', '--end-braces', dest='end_braces', | |
105 help='starting delimeter') | |
97 parser.add_option('--commandline', dest='commandline', | 106 parser.add_option('--commandline', dest='commandline', |
98 action='store_true', default=False, | 107 action='store_true', default=False, |
99 help="print the commandline to invoke this script TTW") | 108 help="print the commandline to invoke this script TTW") |
100 parser.add_option('--variables', dest='variables', | 109 parser.add_option('--variables', dest='variables', |
101 action='store_true', default=False, | 110 action='store_true', default=False, |