mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2025-12-22 16:00:10 +01:00
* python/dbus.py: Add a nicer-but-less-flexible alternate API for handling calls to virtual objects in dbus.ObjectTree. Screw up the argument order to the dbus.Object constructor for consistency with dbus.ObjectTree (and to make dbus_methods optional for future extension) * python/examples/Makefile.am: * python/examples/gconf-proxy-service.py: * python/examples/gconf-proxy-service2.py: Alternate implementation of gconf-proxy-service using the nicer dbus.ObjectTree API. * python/examples/example-service.py: * python/tests/test-server.py Reverse the argument order to deal with dbus.Object constructor changes.
18 lines
448 B
Python
18 lines
448 B
Python
import dbus
|
|
|
|
import pygtk
|
|
import gtk
|
|
|
|
class SomeObject(dbus.Object):
|
|
def __init__(self, service):
|
|
dbus.Object.__init__(self, "/SomeObject", service, [self.HelloWorld])
|
|
|
|
def HelloWorld(self, hello_message):
|
|
print (hello_message)
|
|
return ["Hello", "from example-service.py"]
|
|
|
|
session_bus = dbus.SessionBus()
|
|
service = dbus.Service("org.designfu.SampleService", bus=session_bus)
|
|
object = SomeObject(service)
|
|
|
|
gtk.main()
|