fix empty commands
This commit is contained in:
parent
a9f6ec93aa
commit
86f2ede418
1 changed files with 8 additions and 5 deletions
|
|
@ -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:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue