cmd2.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:cmd2 作者: python-cmd2 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号