From c94f9f0605102791f70b2e826915bfd90c80ab64 Mon Sep 17 00:00:00 2001 From: Zhao Zuohong Date: Mon, 14 Aug 2023 09:44:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=9A=84=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E5=89=AF=E6=89=8B=E7=AE=80=E6=8A=A5=E6=97=B6=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/riic_report_analysis.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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)