(self, z, files, *, file_comment=None, prefix='')
| 131 | f.write(data) |
| 132 | |
| 133 | def writeZip(self, z, files, *, file_comment=None, prefix=''): |
| 134 | for name, data in files.items(): |
| 135 | if isinstance(data, tuple): |
| 136 | mtime, data = data |
| 137 | else: |
| 138 | mtime = NOW |
| 139 | name = name.replace(os.sep, '/') |
| 140 | zinfo = ZipInfo(prefix + name, time.localtime(mtime)) |
| 141 | zinfo.compress_type = self.compression |
| 142 | if file_comment is not None: |
| 143 | zinfo.comment = file_comment |
| 144 | if data is None: |
| 145 | zinfo.CRC = 0 |
| 146 | z.mkdir(zinfo) |
| 147 | else: |
| 148 | assert name[-1] != '/' |
| 149 | z.writestr(zinfo, data) |
| 150 | |
| 151 | def getZip64Files(self): |
| 152 | # This is the simplest way to make zipfile generate the zip64 EOCD block |
no test coverage detected