comparison makeitso/template.py @ 69:a75138a952d0

using **kw doesnt update the actual dict; fix this
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 07 Jan 2011 11:12:20 -0800
parents a0f7bfa98755
children cb00c011ff45
comparison
equal deleted inserted replaced
68:cce0da329f59 69:a75138a952d0
125 # scan templates for other variables 125 # scan templates for other variables
126 raise NotImplementedError 126 raise NotImplementedError
127 127
128 return missing 128 return missing
129 129
130 def pre(self, **variables): 130 def pre(self, variables):
131 """do stuff before interpolation""" 131 """do stuff before interpolation"""
132 132
133 def substitute(self, **variables): 133 def substitute(self, **variables):
134 """do the substitution""" 134 """do the substitution"""
135 135
136 vars = self.get_variables(**variables) 136 vars = self.get_variables(**variables)
137 self.pre(**vars) 137 self.pre(vars)
138 self.check_missing(vars) 138 self.check_missing(vars)
139 139
140 # do the substitution 140 # do the substitution
141 template = PolyTemplate(self._templates, 141 template = PolyTemplate(self._templates,
142 output=self.output, 142 output=self.output,
143 interactive=self.interactive, 143 interactive=self.interactive,
144 variables=vars) 144 variables=vars)
145 template.substitute() 145 template.substitute()
146 146
147 self.post(**variables) 147 self.post(vars)
148 148
149 def post(self, **variables): 149 def post(self, variables):
150 """do stuff after interpolation""" 150 """do stuff after interpolation"""
151 151
152 def read_variables(self, variables): 152 def read_variables(self, variables):
153 """read variables from stdin""" 153 """read variables from stdin"""
154 retval = {} 154 retval = {}