mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2025-12-22 14:50:11 +01:00
* python/dbus.py: Add "message" argument to service-side dbus.Object methods. This will break existing services written using the python bindings, but will allow extraction of all the message information (e.g. who its from). Add improved "object oriented" signal handling/emission. * python/examples/example-service.py: Nix this example. * python/examples/example-signal-emitter.py: * python/examples/example-signal-recipient.py: Two new examples that show how to emit and receive signals using the new APIs. * python/examples/example-signals.py: * python/examples/gconf-proxy-service.py: * python/examples/gconf-proxy-service2.py: Add "message" argument to service methods.
18 lines
487 B
Python
18 lines
487 B
Python
import dbus
|
|
import gtk
|
|
|
|
class TestObject(dbus.Object):
|
|
def __init__(self, service):
|
|
dbus.Object.__init__(self, "/object", service, [self.HelloWorld])
|
|
|
|
def emitHelloSignal(self, message):
|
|
# Emit the signal
|
|
self.emit_signal(interface="org.designfu.TestService",
|
|
signal_name="hello")
|
|
|
|
session_bus = dbus.SessionBus()
|
|
service = dbus.Service("org.designfu.TestService", bus=session_bus)
|
|
object = TestObject(service)
|
|
|
|
gtk.main()
|
|
A
|