Home | History | Annotate | Download | only in python2.7

Lines Matching refs:zinfo

883         for zinfo in self.filelist:
884 date = "%d-%02d-%02d %02d:%02d:%02d" % zinfo.date_time[:6]
885 print "%-46s %s %12d" % (zinfo.filename, date, zinfo.file_size)
890 for zinfo in self.filelist:
894 with self.open(zinfo.filename, "r") as f:
898 return zinfo.filename
954 zinfo = name
957 zinfo = self.getinfo(name)
959 zef_file.seek(zinfo.header_offset, 0)
973 if fname != zinfo.orig_filename:
976 zinfo.orig_filename, fname)
979 is_encrypted = zinfo.flag_bits & 0x1
996 if zinfo.flag_bits & 0x8:
998 check_byte = (zinfo._raw_time >> 8) & 0xff
1001 check_byte = (zinfo.CRC >> 24) & 0xff
1005 return ZipExtFile(zef_file, mode, zinfo, zd,
1084 def _writecheck(self, zinfo):
1086 if zinfo.filename in self.NameToInfo:
1088 print "Duplicate name:", zinfo.filename
1094 if zinfo.compress_type == ZIP_DEFLATED and not zlib:
1097 if zinfo.compress_type not in (ZIP_STORED, ZIP_DEFLATED):
1100 if zinfo.file_size > ZIP64_LIMIT:
1103 if zinfo.header_offset > ZIP64_LIMIT:
1126 zinfo = ZipInfo(arcname, date_time)
1127 zinfo.external_attr = (st[0] & 0xFFFF) << 16L # Unix attributes
1129 zinfo.compress_type = self.compression
1131 zinfo.compress_type = compress_type
1133 zinfo.file_size = st.st_size
1134 zinfo.flag_bits = 0x00
1135 zinfo.header_offset = self.fp.tell() # Start of header bytes
1137 self._writecheck(zinfo)
1141 zinfo.file_size = 0
1142 zinfo.compress_size = 0
1143 zinfo.CRC = 0
1144 self.filelist.append(zinfo)
1145 self.NameToInfo[zinfo.filename] = zinfo
1146 self.fp.write(zinfo.FileHeader(False))
1151 zinfo.CRC = CRC = 0
1152 zinfo.compress_size = compress_size = 0
1155 zinfo.file_size * 1.05 > ZIP64_LIMIT
1156 self.fp.write(zinfo.FileHeader(zip64))
1157 if zinfo.compress_type == ZIP_DEFLATED:
1177 zinfo.compress_size = compress_size
1179 zinfo.compress_size = file_size
1180 zinfo.CRC = CRC
1181 zinfo.file_size = file_size
1190 self.fp.seek(zinfo.header_offset, 0)
1191 self.fp.write(zinfo.FileHeader(zip64))
1193 self.filelist.append(zinfo)
1194 self.NameToInfo[zinfo.filename] = zinfo
1201 zinfo = ZipInfo(filename=zinfo_or_arcname,
1204 zinfo.compress_type = self.compression
1205 zinfo.external_attr = 0600 << 16
1207 zinfo = zinfo_or_arcname
1214 zinfo.compress_type = compress_type
1216 zinfo.file_size = len(bytes) # Uncompressed size
1217 zinfo.header_offset = self.fp.tell() # Start of header bytes
1218 self._writecheck(zinfo)
1220 zinfo.CRC = crc32(bytes) & 0xffffffff # CRC-32 checksum
1221 if zinfo.compress_type == ZIP_DEFLATED:
1225 zinfo.compress_size = len(bytes) # Compressed size
1227 zinfo.compress_size = zinfo.file_size
1228 zip64 = zinfo.file_size > ZIP64_LIMIT or \
1229 zinfo.compress_size > ZIP64_LIMIT
1232 self.fp.write(zinfo.FileHeader(zip64))
1234 if zinfo.flag_bits & 0x08:
1237 self.fp.write(struct.pack(fmt, zinfo.CRC, zinfo.compress_size,
1238 zinfo.file_size))
1240 self.filelist.append(zinfo)
1241 self.NameToInfo[zinfo.filename] = zinfo
1257 for zinfo in self.filelist: # write central directory
1259 dt = zinfo.date_time
1263 if zinfo.file_size > ZIP64_LIMIT \
1264 or zinfo.compress_size > ZIP64_LIMIT:
1265 extra.append(zinfo.file_size)
1266 extra.append(zinfo.compress_size)
1270 file_size = zinfo.file_size
1271 compress_size = zinfo.compress_size
1273 if zinfo.header_offset > ZIP64_LIMIT:
1274 extra.append(zinfo.header_offset)
1277 header_offset = zinfo.header_offset
1279 extra_data = zinfo.extra
1286 extract_version = max(45, zinfo.extract_version)
1287 create_version = max(45, zinfo.create_version)
1289 extract_version = zinfo.extract_version
1290 create_version = zinfo.create_version
1293 filename, flag_bits = zinfo._encodeFilenameFlags()
1296 zinfo.create_system, extract_version, zinfo.reserved,
1297 flag_bits, zinfo.compress_type, dostime, dosdate,
1298 zinfo.CRC, compress_size, file_size,
1299 len(filename), len(extra_data), len(zinfo.comment),
1300 0, zinfo.internal_attr, zinfo.external_attr,
1305 zinfo.create_system, extract_version, zinfo.reserved,
1306 zinfo.flag_bits, zinfo.compress_type, dostime, dosdate,
1307 zinfo.CRC, compress_size, file_size,
1308 len(zinfo.filename), len(extra_data), len(zinfo.comment),
1309 0, zinfo.internal_attr, zinfo.external_attr,
1315 self.fp.write(zinfo.comment)