code: def write_file(self, name, contents):
          
          # TODO: find a way to make ZipFile accept a file object.
          zi = zipfile.ZipInfo(name)
          zi.date_time = time.localtime(time.time())[:6]
          zi.compress_type = zipfile.ZIP_DEFLATED
          zi.external_attr = 0777 << 16L
          self.zip_file.writestr(zi, contents)
docs: Write file contents string into archive.