MCPcopy
hub / github.com/MonsterNone/tmall-miao / find_timeout_re

Function find_timeout_re

modules/utils.py:67–77  ·  view source on GitHub ↗
(d, reg, timeout)

Source from the content-addressed store, hash-verified

65
66# 通过正则寻找,找到返回[result],找不到返回[]
67def find_timeout_re(d, reg, timeout):
68 for i in range(timeout):
69 t = d.dump_hierarchy()
70 t = json.dumps(t, ensure_ascii=False)
71 r = re.findall(reg, t)
72 if not r and i != timeout:
73 logger.debug('搜索 {} 次'.format(i + 1))
74 time.sleep(0.8)
75 continue
76 return r
77 return []
78
79
80# 获取淘宝包名

Callers 15

close_popupFunction · 0.90
get_redFunction · 0.90
return_task_listFunction · 0.90
do_item_5_taskFunction · 0.90
runFunction · 0.90
open_task_listFunction · 0.90
return_task_listFunction · 0.90
close_popupFunction · 0.90
do_time_task_energyFunction · 0.90
do_10_item_taskFunction · 0.90
runFunction · 0.90
get_redFunction · 0.90

Calls 2

dump_hierarchyMethod · 0.80
formatMethod · 0.80

Tested by

no test coverage detected