Mercurial > python-cmd2
diff cmd2.py @ 251:bc6dec08275f 0.5.1
transcript tests work
author | catherine@Elli.myhome.westell.com |
---|---|
date | Mon, 30 Mar 2009 14:33:11 -0400 |
parents | ff541573fb5b |
children | 24289178b367 |
line wrap: on
line diff
--- a/cmd2.py Mon Mar 30 13:20:05 2009 -0400 +++ b/cmd2.py Mon Mar 30 14:33:11 2009 -0400 @@ -635,9 +635,13 @@ self.lastcmd = statement.parsed.expanded funcname = self.func_named(statement.parsed.command) if not funcname: - return self.postparsing_postcmd(self.default(statement)) + return self.postparsing_postcmd(self.default(statement)) + try: + func = getattr(self, funcname) + except AttributeError: + return self.postparsing_postcmd(self.default(statement)) timestart = datetime.datetime.now() - stop = getattr(self, funcname)(statement) + stop = func(statement) if self.timing: print 'Elapsed: %s' % str(datetime.datetime.now() - timestart) except Exception, e: