summaryrefslogtreecommitdiffstats
path: root/python/examples
diff options
context:
space:
mode:
Diffstat (limited to 'python/examples')
-rw-r--r--python/examples/example-service.py4
-rw-r--r--python/examples/example-signal-emitter.py3
-rw-r--r--python/examples/list-system-services.py7
3 files changed, 5 insertions, 9 deletions
diff --git a/python/examples/example-service.py b/python/examples/example-service.py
index 4f753cd8..1ea7fd86 100644
--- a/python/examples/example-service.py
+++ b/python/examples/example-service.py
@@ -8,8 +8,8 @@ class SomeObject(dbus.Object):
dbus.Object.__init__(self, "/SomeObject", service, [self.HelloWorld])
def HelloWorld(self, message, hello_message):
- print (hello_message)
- return ["Hello", "from example-service.py"]
+ print (str(hello_message))
+ return ["Hello", " from example-service.py"]
session_bus = dbus.SessionBus()
service = dbus.Service("org.designfu.SampleService", bus=session_bus)
diff --git a/python/examples/example-signal-emitter.py b/python/examples/example-signal-emitter.py
index edabfd70..bcd5ad6f 100644
--- a/python/examples/example-signal-emitter.py
+++ b/python/examples/example-signal-emitter.py
@@ -3,7 +3,7 @@ import gtk
class TestObject(dbus.Object):
def __init__(self, service):
- dbus.Object.__init__(self, "/object", service, [self.HelloWorld])
+ dbus.Object.__init__(self, "/org/designfu/TestService/object", service, [self.emitHelloSignal])
def emitHelloSignal(self, message):
# Emit the signal
@@ -15,4 +15,3 @@ service = dbus.Service("org.designfu.TestService", bus=session_bus)
object = TestObject(service)
gtk.main()
-A
diff --git a/python/examples/list-system-services.py b/python/examples/list-system-services.py
index 9769fc5a..9b114da9 100644
--- a/python/examples/list-system-services.py
+++ b/python/examples/list-system-services.py
@@ -17,8 +17,5 @@ dbus_object = dbus_service.get_object('/org/freedesktop/DBus',
# One of the member functions in the org.freedesktop.DBus interface
# is ListServices(), which provides a list of all the other services
# registered on this bus. Call it, and print the list.
-system_service_list = dbus_object.ListServices()
-
-for service in system_service_list:
- if service[0] != ':':
- print (service)
+system_service_list = dbus_object.ListNames()
+print str(system_service_list)