Commit edd63d35 authored by Amos Latteier's avatar Amos Latteier

Added ready method.

parent 1a746230
......@@ -58,3 +58,18 @@ class OutputPipe:
else: self._buf=[]
return join(b,'')
finally: self._r()
def ready(self):
"""Pipe status, medusa producer style.
Return 1 if the pipe is open and has data.
Return None if the pipe is open but has no data.
Return 1 if the pipe is closed.
"""
self._a()
try:
b=self._buf
if b is None: return 1
if not b: return None
return 1
finally: self._r()
......@@ -58,3 +58,18 @@ class OutputPipe:
else: self._buf=[]
return join(b,'')
finally: self._r()
def ready(self):
"""Pipe status, medusa producer style.
Return 1 if the pipe is open and has data.
Return None if the pipe is open but has no data.
Return 1 if the pipe is closed.
"""
self._a()
try:
b=self._buf
if b is None: return 1
if not b: return None
return 1
finally: self._r()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment