comparison cmd2.py @ 294:e7c89e34b39b

fixed default failure
author catherine@bothari
date Fri, 22 Jan 2010 04:46:15 -0500
parents bbc339f3ddeb
children f5593299fc2a
comparison
equal deleted inserted replaced
293:bbc339f3ddeb 294:e7c89e34b39b
726 try: 726 try:
727 try: 727 try:
728 # "heart" of the command, replaces cmd's onecmd() 728 # "heart" of the command, replaces cmd's onecmd()
729 self.lastcmd = statement.parsed.expanded 729 self.lastcmd = statement.parsed.expanded
730 funcname = self.func_named(statement.parsed.command) 730 funcname = self.func_named(statement.parsed.command)
731 full_statement = ParsedString(statement.parsed.raw)
732 full_statement.parsed = statement.parsed
731 if not funcname: 733 if not funcname:
732 return self.postparsing_postcmd(self.default(statement)) 734 return self.postparsing_postcmd(self.default(full_statement))
733 try: 735 try:
734 func = getattr(self, funcname) 736 func = getattr(self, funcname)
735 except AttributeError: 737 except AttributeError:
736 return self.postparsing_postcmd(self.default(statement)) 738 return self.postparsing_postcmd(self.default(full_statement))
737 timestart = datetime.datetime.now() 739 timestart = datetime.datetime.now()
738 stop = func(statement) 740 stop = func(statement)
739 if self.timing: 741 if self.timing:
740 self.pfeedback('Elapsed: %s' % str(datetime.datetime.now() - timestart)) 742 self.pfeedback('Elapsed: %s' % str(datetime.datetime.now() - timestart))
741 except Exception, e: 743 except Exception, e: