Report: add send_at_exit method
This commit is contained in:
parent
4d91675d7a
commit
2c442a2433
1 changed files with 5 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
""" Report """
|
""" Report """
|
||||||
|
|
||||||
|
import atexit
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,3 +57,7 @@ class Report(object): # pylint: disable=useless-object-inheritance
|
||||||
text_body=content
|
text_body=content
|
||||||
)
|
)
|
||||||
return email_client.send(self.rcpt_to or rcpt_to, msg=msg, just_try=just_try)
|
return email_client.send(self.rcpt_to or rcpt_to, msg=msg, just_try=just_try)
|
||||||
|
|
||||||
|
def send_at_exit(self, **kwargs):
|
||||||
|
""" Send report at exit """
|
||||||
|
atexit.register(self.send, **kwargs)
|
||||||
|
|
Loading…
Reference in a new issue