def execute(self, context): if context.eval(self.expr): return self.body.execute(context) for elseif in self.elseifs: if elseif.execute(context): return if self.else_node: return self.else_node.execute(context)
def execute(self, context): filename = context.eval(self.expr) try: tree = _include_cache[filename] except KeyError: tree = None for prefix in path: fullname = os.path.join(prefix, filename) try: content = open(fullname, 'r').read() tree = parser.parse(content) break except IOError: pass if tree is None: raise IOError, "Could not find file '%s'" % filename tree.execute(context)
def execute(self, context): context.push() dict = context.eval(self.expr) context.update(dict) self.body.execute(context) context.pop()
def execute(self, context): list = context.eval(self.expr) for item in list: context.update(item) self.body.execute(context)
def execute(self, context): list = context.eval(self.expr) for item in list: context[self.var] = item self.body.execute(context)
def execute(self, context): if context.eval(self.expr): self.body.execute(context) return 1 return None