def _cmd_print()

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


  def _cmd_print(self, (transforms, valref), fp, ctx, filename, line_number):
    value = _get_value(valref, ctx, filename, line_number)
    # if the value has a 'read' attribute, then it is a stream: copy it
    if hasattr(value, 'read'):
      while 1:
        chunk = value.read(16384)
        if not chunk:
          break
        for t in transforms:
          chunk = t(chunk)
        fp.write(chunk)
    else:
      for t in transforms:
        value = t(value)
      fp.write(value)