From ed46c4a2cf6bbf41f50faafc785f001e3d10d195 Mon Sep 17 00:00:00 2001 From: maheshgudi Date: Mon, 26 Sep 2016 18:15:04 +0530 Subject: refactored stdio_evaluator --- yaksh/java_stdio_evaluator.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'yaksh/java_stdio_evaluator.py') diff --git a/yaksh/java_stdio_evaluator.py b/yaksh/java_stdio_evaluator.py index 27dd4a9..f4b8773 100644 --- a/yaksh/java_stdio_evaluator.py +++ b/yaksh/java_stdio_evaluator.py @@ -4,12 +4,11 @@ import os from os.path import isfile #local imports -from code_evaluator import CodeEvaluator -from stdio_evaluator import Evaluator +from stdio_evaluator import StdIOEvaluator from file_utils import copy_files, delete_files -class JavaStdioEvaluator(CodeEvaluator): +class JavaStdioEvaluator(StdIOEvaluator): """Evaluates Java StdIO based code""" def setup(self): @@ -61,11 +60,10 @@ class JavaStdioEvaluator(CodeEvaluator): stdout=subprocess.PIPE, stderr=subprocess.PIPE ) - evaluator = Evaluator() - success, err = evaluator.evaluate(user_answer, proc, - expected_input, - expected_output - ) + success, err = self.evaluate_stdio(user_answer, proc, + expected_input, + expected_output + ) os.remove(self.user_output_path) else: err = "Compilation Error:" -- cgit From ac8d6720bc75676e05462cc38ad144d5aedc14e7 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Wed, 21 Sep 2016 15:07:43 +0530 Subject: Migrate python code server and evaluators to python 2/3 compatible --- yaksh/java_stdio_evaluator.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'yaksh/java_stdio_evaluator.py') diff --git a/yaksh/java_stdio_evaluator.py b/yaksh/java_stdio_evaluator.py index f4b8773..71768ef 100644 --- a/yaksh/java_stdio_evaluator.py +++ b/yaksh/java_stdio_evaluator.py @@ -1,11 +1,13 @@ #!/usr/bin/env python +from __future__ import absolute_import import subprocess import os from os.path import isfile -#local imports -from stdio_evaluator import StdIOEvaluator -from file_utils import copy_files, delete_files +#Local imports +from .code_evaluator import CodeEvaluator +from .stdio_evaluator import Evaluator +from .file_utils import copy_files, delete_files class JavaStdioEvaluator(StdIOEvaluator): -- cgit From 6b6e58b06bd49e36edd87a027c08d223571a0c0b Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Tue, 27 Sep 2016 15:08:18 +0530 Subject: Fix test cases and corresponding changes in evaluators for Python 2/3 compatibility --- yaksh/java_stdio_evaluator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'yaksh/java_stdio_evaluator.py') diff --git a/yaksh/java_stdio_evaluator.py b/yaksh/java_stdio_evaluator.py index 71768ef..b5a52f3 100644 --- a/yaksh/java_stdio_evaluator.py +++ b/yaksh/java_stdio_evaluator.py @@ -18,10 +18,10 @@ class JavaStdioEvaluator(StdIOEvaluator): self.submit_code_path = self.create_submit_code_file('Test.java') def teardown(self): - super(JavaStdioEvaluator, self).teardown() os.remove(self.submit_code_path) if self.files: delete_files(self.files) + super(JavaStdioEvaluator, self).teardown() def set_file_paths(self, directory, file_name): output_path = "{0}{1}.class".format(directory, file_name) -- cgit From cb0569a32422a195d4165ef405ac5560024dabda Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Thu, 29 Sep 2016 18:10:09 +0530 Subject: Add unicode_literal import for Python2 --- yaksh/java_stdio_evaluator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'yaksh/java_stdio_evaluator.py') diff --git a/yaksh/java_stdio_evaluator.py b/yaksh/java_stdio_evaluator.py index b5a52f3..3199885 100644 --- a/yaksh/java_stdio_evaluator.py +++ b/yaksh/java_stdio_evaluator.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -from __future__ import absolute_import +from __future__ import unicode_literals import subprocess import os from os.path import isfile -- cgit From b515ee32315cc406a28549e3ba10d47d5e0e523b Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Fri, 30 Sep 2016 11:18:11 +0530 Subject: - Remove unused imports - Fix minor test case issues --- yaksh/java_stdio_evaluator.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'yaksh/java_stdio_evaluator.py') diff --git a/yaksh/java_stdio_evaluator.py b/yaksh/java_stdio_evaluator.py index 3199885..bc9cf80 100644 --- a/yaksh/java_stdio_evaluator.py +++ b/yaksh/java_stdio_evaluator.py @@ -5,8 +5,7 @@ import os from os.path import isfile #Local imports -from .code_evaluator import CodeEvaluator -from .stdio_evaluator import Evaluator +from .stdio_evaluator import StdIOEvaluator from .file_utils import copy_files, delete_files -- cgit