def generate()

in static/downloads/ezt.py [0:0]


  def generate(self, fp, data):
    if hasattr(data, '__getitem__') or callable(getattr(data, 'keys', None)):
      # a dictionary-like object was passed. convert it to an
      # attribute-based object.
      class _data_ob:
        def __init__(self, d):
          vars(self).update(d)
      data = _data_ob(data)

    ctx = _context()
    ctx.data = data
    ctx.for_index = { }
    ctx.defines = { }
    self._execute(self.program, fp, ctx)