fix: Clean up code by removing unnecessary blank lines
- Removed excessive blank lines from various markdown and Python files to enhance readability and maintainability. - Ensured consistent formatting across documentation and code files, improving overall project clarity.
This commit is contained in:
1 parent
c30b73bbd3
commit
29f7b19916
35 files changed
+7809
-278
No files matched your search
+24
-2
@@ -47,6 +47,7 @@ def find_and_open_fudai_detail(
|
||||
room_pos_ref: List[int],
|
||||
) -> bool:
|
||||
"""在当前直播间查找福袋图标并尝试点击打开详情(基础版,不做预约)。"""
|
||||
func_start_time = time.time()
|
||||
# 如果正在等待开奖,不应该再次打开福袋详情
|
||||
try:
|
||||
if getattr(analyser, "_waiting_for_lottery_result", False):
|
||||
@@ -57,6 +58,8 @@ def find_and_open_fudai_detail(
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
elapsed = time.time() - func_start_time
|
||||
analyser._log_kv("流程", "find_and_open_fudai_detail完成(等待开奖中)", elapsed_seconds=round(elapsed, 2))
|
||||
return False
|
||||
except Exception:
|
||||
pass
|
||||
@@ -116,15 +119,18 @@ def find_and_open_fudai_detail(
|
||||
|
||||
if not x:
|
||||
try:
|
||||
total_elapsed = time.time() - start_time
|
||||
analyser._log_kv(
|
||||
"流程",
|
||||
"find_and_open_fudai_detail:等待超时,未检测到福袋图标",
|
||||
x=int(x or 0),
|
||||
max_wait_seconds=max_wait_seconds,
|
||||
total_elapsed_seconds=round(time.time() - start_time, 2),
|
||||
total_elapsed_seconds=round(total_elapsed, 2),
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
elapsed = time.time() - func_start_time
|
||||
analyser._log_kv("流程", "find_and_open_fudai_detail完成(未找到福袋)", elapsed_seconds=round(elapsed, 2))
|
||||
return False
|
||||
|
||||
# 点击坐标:用检测到的 X,加一个固定基准 Y(图标所在高度)
|
||||
@@ -207,6 +213,8 @@ def find_and_open_fudai_detail(
|
||||
analyser._last_fudai_detail_tuple = None
|
||||
except Exception:
|
||||
pass
|
||||
elapsed = time.time() - func_start_time
|
||||
analyser._log_kv("流程", "find_and_open_fudai_detail完成(成功打开详情)", elapsed_seconds=round(elapsed, 2))
|
||||
return True
|
||||
else:
|
||||
# 如果不在福袋详情页,可能是误点击,通过点击固定坐标返回直播间
|
||||
@@ -249,6 +257,8 @@ def find_and_open_fudai_detail(
|
||||
analyser.last_fudai_x = 0
|
||||
except Exception:
|
||||
pass
|
||||
elapsed = time.time() - func_start_time
|
||||
analyser._log_kv("流程", "find_and_open_fudai_detail完成(误点击)", elapsed_seconds=round(elapsed, 2))
|
||||
return False
|
||||
except Exception as e:
|
||||
# 阶段检测失败,返回False
|
||||
@@ -260,6 +270,8 @@ def find_and_open_fudai_detail(
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
elapsed = time.time() - func_start_time
|
||||
analyser._log_kv("流程", "find_and_open_fudai_detail完成(阶段检测异常)", elapsed_seconds=round(elapsed, 2))
|
||||
return False
|
||||
except Exception:
|
||||
try:
|
||||
@@ -269,8 +281,12 @@ def find_and_open_fudai_detail(
|
||||
getattr(analyser, "fudai_click_wait_seconds", 2.0) or 2.0
|
||||
)
|
||||
analyser.operation.delay(fudai_click_wait_seconds)
|
||||
elapsed = time.time() - func_start_time
|
||||
analyser._log_kv("流程", "find_and_open_fudai_detail完成(兜底成功)", elapsed_seconds=round(elapsed, 2))
|
||||
return True
|
||||
except Exception:
|
||||
elapsed = time.time() - func_start_time
|
||||
analyser._log_kv("流程", "find_and_open_fudai_detail完成(兜底失败)", elapsed_seconds=round(elapsed, 2))
|
||||
return False
|
||||
|
||||
|
||||
@@ -396,6 +412,7 @@ def filter_fudai_detail(
|
||||
add_reservation_callback,
|
||||
) -> bool:
|
||||
"""福袋详情过滤逻辑:根据 config.json 对福袋进行基础筛选。"""
|
||||
start_time = time.time()
|
||||
skip, reason = should_skip_fudai_by_config(analyser, detail)
|
||||
try:
|
||||
content = (
|
||||
@@ -416,6 +433,8 @@ def filter_fudai_detail(
|
||||
pass
|
||||
|
||||
if not skip:
|
||||
elapsed = time.time() - start_time
|
||||
analyser._log_kv("流程", "filter_fudai_detail完成(筛选通过)", elapsed_seconds=round(elapsed, 2))
|
||||
return False
|
||||
|
||||
try:
|
||||
@@ -435,6 +454,9 @@ def filter_fudai_detail(
|
||||
time.sleep(post_switch_delay_s or 1.2)
|
||||
except Exception:
|
||||
pass
|
||||
return True
|
||||
|
||||
elapsed = time.time() - start_time
|
||||
analyser._log_kv("流程", "filter_fudai_detail完成(筛选不通过)", elapsed_seconds=round(elapsed, 2), reason=reason)
|
||||
return True
|
||||
|
||||
return False
|
||||
Reference in new issue
Block a user