main.py 文件源码

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

项目:rshell 作者: dhylands 项目源码 文件源码
def onecmd_exec(self, line):
        try:
            if self.timing:
                start_time = time.time()
                result = cmd.Cmd.onecmd(self, line)
                end_time = time.time()
                print('took %.3f seconds' % (end_time - start_time))
                return result
            else:
                return cmd.Cmd.onecmd(self, line)
        except DeviceError as err:
            print_err(err)
        except ShellError as err:
            print_err(err)
        except SystemExit:
            # When you use -h with argparse it winds up call sys.exit, which
            # raises a SystemExit. We intercept it because we don't want to
            # exit the shell, just the command.
            return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号