diff options
author | ankitjavalkar | 2015-04-26 21:13:53 +0530 |
---|---|---|
committer | ankitjavalkar | 2015-04-26 21:13:53 +0530 |
commit | 18df6d88a2e1a9dfe7d05ca97b2d69ff0569e088 (patch) | |
tree | 3a12a2497964c26f3750d81cf04e7953e795514a /testapp/exam/evaluate_scilab_code.py | |
parent | 8664a766406d6acf0d6a1688948153c407ea27f2 (diff) | |
download | online_test-18df6d88a2e1a9dfe7d05ca97b2d69ff0569e088.tar.gz online_test-18df6d88a2e1a9dfe7d05ca97b2d69ff0569e088.tar.bz2 online_test-18df6d88a2e1a9dfe7d05ca97b2d69ff0569e088.zip |
Make PEP8 consistent
Diffstat (limited to 'testapp/exam/evaluate_scilab_code.py')
-rw-r--r-- | testapp/exam/evaluate_scilab_code.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/testapp/exam/evaluate_scilab_code.py b/testapp/exam/evaluate_scilab_code.py index cc46605..899abc9 100644 --- a/testapp/exam/evaluate_scilab_code.py +++ b/testapp/exam/evaluate_scilab_code.py @@ -13,7 +13,7 @@ from language_registry import registry class EvaluateScilabCode(EvaluateCode): """Tests the Scilab code obtained from Code Server""" - ## Public Protocol ########## + # Public Protocol ########## def evaluate_code(self): submit_path = self.create_submit_code_file('function.sci') ref_path, test_case_path = self.set_test_code_file_path() @@ -44,34 +44,34 @@ class EvaluateScilabCode(EvaluateCode): return success, err - ## Private Protocol ########## + # Private Protocol ########## def _remove_scilab_exit(self, string): """ Removes exit, quit and abort from the scilab code """ new_string = "" - i=0 + i = 0 for line in string.splitlines(): - new_line = re.sub(r"exit.*$","",line) - new_line = re.sub(r"quit.*$","",new_line) - new_line = re.sub(r"abort.*$","",new_line) + new_line = re.sub(r"exit.*$", "", line) + new_line = re.sub(r"quit.*$", "", new_line) + new_line = re.sub(r"abort.*$", "", new_line) if line != new_line: - i=i+1 - new_string = new_string +'\n'+ new_line + i = i + 1 + new_string = new_string + '\n' + new_line return new_string, i - ## Private Protocol ########## + # Private Protocol ########## def _get_error(self, string): """ Fetches only the error from the string. Returns None if no error. """ - obj = re.search("!.+\n.+",string); + obj = re.search("!.+\n.+", string) if obj: return obj.group() return None - ## Private Protocol ########## + # Private Protocol ########## def _strip_output(self, out): """ Cleans whitespace from the output @@ -83,4 +83,4 @@ class EvaluateScilabCode(EvaluateCode): return strip_out -registry.register('scilab', EvaluateScilabCode)
\ No newline at end of file +registry.register('scilab', EvaluateScilabCode) |