comparison cmd2.py @ 54:a791d615545c

oops, had to fix for redirect plus pipe
author catherine@localhost
date Mon, 09 Jun 2008 12:05:39 -0400
parents 2811505b0969
children f844b6c78192 f20dcfa69341 37f471fb29b1
comparison
equal deleted inserted replaced
53:2811505b0969 54:a791d615545c
264 if mode in ('w','a'): 264 if mode in ('w','a'):
265 statekeeper = Statekeeper(self, ('stdout',)) 265 statekeeper = Statekeeper(self, ('stdout',))
266 self.stdout = open(redirect, mode) 266 self.stdout = open(redirect, mode)
267 else: 267 else:
268 statement = '%s %s' % (statement, self.fileimport(statement=statement, source=redirect)) 268 statement = '%s %s' % (statement, self.fileimport(statement=statement, source=redirect))
269 stop = cmd.Cmd.onecmd(self, statement) 269 if isinstance(redirect, subprocess.Popen):
270 stop = self.onecmd(statement)
271 else:
272 stop = cmd.Cmd.onecmd(self, statement)
270 try: 273 try:
271 if command not in self.excludeFromHistory: 274 if command not in self.excludeFromHistory:
272 self.history.append(originalStatement) 275 self.history.append(originalStatement)
273 finally: 276 finally:
274 if statekeeper: 277 if statekeeper: