diff options
author | Ian Johnson <ianj@wgrids.com> | 2013-10-29 17:35:49 +0400 |
---|---|---|
committer | Ian Johnson <ianj@wgrids.com> | 2013-10-29 17:35:49 +0400 |
commit | e8947ec00d3c687c5fd9d047f003529c3de2aef8 (patch) | |
tree | d44ade80b970acde0336326b7e5b8bc006b9fbfc | |
parent | bfe104d15ef943ad17b75c9415a6322aca28db6f (diff) |
Added process runtime library.
-rw-r--r-- | src/runtime/pcl/system/__init__.py | 0 | ||||
-rw-r--r-- | src/runtime/pcl/system/process.py | 31 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/runtime/pcl/system/__init__.py b/src/runtime/pcl/system/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/runtime/pcl/system/__init__.py diff --git a/src/runtime/pcl/system/process.py b/src/runtime/pcl/system/process.py new file mode 100644 index 0000000..0b086be --- /dev/null +++ b/src/runtime/pcl/system/process.py @@ -0,0 +1,31 @@ +# +# Copyright Capita Translation and Interpreting 2013 +# +# This file is part of Pipeline Creation Language (PCL). +# +# Pipeline Creation Language (PCL) is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Pipeline Creation Language (PCL) is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Pipeline Creation Language (PCL). If not, see <http://www.gnu.org/licenses/>. +# +import subprocess +import sys + +# callAndCheck :: String -> File -> File -> File +def callAndCheck(program, + stdin_stream = sys.stdin, + stdout_stream = sys.stdout, + stderr_stream = sys.stderr): + subprocess.check_call(program, + stdin = stdin_stream, + stdout = stdout_stream, + stderr = stderr_stream, + shell = True) |