adding tempdir back

This commit is contained in:
Andrew 2022-01-09 22:27:43 -05:00
parent b815cf38a8
commit deeff1717b

View File

@ -780,11 +780,9 @@ class Helpers:
.format(os.path.join(folder, filename), os.path.join(folder, filename), os.path.join(folder, filename), os.path.join(folder, filename), filename, os.path.join(folder, filename), os.path.join(folder, filename), filename, filename) .format(os.path.join(folder, filename), os.path.join(folder, filename), os.path.join(folder, filename), os.path.join(folder, filename), filename, os.path.join(folder, filename), os.path.join(folder, filename), filename, filename)
return output return output
def unzipServer(self, zip_path, user_id): @staticmethod
temp_uuid = str(uuid.uuid4()) + 'temp' def unzipServer(zip_path, user_id):
servers_path = str(self.get_servers_root_dir()) tempDir = tempfile.mkdtemp()
tempDir = os.path.join(servers_path, temp_uuid)
os.mkdir(tempDir)
with zipfile.ZipFile(zip_path, 'r') as zip_ref: with zipfile.ZipFile(zip_path, 'r') as zip_ref:
#extracts archive to temp directory #extracts archive to temp directory
zip_ref.extractall(tempDir) zip_ref.extractall(tempDir)