comparison makeitso/template.py @ 62:30100690ad3f

display defaults with command line --help option
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 06 Jan 2011 17:49:40 -0800
parents 112bf081148c
children b91133e3b02d
comparison
equal deleted inserted replaced
61:57f9b0349192 62:30100690ad3f
7 from makeitso import ContentTemplate 7 from makeitso import ContentTemplate
8 from makeitso import PolyTemplate 8 from makeitso import PolyTemplate
9 9
10 class Undefined(object): 10 class Undefined(object):
11 """marker class for variables""" 11 """marker class for variables"""
12 def __int__(self):
13 return 0
12 Undefined = Undefined() # singleton 14 Undefined = Undefined() # singleton
13 15
14 class Variable(object): 16 class Variable(object):
15 """variable object for MakeItSo templates""" 17 """variable object for MakeItSo templates"""
16 18
91 else: 93 else:
92 path = os.path.join(self.location, template) 94 path = os.path.join(self.location, template)
93 assert os.path.exists(template) 95 assert os.path.exists(template)
94 96
95 def missing(self, **variables): 97 def missing(self, **variables):
98 missing = set([])
96 if self.look: 99 if self.look:
97 pass 100 pass
98 else: 101 else:
99 if self.usedefaults: 102 for var in self.vars:
100 pass 103 if self.usedefaults:
104 pass
105 else:
106 pass
101 107
102 def pre(self, **variables): 108 def pre(self, **variables):
103 """do stuff before interpolation""" 109 """do stuff before interpolation"""
104 110
105 def substitute(self, **variables): 111 def substitute(self, **variables):