diff options
author | ankitjavalkar | 2016-03-04 14:55:09 +0530 |
---|---|---|
committer | ankitjavalkar | 2016-05-05 18:57:52 +0530 |
commit | 3b56d8259d6aa8311f86e0561e40d0b17bc62534 (patch) | |
tree | 50e18e5f688fbeb195633073c36f9ce045d32e48 /yaksh/code_evaluator.py | |
parent | 5ec456d5208df78ef87d0660e4bef430d553d65d (diff) | |
download | online_test-3b56d8259d6aa8311f86e0561e40d0b17bc62534.tar.gz online_test-3b56d8259d6aa8311f86e0561e40d0b17bc62534.tar.bz2 online_test-3b56d8259d6aa8311f86e0561e40d0b17bc62534.zip |
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
Diffstat (limited to 'yaksh/code_evaluator.py')
-rw-r--r-- | yaksh/code_evaluator.py | 16 |
1 files changed, 8 insertions, 8 deletions
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): |