diff options
author | ankitjavalkar | 2016-12-19 11:44:55 +0530 |
---|---|---|
committer | ankitjavalkar | 2016-12-20 12:46:03 +0530 |
commit | f1da39aded67efa3da145851f0e9f687a3e434e5 (patch) | |
tree | c8713233fcaaf50e7e4a62b337258e7932fcf99c /yaksh/base_evaluator.py | |
parent | 80a4feef3c209e044e8cbe31e44c81d69136e100 (diff) | |
download | online_test-f1da39aded67efa3da145851f0e9f687a3e434e5.tar.gz online_test-f1da39aded67efa3da145851f0e9f687a3e434e5.tar.bz2 online_test-f1da39aded67efa3da145851f0e9f687a3e434e5.zip |
Change all evaluator structure and make sure eval test cases pass
Diffstat (limited to 'yaksh/base_evaluator.py')
-rw-r--r-- | yaksh/base_evaluator.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/yaksh/base_evaluator.py b/yaksh/base_evaluator.py index c8177b7..b290ba4 100644 --- a/yaksh/base_evaluator.py +++ b/yaksh/base_evaluator.py @@ -4,7 +4,13 @@ import traceback import pwd import os from os.path import join, isfile +from os.path import isdir, dirname, abspath, join, isfile, exists import subprocess +import stat + + +# Local imports +from .code_evaluator import MY_DIR, TimeoutException class BaseEvaluator(object): """Base Evaluator class containing generic attributes and callable methods""" @@ -64,3 +70,8 @@ class BaseEvaluator(object): test_case_path = join(MY_DIR, test_case_path) return ref_path, test_case_path + + def _set_file_as_executable(self, fname): + os.chmod(fname, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR + | stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP + | stat.S_IROTH | stat.S_IWOTH | stat.S_IXOTH) |