From 76da7be959b18a0809adff7e4a7fafdf5927a1e6 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 12 Oct 2019 15:50:07 +0800 Subject: [PATCH] 1 --- scripts/cdb/cmd.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/scripts/cdb/cmd.py b/scripts/cdb/cmd.py index 83e2f37..1806ae7 100644 --- a/scripts/cdb/cmd.py +++ b/scripts/cdb/cmd.py @@ -18,6 +18,18 @@ def _bt_cmd(browser, tab, scriptmgr, params): def _p_cmd(browser, tab, scriptmgr, params): pass +def _debugon_cmd(browser, tab, scriptmgr, params): + tab.debug = True + print('debug on') + +def _debugoff_cmd(browser, tab, scriptmgr, params): + tab.debug = False + print('debug off') + +def _exit_cmd(browser, tab, scriptmgr, params): + print('quit') + exit(0) + def _processCdbCmd(cmd_str, browser, tab, scriptmgr): cmdlist = cmd_str.split(' ') if len(cmdlist) < 1: @@ -25,9 +37,12 @@ def _processCdbCmd(cmd_str, browser, tab, scriptmgr): cmd_hash = { 'b': _b_cmd, 'bt': _bt_cmd, - 'p': None, + 'p': _p_cmd, + 'debugon': _debugon_cmd, + 'debugoff': _debugoff_cmd, + 'exit': _exit_cmd, + 'q': _exit_cmd, } - print(cmdlist) if cmdlist[0] in cmd_hash: cmd_hash[cmdlist[0]](browser, tab, scriptmgr, cmdlist[1:]) else: