comparison cmd2.py @ 246:2e37155d2b95

history fix
author catherine@Elli.myhome.westell.com
date Thu, 26 Mar 2009 23:13:49 -0400
parents 2cda5a817e5a
children 3db4166a54ce
comparison
equal deleted inserted replaced
245:2cda5a817e5a 246:2e37155d2b95
586 self.pseudo_raw_input(self.continuation_prompt)) 586 self.pseudo_raw_input(self.continuation_prompt))
587 statement = self.parsed(statement) 587 statement = self.parsed(statement)
588 except Exception, e: 588 except Exception, e:
589 print e 589 print e
590 return 0 590 return 0
591 591 if statement.parsed.command not in self.excludeFromHistory:
592 self.history.append(statement.parsed.raw)
592 try: 593 try:
593 (stop, statement) = self.postparsing_precmd(statement) 594 (stop, statement) = self.postparsing_precmd(statement)
594 except Exception, e: 595 except Exception, e:
595 print str(e) 596 print str(e)
596 return 0 597 return 0
640 stop = func(statement) 641 stop = func(statement)
641 if self.timing: 642 if self.timing:
642 print 'Elapsed: %s' % str(datetime.datetime.now() - timestart) 643 print 'Elapsed: %s' % str(datetime.datetime.now() - timestart)
643 except Exception, e: 644 except Exception, e:
644 print e 645 print e
645 try:
646 if statement.parsed.command not in self.excludeFromHistory:
647 self.history.append(statement.parsed.raw)
648 finally: 646 finally:
649 if statekeeper: 647 if statekeeper:
650 if statement.parsed.output and not statement.parsed.outputTo: 648 if statement.parsed.output and not statement.parsed.outputTo:
651 self.stdout.seek(0) 649 self.stdout.seek(0)
652 try: 650 try: