--- /dev/null
+#!/usr/bin/env python
+
+import dbus
+
+bus = dbus.Bus()
+remote_service = bus.get_service("org.designfu.SampleService")
+remote_object = remote_service.get_object("/SomeObject",
+ "org.designfu.SampleInterface")
+
+hello_reply = remote_object.HelloWorld("Hello from example-client.py!")
+
+print (hello_reply)
--- /dev/null
+import dbus
+
+import pygtk
+import gtk
+
+class SomeObject(dbus.Object):
+ def __init__(self, service):
+ dbus.Object.__init__(self, "/SomeObject", [self.HelloWorld], service)
+
+ def HelloWorld(self, hello_message):
+ print (hello_message)
+ return "Hello from example-service.py"
+
+
+service = dbus.Service("org.designfu.SampleService")
+object = SomeObject(service)
+
+gtk.main()
--- /dev/null
+import pygtk
+import gtk
+
+import dbus
+
+class SignalFrom(dbus.Object):
+ def __init__(self, service):
+ dbus.Object.__init__(self, "/", [], service)
+
+def signal_to(interface, signal_name, service, path):
+ print ("Received signal '%s.%s' from '%s%s'" % (interface, signal_name, service, path))
+
+bus = dbus.Bus()
+bus.add_signal_receiver(signal_to,
+ "org.designfu.SignalInterface",
+ "org.designfu.SignalService",
+ "/")
+
+
+service = dbus.Service("org.designfu.SignalService", bus)
+signal_from = SignalFrom(service)
+
+signal_from.broadcast_signal("org.designfu.SignalInterface", "HelloWorld")
+
+gtk.main()
+
+