cherry pick

This commit is contained in:
2025-07-24 11:26:39 +08:00
parent 3a816f9733
commit 798b3fd646

View File

@@ -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