From b82fa876de22f6c97a51e8a27a8a6192596cb0c4 Mon Sep 17 00:00:00 2001 From: break27 Date: Fri, 29 Aug 2025 09:28:38 +0800 Subject: [PATCH] update: try also recovery from address mismatched errors --- main.py | 7 +++++-- {scripts => profiles}/profile-example.pyw | 0 {scripts => profiles}/setup-virtualenv.pyw | 0 3 files changed, 5 insertions(+), 2 deletions(-) rename {scripts => profiles}/profile-example.pyw (100%) rename {scripts => profiles}/setup-virtualenv.pyw (100%) diff --git a/main.py b/main.py index 1bf34bf..e3c9b70 100644 --- a/main.py +++ b/main.py @@ -361,12 +361,15 @@ def main(driver: WebDriver): print('[信息] 正在发送:%s (%.2f %%)' % (recipient, current / limit * 100)) if (target := get_address()) != address: - raise Exception(f'邮件发件地址与设定不一致\n>> {address}\n>> {target}') - + exception = Exception(f'邮件发件地址与设定不一致\n>> {address}\n>> {target}') + if not parameters.get('recovery'): raise exception + tell(None, exception, level=1) + if (target := get_subject()) != subject: exception = Exception(f'邮件主题与设定不一致\n>> {subject}\n>> {target}') condition = EC.presence_of_element_located if not parameters.get('recovery'): raise exception + tell(None, exception, level=1) # 打开存档 click("li[data-id='default0/Archives'] li.folder:nth-child(1)", condition) ready(driver) diff --git a/scripts/profile-example.pyw b/profiles/profile-example.pyw similarity index 100% rename from scripts/profile-example.pyw rename to profiles/profile-example.pyw diff --git a/scripts/setup-virtualenv.pyw b/profiles/setup-virtualenv.pyw similarity index 100% rename from scripts/setup-virtualenv.pyw rename to profiles/setup-virtualenv.pyw