1
This commit is contained in:
parent
c34f8f5043
commit
87bd27537a
@ -26,8 +26,4 @@ initTab(tab)
|
|||||||
tab.call_method("Page.navigate", url="http://localhost:7456/", _timeout=5)
|
tab.call_method("Page.navigate", url="http://localhost:7456/", _timeout=5)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
cmdline= input('').strip()
|
cmd.processCmd(browser, tab, scriptmgr)
|
||||||
try:
|
|
||||||
msg = eval(cmdline)
|
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
def _b_cmd(browser, tab, scriptmgr, params):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _p_cmd(browser, tab, scriptmgr, params):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _processCdbCmd(cmd_str, browser, tab, scriptmgr):
|
||||||
|
cmdlist = cmd_str.split(' ')
|
||||||
|
if len(cmdlist) < 1:
|
||||||
|
return
|
||||||
|
cmd_hash = {
|
||||||
|
'b': _b_cmd,
|
||||||
|
'p': None,
|
||||||
|
}
|
||||||
|
if cmdlist[0] in cmd_hash:
|
||||||
|
cmd_hash[cmdlist[0]](browser, tab, scriptmgr, cmdlist[1:])
|
||||||
|
else:
|
||||||
|
print('not found %s cmd' % cmdlist[0])
|
||||||
|
|
||||||
|
def processCmd(browser, tab, scriptmgr):
|
||||||
|
cmdline= input('').strip()
|
||||||
|
try:
|
||||||
|
if len(cmdline) > 0 :
|
||||||
|
if cmdline[0] == '!':
|
||||||
|
msg = eval(cmdline[1:])
|
||||||
|
else:
|
||||||
|
_processCdbCmd(cmdline[1:], browser, tab, scriptmgr)
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user