Mercurial > python-cmd2
changeset 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 | b1b37ea258af |
files | cmd2.py |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
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: