summaryrefslogtreecommitdiff
path: root/realtime/rt/util.py
diff options
context:
space:
mode:
authorMichael Denkowski <mdenkows@cs.cmu.edu>2013-08-19 08:23:42 -0700
committerMichael Denkowski <mdenkows@cs.cmu.edu>2013-08-19 08:23:42 -0700
commitac469cdf4c70154a1c2cedce9edf5cdc3bdb2d61 (patch)
tree3e8bcbc6b00533e7a79e3cf28c2ac6aa4bdadd8d /realtime/rt/util.py
parentf4a3a2547316ca5d31366e6808858fe94981415c (diff)
Realtime translation (mostly a cdec wrapper for now)
Diffstat (limited to 'realtime/rt/util.py')
-rw-r--r--realtime/rt/util.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/realtime/rt/util.py b/realtime/rt/util.py
new file mode 100644
index 00000000..7f877161
--- /dev/null
+++ b/realtime/rt/util.py
@@ -0,0 +1,13 @@
+import subprocess
+import threading
+
+def popen_io(cmd):
+ p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ consume_stream(p.stderr)
+ return p
+
+def consume_stream(stream):
+ def consume(s):
+ for _ in s:
+ pass
+ threading.Thread(target=consume, args=(stream,)).start()