]> TLD Linux GIT Repositories - TLD.git/blobdiff - pld-builder.new/PLD_Builder/pipeutil.py
- moved to separate repo
[TLD.git] / pld-builder.new / PLD_Builder / pipeutil.py
diff --git a/pld-builder.new/PLD_Builder/pipeutil.py b/pld-builder.new/PLD_Builder/pipeutil.py
deleted file mode 100644 (file)
index 4979fea..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-# vi: encoding=utf-8 ts=8 sts=4 sw=4 et
-
-import select
-import os
-import StringIO
-
-def rw_pipe(buf_, infd, outfd):
-    buf = StringIO.StringIO()
-    buf.write(buf_.read())
-    ret = StringIO.StringIO()
-    pos = 0
-    rd_fin = 0
-    wr_fin = 0
-    buf.seek(pos)
-    while not (rd_fin and wr_fin):
-        if wr_fin:
-            o = []
-        else:
-            o = [infd]
-        if rd_fin:
-            i = []
-        else:
-            i = [outfd]
-        i, o, e = select.select(i, o, [])
-        if i != []:
-            s = os.read(outfd.fileno(), 1000)
-            if s == "":
-                rd_fin = 1
-            ret.write(s)
-        if o != []:
-            buf.seek(pos)
-            s = buf.read(1000)
-            if s == "":
-                infd.close()
-                wr_fin = 1
-            else:
-                cnt = os.write(infd.fileno(), s)
-                pos += cnt
-    outfd.close()
-    ret.seek(0)
-    return ret