From 798b3fd6468d32aeb59fd0fd120b1b7581853397 Mon Sep 17 00:00:00 2001 From: break27 Date: Thu, 24 Jul 2025 11:26:39 +0800 Subject: [PATCH] cherry pick --- 邮件批量发送脚本.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/邮件批量发送脚本.py b/邮件批量发送脚本.py index c2ab5ae..9c47f54 100644 --- a/邮件批量发送脚本.py +++ b/邮件批量发送脚本.py @@ -290,17 +290,17 @@ def main(): ready(driver, lambda x: x.find_element(By.CSS_SELECTOR, ".io-ox-busy")) locate("div.io-ox-mail-compose-window iframe", condition=EC.frame_to_be_available_and_switch_to_it) - if command > 0 and (selection := greetings[command]): + if command > 0 and (entry := greetings[command]): match datetime.now(timezone).hour: - case hour if 6 <= hour < 12: registry = selection.get('registry')[0] - case hour if 12 <= hour < 18: registry = selection.get('registry')[1] - case hour if 18 <= hour < 21: registry = selection.get('registry')[2] + case hour if 6 <= hour < 12: registry = entry.get('registry')[0] + case hour if 12 <= hour < 18: registry = entry.get('registry')[1] + case hour if 18 <= hour < 21: registry = entry.get('registry')[2] case _: registry = None clean = False iframe = driver.switch_to.active_element action = ActionChains(driver) - hello: str = registry or selection.get('default') + hello: str = registry or entry.get('default') if name is not None and (name := str(name).strip()) and not contains_non_latin_alphabet(name): const = config.CONSTANTS