[Python-modules-commits] [dockerpty] 01/03: Import dockerpty_0.3.4.orig.tar.gz

Jason Pleau jpleau-guest at moszumanska.debian.org
Fri Jun 12 20:06:32 UTC 2015


This is an automated email from the git hooks/post-receive script.

jpleau-guest pushed a commit to branch master
in repository dockerpty.

commit 9ed6f664487fe94a94eeb8830234b7dbe6baa1a3
Author: Jason Pleau <jason at jpleau.ca>
Date:   Fri Jun 12 15:46:41 2015 -0400

    Import dockerpty_0.3.4.orig.tar.gz
---
 PKG-INFO                        |  2 +-
 dockerpty.egg-info/PKG-INFO     |  2 +-
 dockerpty.egg-info/requires.txt |  2 +-
 dockerpty/io.py                 | 10 ++++++++--
 dockerpty/pty.py                | 15 +++++++--------
 setup.py                        |  2 +-
 6 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/PKG-INFO b/PKG-INFO
index 0b338d6..09b8a7b 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: dockerpty
-Version: 0.3.3
+Version: 0.3.4
 Summary: Python library to use the pseudo-tty of a docker container
 Home-page: https://github.com/d11wtq/dockerpty
 Author: Chris Corbyn
diff --git a/dockerpty.egg-info/PKG-INFO b/dockerpty.egg-info/PKG-INFO
index 0b338d6..09b8a7b 100644
--- a/dockerpty.egg-info/PKG-INFO
+++ b/dockerpty.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: dockerpty
-Version: 0.3.3
+Version: 0.3.4
 Summary: Python library to use the pseudo-tty of a docker container
 Home-page: https://github.com/d11wtq/dockerpty
 Author: Chris Corbyn
diff --git a/dockerpty.egg-info/requires.txt b/dockerpty.egg-info/requires.txt
index 82a6379..d083394 100644
--- a/dockerpty.egg-info/requires.txt
+++ b/dockerpty.egg-info/requires.txt
@@ -1 +1 @@
-six >= 1.3.0
\ No newline at end of file
+six >= 1.3.0
diff --git a/dockerpty/io.py b/dockerpty/io.py
index 1dfca9b..f4e8ced 100644
--- a/dockerpty/io.py
+++ b/dockerpty/io.py
@@ -323,7 +323,11 @@ class Pump(object):
     Pumps are selectable based on the 'read' end of the pipe.
     """
 
-    def __init__(self, from_stream, to_stream, wait_for_output=True):
+    def __init__(self,
+                 from_stream,
+                 to_stream,
+                 wait_for_output=True,
+                 propagate_close=True):
         """
         Initialize a Pump with a Stream to read from and another to write to.
 
@@ -335,6 +339,7 @@ class Pump(object):
         self.to_stream = to_stream
         self.eof = False
         self.wait_for_output = wait_for_output
+        self.propagate_close = propagate_close
 
     def fileno(self):
         """
@@ -363,7 +368,8 @@ class Pump(object):
 
             if read is None or len(read) == 0:
                 self.eof = True
-                self.to_stream.close()
+                if self.propagate_close:
+                    self.to_stream.close()
                 return None
 
             return self.to_stream.write(read)
diff --git a/dockerpty/pty.py b/dockerpty/pty.py
index 8588c01..febe684 100644
--- a/dockerpty/pty.py
+++ b/dockerpty/pty.py
@@ -132,17 +132,16 @@ class PseudoTerminal(object):
         """
 
         pty_stdin, pty_stdout, pty_stderr = self.sockets()
+        pumps = []
 
+        if pty_stdin and self.interactive:
+            pumps.append(io.Pump(io.Stream(self.stdin), pty_stdin, wait_for_output=False))
 
-        mappings = [
-            (pty_stdout, io.Stream(self.stdout), True),
-            (pty_stderr, io.Stream(self.stderr), True),
-        ]
+        if pty_stdout:
+            pumps.append(io.Pump(pty_stdout, io.Stream(self.stdout), propagate_close=False))
 
-        if self.interactive:
-            mappings.insert(0, (io.Stream(self.stdin), pty_stdin, False))
-
-        pumps = [io.Pump(a, b, c) for (a, b, c) in mappings if a and b]
+        if pty_stderr:
+            pumps.append(io.Pump(pty_stderr, io.Stream(self.stderr), propagate_close=False))
 
         if not self.container_info()['State']['Running']:
             self.client.start(self.container, **kwargs)
diff --git a/setup.py b/setup.py
index 001c94d..8a63aff 100644
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,7 @@ def read(filename):
 
 setup(
     name='dockerpty',
-    version='0.3.3',
+    version='0.3.4',
     description='Python library to use the pseudo-tty of a docker container',
     long_description=read('README.md'),
     url='https://github.com/d11wtq/dockerpty',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/dockerpty.git



More information about the Python-modules-commits mailing list