##// END OF EJS Templates
sshpeer: rename 'size' to 'data' in doublepipe...
Pierre-Yves David -
r25455:dc02a284 default
parent child Browse files
Show More
@@ -81,10 +81,11 b' class doublepipe(object):'
81 def readline(self):
81 def readline(self):
82 return self._call('readline')
82 return self._call('readline')
83
83
84 def _call(self, methname, size=None):
84 def _call(self, methname, data=None):
85 """call <methname> on "main", forward output of "side" while blocking
85 """call <methname> on "main", forward output of "side" while blocking
86 """
86 """
87 if size == 0 or self._main.closed:
87 # data can be '' or 0
88 if (data is not None and not data) or self._main.closed:
88 _forwardoutput(self._ui, self._side)
89 _forwardoutput(self._ui, self._side)
89 return ''
90 return ''
90 while True:
91 while True:
@@ -93,10 +94,10 b' class doublepipe(object):'
93 _forwardoutput(self._ui, self._side)
94 _forwardoutput(self._ui, self._side)
94 if mainready:
95 if mainready:
95 meth = getattr(self._main, methname)
96 meth = getattr(self._main, methname)
96 if size is None:
97 if data is None:
97 return meth()
98 return meth()
98 else:
99 else:
99 return meth(size)
100 return meth(data)
100
101
101 def close(self):
102 def close(self):
102 return self._main.close()
103 return self._main.close()
General Comments 0
You need to be logged in to leave comments. Login now