Lines Matching refs:zinfo

887         for zinfo in self.filelist:
888 date = "%d-%02d-%02d %02d:%02d:%02d" % zinfo.date_time[:6]
889 print "%-46s %s %12d" % (zinfo.filename, date, zinfo.file_size)
894 for zinfo in self.filelist:
898 with self.open(zinfo.filename, "r") as f:
902 return zinfo.filename
958 zinfo = name
961 zinfo = self.getinfo(name)
963 zef_file.seek(zinfo.header_offset, 0)
977 if fname != zinfo.orig_filename:
980 zinfo.orig_filename, fname)
983 is_encrypted = zinfo.flag_bits & 0x1
1000 if zinfo.flag_bits & 0x8:
1002 check_byte = (zinfo._raw_time >> 8) & 0xff
1005 check_byte = (zinfo.CRC >> 24) & 0xff
1009 return ZipExtFile(zef_file, mode, zinfo, zd,
1088 def _writecheck(self, zinfo): argument
1090 if zinfo.filename in self.NameToInfo:
1092 warnings.warn('Duplicate name: %r' % zinfo.filename, stacklevel=3)
1098 if zinfo.compress_type == ZIP_DEFLATED and not zlib:
1101 if zinfo.compress_type not in (ZIP_STORED, ZIP_DEFLATED):
1108 elif zinfo.file_size > ZIP64_LIMIT:
1110 elif zinfo.header_offset > ZIP64_LIMIT:
1135 zinfo = ZipInfo(arcname, date_time)
1136 zinfo.external_attr = (st[0] & 0xFFFF) << 16L # Unix attributes
1138 zinfo.compress_type = ZIP_STORED
1140 zinfo.compress_type = self.compression
1142 zinfo.compress_type = compress_type
1144 zinfo.file_size = st.st_size
1145 zinfo.flag_bits = 0x00
1146 zinfo.header_offset = self.fp.tell() # Start of header bytes
1148 self._writecheck(zinfo)
1152 zinfo.file_size = 0
1153 zinfo.compress_size = 0
1154 zinfo.CRC = 0
1155 zinfo.external_attr |= 0x10 # MS-DOS directory flag
1156 self.filelist.append(zinfo)
1157 self.NameToInfo[zinfo.filename] = zinfo
1158 self.fp.write(zinfo.FileHeader(False))
1163 zinfo.CRC = CRC = 0
1164 zinfo.compress_size = compress_size = 0
1167 zinfo.file_size * 1.05 > ZIP64_LIMIT
1168 self.fp.write(zinfo.FileHeader(zip64))
1169 if zinfo.compress_type == ZIP_DEFLATED:
1189 zinfo.compress_size = compress_size
1191 zinfo.compress_size = file_size
1192 zinfo.CRC = CRC
1193 zinfo.file_size = file_size
1202 self.fp.seek(zinfo.header_offset, 0)
1203 self.fp.write(zinfo.FileHeader(zip64))
1205 self.filelist.append(zinfo)
1206 self.NameToInfo[zinfo.filename] = zinfo
1213 zinfo = ZipInfo(filename=zinfo_or_arcname,
1216 zinfo.compress_type = self.compression
1217 if zinfo.filename[-1] == '/':
1218 zinfo.external_attr = 0o40775 << 16 # drwxrwxr-x
1219 zinfo.external_attr |= 0x10 # MS-DOS directory flag
1221 zinfo.external_attr = 0o600 << 16 # ?rw-------
1223 zinfo = zinfo_or_arcname
1230 zinfo.compress_type = compress_type
1232 zinfo.file_size = len(bytes) # Uncompressed size
1233 zinfo.header_offset = self.fp.tell() # Start of header bytes
1234 self._writecheck(zinfo)
1236 zinfo.CRC = crc32(bytes) & 0xffffffff # CRC-32 checksum
1237 if zinfo.compress_type == ZIP_DEFLATED:
1241 zinfo.compress_size = len(bytes) # Compressed size
1243 zinfo.compress_size = zinfo.file_size
1244 zip64 = zinfo.file_size > ZIP64_LIMIT or \
1245 zinfo.compress_size > ZIP64_LIMIT
1248 self.fp.write(zinfo.FileHeader(zip64))
1250 if zinfo.flag_bits & 0x08:
1253 self.fp.write(struct.pack(fmt, zinfo.CRC, zinfo.compress_size,
1254 zinfo.file_size))
1256 self.filelist.append(zinfo)
1257 self.NameToInfo[zinfo.filename] = zinfo
1272 for zinfo in self.filelist: # write central directory
1273 dt = zinfo.date_time
1277 if zinfo.file_size > ZIP64_LIMIT \
1278 or zinfo.compress_size > ZIP64_LIMIT:
1279 extra.append(zinfo.file_size)
1280 extra.append(zinfo.compress_size)
1284 file_size = zinfo.file_size
1285 compress_size = zinfo.compress_size
1287 if zinfo.header_offset > ZIP64_LIMIT:
1288 extra.append(zinfo.header_offset)
1291 header_offset = zinfo.header_offset
1293 extra_data = zinfo.extra
1300 extract_version = max(45, zinfo.extract_version)
1301 create_version = max(45, zinfo.create_version)
1303 extract_version = zinfo.extract_version
1304 create_version = zinfo.create_version
1307 filename, flag_bits = zinfo._encodeFilenameFlags()
1310 zinfo.create_system, extract_version, zinfo.reserved,
1311 flag_bits, zinfo.compress_type, dostime, dosdate,
1312 zinfo.CRC, compress_size, file_size,
1313 len(filename), len(extra_data), len(zinfo.comment),
1314 0, zinfo.internal_attr, zinfo.external_attr,
1319 zinfo.create_system, extract_version, zinfo.reserved,
1320 zinfo.flag_bits, zinfo.compress_type, dostime, dosdate,
1321 zinfo.CRC, compress_size, file_size,
1322 len(zinfo.filename), len(extra_data), len(zinfo.comment),
1323 0, zinfo.internal_attr, zinfo.external_attr,
1329 self.fp.write(zinfo.comment)