+ if spec.output[u"output"] == u"report":
+ generate_report(args.release, spec, args.week)
+ elif spec.output[u"output"] == u"CPTA":
+ sys.stdout.write(generate_cpta(spec, data))
+ try:
+ alert = Alerting(spec)
+ alert.generate_alerts()
+ except AlertingError as err:
+ logging.warning(repr(err))
+
+ logging.info(u"Successfully finished.")
+ ret_code = 0
+
+ except AlertingError as err:
+ logging.critical(f"Finished with an alerting error.\n{repr(err)}")
+ except PresentationError as err:
+ logging.critical(f"Finished with an PAL error.\n{repr(err)}")
+ except (KeyError, ValueError) as err:
+ logging.critical(f"Finished with an error.\n{repr(err)}")