diff --git a/Report.py b/Report.py index f0a41fa..981d7ee 100644 --- a/Report.py +++ b/Report.py @@ -3,6 +3,7 @@ """ Report """ +import atexit import logging @@ -56,3 +57,7 @@ class Report(object): # pylint: disable=useless-object-inheritance text_body=content ) 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)