diff --git a/apps/riic_report_analysis.py b/apps/riic_report_analysis.py index a9ffcf0..980465c 100644 --- a/apps/riic_report_analysis.py +++ b/apps/riic_report_analysis.py @@ -24,9 +24,11 @@ class RIICReportAnalysis: None, functools.partial(rapid_ocr, img_path) ) if not "副手简报" in [i[1] for i in result]: + os.remove(img_path) return + lmb_height = 0 - lmb_numers = [] + lmb_list = [] date_list = [] exp_list = [] gold_list = [] @@ -46,9 +48,9 @@ class RIICReportAnalysis: continue if lmb_height - 20 < i[0][0][1] < lmb_height + 20: if m := re.search(r"([0-9]+)", i[1]): - lmb_numers.append([int(i[0][0][0]), m.group(1)]) + lmb_list.append([int(i[0][0][0]), m.group(1)]) - lmb_numers.sort(key=lambda x: x[0]) + lmb_list.sort(key=lambda x: x[0]) gold_list.sort(key=lambda x: x[0]) exp_list.sort(key=lambda x: x[0]) date_list.sort(key=lambda x: x[0]) @@ -57,10 +59,10 @@ class RIICReportAnalysis: for i in range(len(date_list)): output += f"【{date_list[i][1]}】\n" - output += f"💵 {lmb_numers[2 * i][1]}订单({lmb_numers[2 * i + 1][1]})\n" + output += f"💵 {lmb_list[2 * i][1]}订单({lmb_list[2 * i + 1][1]})\n" output += f"🧈 {gold_list[i][1]}赤金\n" output += f"📼 {exp_list[i][1]}经验\n\n" await chain.onebot_reply(Text(output.strip())) - await loop.run_in_executor(None, functools.partial(os.remove, img_path)) + os.remove(img_path)