minor fix
This commit is contained in:
20
main.py
20
main.py
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user