| 327 | self.configCache = path |
| 328 | |
| 329 | def __moveFile(self, origPath, path): |
| 330 | if not os.path.exists(path): |
| 331 | os.makedirs(path) |
| 332 | originalName = os.path.basename(origPath) |
| 333 | if originalName.count(".") == 1: |
| 334 | originalName += "." + str(uuid.uuid4()) |
| 335 | zipped_file_name = path + "/" + originalName + ".gz" |
| 336 | with open(origPath, 'rb') as f_in, gzip.open(zipped_file_name, 'wb') as f_out: |
| 337 | shutil.copyfileobj(f_in, f_out) |
| 338 | os.remove(origPath) |
| 339 | |
| 340 | logging.debug("Processed file written to %s", zipped_file_name) |