comparison cmd2.py @ 4:78033fd1078d

removing extra command-split
author catherine@cordelia
date Tue, 13 May 2008 09:21:43 -0400
parents 4520a1a073ff
children 47af95ad83c7
comparison
equal deleted inserted replaced
3:4520a1a073ff 4:78033fd1078d
118 self.stdout = open(redirect, mode) 118 self.stdout = open(redirect, mode)
119 else: 119 else:
120 statement = '%s %s' % (statement, self.fileimport(statement=statement, source=redirect)) 120 statement = '%s %s' % (statement, self.fileimport(statement=statement, source=redirect))
121 stop = cmd.Cmd.onecmd(self, statement) 121 stop = cmd.Cmd.onecmd(self, statement)
122 try: 122 try:
123 # unnecessary to compute command again?
124 command = statement.split(None,1)[0].lower()
125 if command not in self.excludeFromHistory: 123 if command not in self.excludeFromHistory:
126 self.history.append(statement) 124 self.history.append(statement)
127 finally: 125 finally:
128 if statekeeper: 126 if statekeeper:
129 self.stdout.close() 127 self.stdout.close()