summaryrefslogtreecommitdiff
path: root/yaksh/cpp_code_evaluator.py
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/cpp_code_evaluator.py')
-rw-r--r--yaksh/cpp_code_evaluator.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/yaksh/cpp_code_evaluator.py b/yaksh/cpp_code_evaluator.py
index 29b24d5..c65242d 100644
--- a/yaksh/cpp_code_evaluator.py
+++ b/yaksh/cpp_code_evaluator.py
@@ -8,7 +8,7 @@ import importlib
# local imports
from code_evaluator import CodeEvaluator
-from copy_delete_files import CopyDeleteFiles
+from file_utils import copy_files, delete_files
class CppCodeEvaluator(CodeEvaluator):
@@ -27,9 +27,8 @@ class CppCodeEvaluator(CodeEvaluator):
os.remove(self.ref_output_path)
if os.path.exists(self.user_output_path):
os.remove(self.user_output_path)
- if self.files_list:
- file_delete = CopyDeleteFiles()
- file_delete.delete_files(self.files_list)
+ if self.files:
+ delete_files(self.files)
def set_file_paths(self):
user_output_path = os.getcwd() + '/output'
@@ -47,7 +46,7 @@ class CppCodeEvaluator(CodeEvaluator):
return compile_command, compile_main
def compile_code(self, user_answer, file_paths, test_case):
- self.files_list = []
+ self.files = []
if self.compiled_user_answer and self.compiled_test_code:
return None
else:
@@ -55,8 +54,7 @@ class CppCodeEvaluator(CodeEvaluator):
clean_ref_code_path, clean_test_case_path = \
self._set_test_code_file_path(ref_code_path)
if file_paths:
- file_copy = CopyDeleteFiles()
- self.files_list = file_copy.copy_files(file_paths)
+ self.files = copy_files(file_paths)
if not isfile(clean_ref_code_path):
msg = "No file at %s or Incorrect path" % clean_ref_code_path
return False, msg