Mercurial > python-cmd2
comparison cmd2.py @ 52:49de899a05a8
new unified pipe and redirect works on wc
author | catherine@localhost |
---|---|
date | Mon, 09 Jun 2008 10:28:46 -0400 |
parents | 26e33f64f68e |
children | 2811505b0969 |
comparison
equal
deleted
inserted
replaced
51:26e33f64f68e | 52:49de899a05a8 |
---|---|
273 finally: | 273 finally: |
274 if statekeeper: | 274 if statekeeper: |
275 if redirect == self._TO_PASTE_BUFFER: | 275 if redirect == self._TO_PASTE_BUFFER: |
276 self.stdout.seek(0) | 276 self.stdout.seek(0) |
277 writeToPasteBuffer(self.stdout.read()) | 277 writeToPasteBuffer(self.stdout.read()) |
278 elif isinstance(redirect, subprocess.Popen): | |
279 for result in redirect.communicate(): | |
280 statekeeper.stdout.write(result or '') | |
278 self.stdout.close() | 281 self.stdout.close() |
279 statekeeper.restore() | 282 statekeeper.restore() |
280 if isinstance(redirect, subprocess.Popen): | 283 |
281 for result in redirect.communicate(): | |
282 self.stdout.write(result or '') | |
283 return stop | 284 return stop |
284 | 285 |
285 statementEndPattern = re.compile(r'[%s]\s*$' % terminators) | 286 statementEndPattern = re.compile(r'[%s]\s*$' % terminators) |
286 def statementHasEnded(self, lines): | 287 def statementHasEnded(self, lines): |
287 #import pdb; pdb.set_trace() | 288 #import pdb; pdb.set_trace() |