From cc3d9b409f0c8bfb1a6f9001dd66020595c49215 Mon Sep 17 00:00:00 2001 From: Egor Matveev Date: Sat, 13 Nov 2021 18:15:37 +0300 Subject: [PATCH] http --- SprintLib/testers/BaseTester.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/SprintLib/testers/BaseTester.py b/SprintLib/testers/BaseTester.py index 6930c75..74691da 100644 --- a/SprintLib/testers/BaseTester.py +++ b/SprintLib/testers/BaseTester.py @@ -1,6 +1,5 @@ from os import listdir, mkdir from os.path import join, exists -from shutil import copyfile, rmtree from subprocess import call, TimeoutExpired from Main.management.commands.bot import bot @@ -62,10 +61,10 @@ class BaseTester: for file in SolutionFile.objects.filter(solution=self.solution): dirs = file.path.split('/') for i in range(len(dirs) - 1): - name = join(str(self.solution.id), '/'.join(dirs[:i + 1])) + name = join(str("solutions/" + self.solution.id), '/'.join(dirs[:i + 1])) if not exists(name): mkdir(name) - with open(join(str(self.solution.id), file.path), 'wb') as fs: + with open(join("solutions/" + str(self.solution.id), file.path), 'wb') as fs: fs.write(get_bytes(file.fs_id)) self.solution.result = CONSTS["testing_status"] self.solution.save() @@ -74,7 +73,7 @@ class BaseTester: call(docker_command, shell=True) print("Container created") for file in ExtraFile.objects.filter(task=self.solution.task): - with open(join(str(self.solution.id), file.filename), 'wb') as fs: + with open(join("solutions/" + str(self.solution.id), file.filename), 'wb') as fs: fs.write(get_bytes(file.fs_id)) print("Files copied") try: