diff --git a/main.py b/main.pyw similarity index 98% rename from main.py rename to main.pyw index 3070dc5..045a257 100644 --- a/main.py +++ b/main.pyw @@ -191,10 +191,9 @@ def main(driver: WebDriver): tell('正在登陆') click("#io-ox-topbar-account-dropdown-icon button.dropdown-toggle") address = locate("#topbar-account-dropdown .mail").get_attribute('innerText') - parts = HumanName(address.split('@', 2)[0]) - parts.capitalize(force=True) - outbox.put(Command('setAddress', parts.full_name, address)) - tell(f'成功登录 {parts.full_name} ({address})') + person = HumanName(address.split('@', 2)[0]) + person.capitalize(force=True) + tell(f'成功登录 {person.full_name} ({address})') break except: continue @@ -255,6 +254,7 @@ def main(driver: WebDriver): while True: try: + outbox.put(Command('setAddress', person.full_name, address)) driver.switch_to.window(driver.window_handles[0]) filename = str(inbox.get()) buffer = BytesIO(inbox.get()) diff --git a/scripts/example.bat b/scripts/example.bat index a6c3185..7883afd 100644 --- a/scripts/example.bat +++ b/scripts/example.bat @@ -1 +1 @@ -.\..\venv\Scripts\pythonw.exe .\..\main.py --address "user@example.com" --password "example" --max-occurrence 5 --interval 10 \ No newline at end of file +.\..\venv\Scripts\pythonw.exe .\..\main.pyw --address "user@example.com" --password "example" --max-occurrence 5 --interval 10 \ No newline at end of file