Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ianj-als/pcl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/pcl/system/process.py')
-rw-r--r--src/runtime/pcl/system/process.py31
1 files changed, 31 insertions, 0 deletions
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)