MCPcopy Create free account
hub / github.com/CoderLuii/HolyClaude / main

Function main

scripts/notify.py:156–191  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

154
155
156def main():
157 args = parse_args(sys.argv[1:])
158
159 # Check if notifications are enabled
160 if args.dry_run:
161 sys.exit(run_dry_run(FLAG_FILE, os.environ, args.debug))
162
163 if not os.path.isfile(FLAG_FILE):
164 sys.exit(0)
165
166 # Collect all NOTIFY_* env vars
167 urls = collect_notify_urls(os.environ)
168 if not urls:
169 sys.exit(0)
170
171 # Event mapping
172 event = sanitize(args.event, 80)
173 events = {
174 "stop": ("HolyClaude — Task Complete", "Claude has finished the current task.", "info"),
175 "error": ("HolyClaude — Something Went Wrong", "A tool use failure occurred. Check the session for details.", "warning"),
176 "test": ("HolyClaude — Test Notification", "HolyClaude notification test.", "info"),
177 }
178 provider_details = provider_event(args)
179 title, body, notify_type = provider_details or events.get(event, (
180 "HolyClaude — Notification",
181 f"Event: {event}",
182 "info",
183 ))
184
185 # Send via Apprise — all failures silently ignored
186 try:
187 send_notifications(urls, title, body, notify_type)
188 except Exception:
189 pass
190
191 sys.exit(0)
192
193if __name__ == "__main__":
194 main()

Callers 1

notify.pyFile · 0.85

Calls 6

parse_argsFunction · 0.85
run_dry_runFunction · 0.85
collect_notify_urlsFunction · 0.85
sanitizeFunction · 0.85
provider_eventFunction · 0.85
send_notificationsFunction · 0.85

Tested by

no test coverage detected