(self)
| 254 | logger.warning(self.keyword, e) |
| 255 | |
| 256 | def push_email(self): |
| 257 | try: |
| 258 | if Config.EMAIL_HOST and Config.EMAIL_USERNAME and Config.EMAIL_PASSWORD: |
| 259 | html_report = self.build_html_report() |
| 260 | push.send_email(host=Config.EMAIL_HOST, port=Config.EMAIL_PORT, mail=Config.EMAIL_USERNAME, |
| 261 | password=Config.EMAIL_PASSWORD, to=Config.EMAIL_TO, |
| 262 | title="[Github--{}] 灯塔消息推送".format(self.keyword), html=html_report) |
| 263 | logger.info("send email succ") |
| 264 | return True |
| 265 | except Exception as e: |
| 266 | logger.warning(self.keyword, e) |
| 267 | |
| 268 | def run(self): |
| 269 | self.set_start_time() |
no test coverage detected