(self)
Flush the current output file to the ZIP container.
Flush the current output file to the ZIP container.
Flush the current output file to the ZIP container .
def EndFile(self):
    """Flush the current output file to the ZIP container."""
    if self._current_file_data:
      info = zipfile.ZipInfo(self._current_file_name,
                             date_time=self.ZipTimestamp())
      # This is a chmod 0644, but you have to read the zipfile sources to know
      info.external_attr = 0o644 << 16
      data = self._current_file_data.getvalue()
      # File contents may be utf-8
      if not isinstance(data, bytes):
        data = data.encode('utf-8')
      self._zip.writestr(info, data)
      self._current_file_data.close()
      self._current_file_data = None
def EndFile ( self ) : if self . _current_file_data : info = zipfile . ZipInfo ( self . _current_file_name , date_time = self . ZipTimestamp ( ) ) # This is a chmod 0644, but you have to read the zipfile sources to know info . external_attr = 0o644 << 16 data = self . _current_file_data . getvalue ( ) # File contents may be utf-8 if not isinstance ( data , bytes ) : data = data . encode ( 'utf-8' ) self . _zip . writestr ( info , data ) self . _current_file_data . close ( ) self . _current_file_data = None