annotate makeitso/python_package/{{package}}/template.py @ 86:2c1310e94645

try to interpolate templates
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 10 Jan 2011 12:39:26 -0800
parents c434b83ab600
children e74baa8e6df4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
78
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 #!/usr/bin/env python
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 """
82
c434b83ab600 add a template to create templates. tricky, eh?
Jeff Hammel <jhammel@mozilla.com>
parents: 78
diff changeset
4 {{project}} template for makeitso
78
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5 """
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 import sys
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 from cli import MakeItSoCLI
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 from optparse import OptionParser
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 from template import MakeItSoTemplate
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11
82
c434b83ab600 add a template to create templates. tricky, eh?
Jeff Hammel <jhammel@mozilla.com>
parents: 78
diff changeset
12 class {{project}}Template(MakeItSoTemplate):
78
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13 """
82
c434b83ab600 add a template to create templates. tricky, eh?
Jeff Hammel <jhammel@mozilla.com>
parents: 78
diff changeset
14 {{project}} template
78
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15 """
82
c434b83ab600 add a template to create templates. tricky, eh?
Jeff Hammel <jhammel@mozilla.com>
parents: 78
diff changeset
16 name = '{{project}}'
c434b83ab600 add a template to create templates. tricky, eh?
Jeff Hammel <jhammel@mozilla.com>
parents: 78
diff changeset
17 templates = ['template']
78
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18 look = True
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19
82
c434b83ab600 add a template to create templates. tricky, eh?
Jeff Hammel <jhammel@mozilla.com>
parents: 78
diff changeset
20 class TemplateCLI(MakeItSoCLI):
c434b83ab600 add a template to create templates. tricky, eh?
Jeff Hammel <jhammel@mozilla.com>
parents: 78
diff changeset
21 """
c434b83ab600 add a template to create templates. tricky, eh?
Jeff Hammel <jhammel@mozilla.com>
parents: 78
diff changeset
22 CLI driver for the {{project}} template
c434b83ab600 add a template to create templates. tricky, eh?
Jeff Hammel <jhammel@mozilla.com>
parents: 78
diff changeset
23 """
78
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
24
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
25 def main(args=sys.argv[:]):
82
c434b83ab600 add a template to create templates. tricky, eh?
Jeff Hammel <jhammel@mozilla.com>
parents: 78
diff changeset
26 cli = TemplateCLI()
c434b83ab600 add a template to create templates. tricky, eh?
Jeff Hammel <jhammel@mozilla.com>
parents: 78
diff changeset
27 template = cli.parse()
c434b83ab600 add a template to create templates. tricky, eh?
Jeff Hammel <jhammel@mozilla.com>
parents: 78
diff changeset
28 template.substitue()
78
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
29
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
30 if __name__ == '__main__':
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
31 main()
d4184945f8a8 stub out python package creation
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
32