def onecmd(self, line):
""" This executes the actual do_* method for a command.
If the command provided doesn't exist, then it executes _default() instead.
:param line: ParsedString - subclass of string including the pyparsing ParseResults
:return: bool - a flag indicating whether the interpretation of commands should stop
"""
statement = self.parser_manager.parsed(line)
funcname = self._func_named(statement.parsed.command)
if not funcname:
return self.default(statement)
try:
func = getattr(self, funcname)
except AttributeError:
return self.default(statement)
stop = func(statement)
return stop
评论列表
文章目录