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/bash_stdio_evaluator.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'yaksh/bash_stdio_evaluator.py') diff --git a/yaksh/bash_stdio_evaluator.py b/yaksh/bash_stdio_evaluator.py index 56f2e35..8ff0743 100644 --- a/yaksh/bash_stdio_evaluator.py +++ b/yaksh/bash_stdio_evaluator.py @@ -3,12 +3,12 @@ import subprocess import os from os.path import isfile -#local imports -from code_evaluator import CodeEvaluator -from stdio_evaluator import Evaluator +# local imports +from stdio_evaluator import StdIOEvaluator from file_utils import copy_files, delete_files -class BashStdioEvaluator(CodeEvaluator): + +class BashStdioEvaluator(StdIOEvaluator): """Evaluates Bash StdIO based code""" def setup(self): @@ -41,9 +41,8 @@ class BashStdioEvaluator(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 + ) return success, err -- 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/bash_stdio_evaluator.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'yaksh/bash_stdio_evaluator.py') diff --git a/yaksh/bash_stdio_evaluator.py b/yaksh/bash_stdio_evaluator.py index 8ff0743..fbb94ec 100644 --- a/yaksh/bash_stdio_evaluator.py +++ b/yaksh/bash_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 BashStdioEvaluator(StdIOEvaluator): -- 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/bash_stdio_evaluator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'yaksh/bash_stdio_evaluator.py') diff --git a/yaksh/bash_stdio_evaluator.py b/yaksh/bash_stdio_evaluator.py index fbb94ec..8545ccb 100644 --- a/yaksh/bash_stdio_evaluator.py +++ b/yaksh/bash_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/bash_stdio_evaluator.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'yaksh/bash_stdio_evaluator.py') diff --git a/yaksh/bash_stdio_evaluator.py b/yaksh/bash_stdio_evaluator.py index 8545ccb..e5e0da6 100644 --- a/yaksh/bash_stdio_evaluator.py +++ b/yaksh/bash_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