summaryrefslogtreecommitdiff
path: root/yaksh/base_evaluator.py
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/base_evaluator.py')
-rw-r--r--yaksh/base_evaluator.py11
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)