##Example.py## import dbus import dbus.service DBUS_NAME = 'org.foo.bar' DBUS_OBJECT = '/org/foo/bar' DBUS_INTERFACE = 'org.foo.bar' class Example(dbus.service.Object): def __init__(self,bus_name): dbus.service.Object.__init__(self,bus_name,DBUS_OBJECT) #@dbus.service.signal(DBUS_INTERFACE, signature='s') @dbus.service.signal(DBUS_INTERFACE) def SampleNotify(self, name): print "here SampleNotify!" return "SampleNotifyReturn" ## server.py ## #!/usr/bin/python import gobject import dbus import dbus.service from Example import * DBUS_NAME = 'org.foo.bar' DBUS_OBJECT = '/org/foo/bar' DBUS_INTERFACE = 'org.foo.bar' name = dbus.service.BusName(DBUS_NAME,bus=dbus.SessionBus()) obj = Example(name) loop = gobject.MainLoop() print "listening..." loop.run() ## client.py ## #!/usr/bin/python import dbus DBUS_NAME = 'org.foo.bar' DBUS_OBJECT = '/org/foo/bar' DBUS_INTERFACE = 'org.foo.bar' bus = dbus.SessionBus() notify_obj = bus.get_object(DBUS_NAME,DBUS_OBJECT) sender = dbus.Interface(notify_obj,DBUS_INTERFACE) print sender.SampleNotify("sent from client") ## output of client.py ## Introspect error: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. ## dbus-monitor output ## signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged string ":1.44" string "" string ":1.44" method call sender=:1.44 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged string "org.foo.bar" string "" string ":1.44" method call sender=:1.44 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RequestName string "org.foo.bar" uint32 0 signal sender=org.freedesktop.DBus -> dest=(null destination) path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged string ":1.45" string "" string ":1.45" method call sender=:1.45 -> dest=org.freedesktop.DBus path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello method call sender=:1.45 -> dest=org.foo.bar path=/org/foo/bar; interface=org.freedesktop.DBus.Introspectable; member=Introspect method call sender=:1.45 -> dest=org.foo.bar path=/org/foo/bar; interface=org.foo.bar; member=SampleNotify string "sent from client"