def __call__(self,event=None): try: exec correct_indentation(self.tag.text) except Exception, e: print e print correct_indentation(self.tag.text) pdb.set_trace()
def _init(self): # create the function text with the proper indentation func = ("def %s(%s):" % (self.name, self.args)) + "\n" for line in correct_indentation(self.tag.text).splitlines(): func += " " + line + "\n" # execute the function, it's now in the scope exec func in self.parent.__dict__
def _init(self): func = ("def %s(%s):" % (self.on, self.arg)) + "\n" for line in correct_indentation(self.python_statement).splitlines(): func += " " + line + "\n" # execute the function, it's now in the scope exec func in self.parent.__dict__ # create the function as a bound method # exec "new_bound_method = types.MethodType( new_temp_method, self.parent, wildfire.tags['%s'] )" % ( self.parent.__tag__ ) self.parent.senders_[self.on] = {self: self.parent[self.on]}
def construct(self): exec correct_indentation(self.tag.text)