PPysolate SpineREAD THE CODE · UNDERSTAND THE SYSTEM
课程与章节
源码索引 / CURRENT IMPLEMENTATION

examples/notification.py

14 行 · 点击行号可定位;函数链接随声明位置更新,不手填行号。

report = get_report()
message = f"{report['title']}: {report['items']} items"
notice = send_notification(message=message)

if notice["status"] == "sent":
    print("Notification sent.")
elif notice["status"] == "denied":
    print("Notification not sent: Host denied it.")
elif notice["status"] == "unknown":
    print("Notification outcome unknown; not retrying.")
else:
    raise ValueError(f"unexpected notification status: {notice['status']}")

result = {"report": report, "notification_status": notice["status"]}