equal
deleted
inserted
replaced
222 # Optimization for direct file to ZIP export. |
222 # Optimization for direct file to ZIP export. |
223 # There's no need to juggle the data through ConE code |
223 # There's no need to juggle the data through ConE code |
224 # when we can just write the file directly into the ZIP |
224 # when we can just write the file directly into the ZIP |
225 if isinstance(storage, zipstorage.ZipStorage): |
225 if isinstance(storage, zipstorage.ZipStorage): |
226 source_abspath = os.path.join(self.rootpath, path) |
226 source_abspath = os.path.join(self.rootpath, path) |
227 logging.getLogger("cone").debug("Exporting directly from file to ZIP: %r -> %r" % (source_abspath, path)) |
227 logging.getLogger("cone").debug("Pre-caching: %r -> %r" % (source_abspath, path)) |
228 storage.zipfile.write(source_abspath, path) |
228 storage.cache[path] = source_abspath |
|
229 storage.modified = True |
229 else: |
230 else: |
230 wres = storage.open_resource(path,'wb') |
231 wres = storage.open_resource(path,'wb') |
231 res = self.open_resource(path,"rb") |
232 res = self.open_resource(path,"rb") |
232 wres.write(res.read()) |
233 wres.write(res.read()) |
233 wres.close() |
234 wres.close() |