diff options
Diffstat (limited to 'run/executable/executable.py')
| -rw-r--r-- | run/executable/executable.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/run/executable/executable.py b/run/executable/executable.py index 263e305..a2426f1 100644 --- a/run/executable/executable.py +++ b/run/executable/executable.py | |||
| @@ -6,9 +6,10 @@ from common import get_executable | |||
| 6 | class Executable(object): | 6 | class Executable(object): |
| 7 | '''Parent object that represents an executable for use in task-sets.''' | 7 | '''Parent object that represents an executable for use in task-sets.''' |
| 8 | 8 | ||
| 9 | def __init__(self, exec_file, extra_args=None, stdout_file = None, stderr_file = None): | 9 | def __init__(self, exec_file, extra_args=None, stdout_file = None, |
| 10 | stderr_file = None, cwd = None): | ||
| 10 | self.exec_file = get_executable(exec_file) | 11 | self.exec_file = get_executable(exec_file) |
| 11 | self.cwd = None | 12 | self.cwd = cwd |
| 12 | self.stdout_file = stdout_file | 13 | self.stdout_file = stdout_file |
| 13 | self.stderr_file = stderr_file | 14 | self.stderr_file = stderr_file |
| 14 | self.sp = None | 15 | self.sp = None |
| @@ -58,6 +59,9 @@ class Executable(object): | |||
| 58 | def interrupt(self): | 59 | def interrupt(self): |
| 59 | self.sp.send_signal(signal.SIGINT) | 60 | self.sp.send_signal(signal.SIGINT) |
| 60 | 61 | ||
| 62 | def poll(self): | ||
| 63 | return self.sp.poll() | ||
| 64 | |||
| 61 | def terminate(self): | 65 | def terminate(self): |
| 62 | '''Send the terminate signal to the binary.''' | 66 | '''Send the terminate signal to the binary.''' |
| 63 | self.sp.terminate() | 67 | self.sp.terminate() |
