minor fix

This commit is contained in:
2025-08-29 12:13:34 +08:00
parent ffb90ca8fb
commit bc55a35e44

20
main.py
View File

@@ -48,10 +48,6 @@ inbox, outbox = Queue(), Queue()
connection = None
socket = None
sent = 0
errors = 0
warnings = 0
class Greetings:
def __init__(self, locale: str, timezone: str, default: str, morning=None, afternoon=None, evening=None, predicate=None):
self.locale = locale
@@ -325,12 +321,11 @@ def main(driver: WebDriver):
index = 0
status = Status.ACTIVE
occurrences = {}
sent = 0
errors = 0
warnings = 0
while status.isactive() and index < limit:
global warnings
global errors
global sent
attempt = 0
current = index
index += 1
@@ -358,7 +353,7 @@ def main(driver: WebDriver):
clean = True
attempt += 1
request = get_request()
print('[信息] 正在发送:%s (%.2f %%)' % (recipient, current / limit * 100))
tell('[信息] 正在发送:%s (%.2f %%)' % (recipient, current / limit * 100))
if (target := get_address()) != address:
exception = Exception(f'邮件发件地址与设定不一致\n>> {address}\n>> {target}')
@@ -490,7 +485,8 @@ def main(driver: WebDriver):
status = Status.INACTIVE
progress = index / limit * 100
print('[信息] 当前进度:%.2f %%' % progress)
tell('[信息] 当前进度:%.2f %%' % progress)
tell(f'已发送 {sent} 封;发送失败 {errors} 封;跳过重复项 {warnings}')
if parameters.get('save'):
try:
@@ -565,6 +561,4 @@ if __name__ == '__main__':
status = 1
finally:
driver.quit()
tell(f'已发送 {sent} 封;发送失败 {errors} 封;跳过重复项 {warnings}')
exit(status)
exit(status)