summaryrefslogtreecommitdiffstats
path: root/python/examples
diff options
context:
space:
mode:
Diffstat (limited to 'python/examples')
-rw-r--r--python/examples/example-client.py2
-rw-r--r--python/examples/example-service.py4
-rw-r--r--python/examples/list-system-services.py2
3 files changed, 4 insertions, 4 deletions
diff --git a/python/examples/example-client.py b/python/examples/example-client.py
index 0038b2db..c1393ecc 100644
--- a/python/examples/example-client.py
+++ b/python/examples/example-client.py
@@ -2,7 +2,7 @@
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")
diff --git a/python/examples/example-service.py b/python/examples/example-service.py
index 79fb009d..d1460802 100644
--- a/python/examples/example-service.py
+++ b/python/examples/example-service.py
@@ -11,8 +11,8 @@ class SomeObject(dbus.Object):
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()
diff --git a/python/examples/list-system-services.py b/python/examples/list-system-services.py
index 20b79d59..9769fc5a 100644
--- a/python/examples/list-system-services.py
+++ b/python/examples/list-system-services.py
@@ -3,7 +3,7 @@
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')