diff --git a/start-notification-service.py b/start-notification-service.py index c4a1e4c16..5c715149f 100644 --- a/start-notification-service.py +++ b/start-notification-service.py @@ -1,37 +1,68 @@ #!/usr/bin/env python3 +import sys +from gi.repository import GLib, Gio from pydbus import SessionBus -from gi.repository import GLib -# XML de l’interface Notifications (simplifié pour tests) -NOTIF_IFACE_XML = """ +# Interface XML (simplifiée pour Notifications) +NOTIF_IFACE_XML = """ + + + + + + + + + + + + + + + + + + + + + + + + + + + """ class NotificationService: - """ - - - - - - - - - """ - def Notify(self, app_name): - print(f"[INFO] Notification received from {app_name}") - return 1 # ID fictif + def Notify(self, *args, **kwargs): + print("[INFO] Notify called with:", args) + return 1 # fake notification id -if __name__ == "__main__": - print("[INFO] Starting Notification service…") - bus = SessionBus() - bus.publish("org.freedesktop.Notifications", NotificationService()) - print("[INFO] Service registered on DBus, waiting for calls.") - GLib.MainLoop().run() + def CloseNotification(self, id): + print(f"[INFO] CloseNotification {id}") + + def GetServerInformation(self): + return ("FakeServer", "FakeVendor", "1.0", "1.2") + + def GetCapabilities(self): + return ["body", "actions"] + +print("[INFO] Starting fake org.freedesktop.Notifications service...") + +bus = SessionBus() +node_info = Gio.DBusNodeInfo.new_for_xml(NOTIF_IFACE_XML) +bus.register_object("/org/freedesktop/Notifications", + NotificationService(), + node_info.interfaces[0]) + +print("[INFO] Service registered. Waiting for calls...") +GLib.MainLoop().run()