parameters: (self, ops)
docstring: Execute `ops` in the engine.
  
          Called recursively for the bodies of if's and loops.
docstring_summary: Execute `ops` in the engine.
docstring_tokens: Execute ops in the engine .
function: def execute(self, ops):
          """Execute `ops` in the engine.
  
          Called recursively for the bodies of if's and loops.
  
          """
          for op, args in ops:
              if op == 'lit':
                  self.result.append(args)
              elif op == 'exp':
                  try:
                      self.result.append(str(self.evaluate(args)))
                  except:
                      exc_class, exc, _ = sys.exc_info()
                      new_exc = exc_class("Couldn't evaluate {{ %s }}: %s"
                                          % (args, exc))
                      raise new_exc
              elif op == 'if':
                  expr, body = args
                  if self.evaluate(expr):
                      self.execute(body)
              elif op == 'for':
                  var, lis, body = args
                  vals = self.evaluate(lis)
                  for val in vals:
                      self.context[var] = val
                      self.execute(body)
              else:
                  raise AssertionError("TempliteEngine doesn't grok op %r" % op)
function_tokens: def execute ( self , ops ) : for op , args in ops : if op == 'lit' : self . result . append ( args ) elif op == 'exp' : try : self . result . append ( str ( self . evaluate ( args ) ) ) except : exc_class , exc , _ = sys . exc_info ( ) new_exc = exc_class ( "Couldn't evaluate {{ %s }}: %s" % ( args , exc ) ) raise new_exc elif op == 'if' : expr , body = args if self . evaluate ( expr ) : self . execute ( body ) elif op == 'for' : var , lis , body = args vals = self . evaluate ( lis ) for val in vals : self . context [ var ] = val self . execute ( body ) else : raise AssertionError ( "TempliteEngine doesn't grok op %r" % op )