From 3b56d8259d6aa8311f86e0561e40d0b17bc62534 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Fri, 4 Mar 2016 14:55:09 +0530 Subject: Language registry altered, Name cleanup: - set_registry will only act when registry is None - _setup, _teardown and _check_code are setup,teardown,check_code - Corresponding name changes in evaluator modules --- yaksh/code_evaluator.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'yaksh/code_evaluator.py') diff --git a/yaksh/code_evaluator.py b/yaksh/code_evaluator.py index 381b2e8..f877952 100644 --- a/yaksh/code_evaluator.py +++ b/yaksh/code_evaluator.py @@ -98,18 +98,18 @@ class CodeEvaluator(object): A tuple: (success, error message). """ - self._setup() - success, err = self._evaluate(self.test_case_args) - self._teardown() + self.setup() + success, err = self.safe_evaluate(self.test_case_args) + self.teardown() result = {'success': success, 'error': err} return result # Private Protocol ########## - def _setup(self): + def setup(self): self._change_dir(self.in_dir) - def _evaluate(self, args): + def safe_evaluate(self, args): # Add a new signal handler for the execution of this code. prev_handler = create_signal_handler() success = False @@ -117,7 +117,7 @@ class CodeEvaluator(object): # Do whatever testing needed. try: - success, err = self._check_code(*args) + success, err = self.check_code(*args) except TimeoutException: err = self.timeout_msg @@ -130,11 +130,11 @@ class CodeEvaluator(object): return success, err - def _teardown(self): + def teardown(self): # Cancel the signal delete_signal_handler() - def _check_code(self): + def check_code(self): raise NotImplementedError("check_code method not implemented") def create_submit_code_file(self, file_name): -- cgit