+2004-05-29 Seth Nickell <seth@gnome.org>
+
+ * python/dbus.py:
+ * python/examples/example-client.py:
+ * python/examples/example-service.py:
+ * python/examples/list-system-services.py:
+
+ Add SessionBus, SystemBus and ActivationBus classes
+ so you don't need to know the special little BUS_TYPE
+ flag.
+
2004-05-29 Havoc Pennington <hp@redhat.com>
* bus/config-parser.c (process_test_valid_subdir): temporarily
for receiver in receivers:
receiver(*args)
+class SystemBus(Bus):
+ """The system-wide message bus
+ """
+ def __init__(self):
+ Bus.__init__(self, Bus.TYPE_SYSTEM)
+
+class SessionBus(Bus):
+ """The session (current login) message bus
+ """
+ def __init__(self):
+ Bus.__init__(self, Bus.TYPE_SESSION)
+
+class ActivationBus(Bus):
+ """The bus that activated this process (if
+ this process was launched by DBus activation)
+ """
+ def __init__(self):
+ Bus.__init__(self, Bus.TYPE_ACTIVATION)
+
class RemoteObject:
"""A remote Object.
import dbus
-bus = dbus.Bus()
+bus = dbus.SessionBus()
remote_service = bus.get_service("org.designfu.SampleService")
remote_object = remote_service.get_object("/SomeObject",
"org.designfu.SampleInterface")
print (hello_message)
return "Hello from example-service.py"
-
-service = dbus.Service("org.designfu.SampleService")
+session_bus = dbus.SessionBus()
+service = dbus.Service("org.designfu.SampleService", bus=session_bus)
object = SomeObject(service)
gtk.main()
import dbus
# Get a connection to the SYSTEM bus
-bus = dbus.Bus(dbus.Bus.TYPE_SYSTEM)
+bus = dbus.SystemBus()
# Get the service provided by the dbus-daemon named org.freedesktop.DBus
dbus_service = bus.get_service('org.freedesktop.DBus')