fix empty commands

This commit is contained in:
Romain Bignon 2010-10-15 18:29:32 +02:00
commit 86f2ede418

View file

@ -302,17 +302,20 @@ class ReplApplication(Cmd, BaseApplication):
stop = None stop = None
return stop return stop
def onecmd(self, _cmd): def onecmd(self, line):
""" """
This REPL method is overrided to catch some particular exceptions. This REPL method is overrided to catch some particular exceptions.
""" """
cmd_name = _cmd.split()[0] cmd, arg, ignored = self.parseline(line)
if cmd_name in self.commands_formatters:
self.set_formatter(self.commands_formatters[cmd_name]) # Set the right formatter for the command.
if cmd in self.commands_formatters:
self.set_formatter(self.commands_formatters[cmd])
else: else:
self.set_formatter(self.DEFAULT_FORMATTER) self.set_formatter(self.DEFAULT_FORMATTER)
try: try:
return super(ReplApplication, self).onecmd(_cmd) return super(ReplApplication, self).onecmd(line)
except CallErrors, e: except CallErrors, e:
ask_debug_mode = False ask_debug_mode = False
for backend, error, backtrace in e.errors: for backend, error, backtrace in e.errors: