minor fix
This commit is contained in:
11
main.py
11
main.py
@@ -366,7 +366,7 @@ def main(driver: WebDriver):
|
|||||||
clean = True
|
clean = True
|
||||||
attempt += 1
|
attempt += 1
|
||||||
request = get_request()
|
request = get_request()
|
||||||
tell('[信息] 正在发送:%s (%.2f %%)' % (recipient, current / limit * 100))
|
tell('正在发送:%s (%.2f %%)' % (recipient, current / limit * 100))
|
||||||
|
|
||||||
if (target := get_address()) != address:
|
if (target := get_address()) != address:
|
||||||
exception = Exception(f'邮件发件地址与设定不一致\n>> {address}\n>> {target}')
|
exception = Exception(f'邮件发件地址与设定不一致\n>> {address}\n>> {target}')
|
||||||
@@ -476,12 +476,11 @@ def main(driver: WebDriver):
|
|||||||
break
|
break
|
||||||
except Faillable as o:
|
except Faillable as o:
|
||||||
request = o.request
|
request = o.request
|
||||||
except (KeyboardInterrupt, ShutDown, InvalidSessionIdException) as e:
|
|
||||||
tell('程序中断', e, level=1)
|
|
||||||
status = Status.TERMINATED
|
|
||||||
break
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
tell(f'发生错误 ({attempt})', e, level=0)
|
tell(f'发生错误 ({attempt})', e, level=0)
|
||||||
|
if connection.closed or isinstance(e, KeyboardInterrupt):
|
||||||
|
status = Status.TERMINATED
|
||||||
|
break
|
||||||
outbox.put(Command('setStatus', 'FAILED'))
|
outbox.put(Command('setStatus', 'FAILED'))
|
||||||
request = inbox.get()
|
request = inbox.get()
|
||||||
|
|
||||||
@@ -496,7 +495,7 @@ def main(driver: WebDriver):
|
|||||||
status = Status.INACTIVE
|
status = Status.INACTIVE
|
||||||
|
|
||||||
progress = cursor / limit * 100
|
progress = cursor / limit * 100
|
||||||
tell('[信息] 当前进度:%.2f %%' % progress)
|
tell('当前进度:%.2f %%' % progress)
|
||||||
tell(f'已发送 {sent} 封;发送失败 {errors} 封;跳过重复项 {warnings} 个')
|
tell(f'已发送 {sent} 封;发送失败 {errors} 封;跳过重复项 {warnings} 个')
|
||||||
|
|
||||||
if parameters.get('save'):
|
if parameters.get('save'):
|
||||||
|
|||||||
Reference in New Issue
Block a user