summaryrefslogtreecommitdiff
path: root/python/examples/example-service.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/examples/example-service.py')
-rw-r--r--python/examples/example-service.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/python/examples/example-service.py b/python/examples/example-service.py
index 88f6b500..79fb009d 100644
--- a/python/examples/example-service.py
+++ b/python/examples/example-service.py
@@ -3,15 +3,16 @@ import dbus
import pygtk
import gtk
-class MyObject(dbus.Object):
- def __init__(self):
- service = dbus.Service("org.designfu.SampleService")
- dbus.Object("/SomeObject", [self.HelloWorld], service)
+class SomeObject(dbus.Object):
+ def __init__(self, service):
+ dbus.Object.__init__(self, "/SomeObject", [self.HelloWorld], service)
def HelloWorld(self, hello_message):
print (hello_message)
return "Hello from example-service.py"
-object = MyObject()
+
+service = dbus.Service("org.designfu.SampleService")
+object = SomeObject(service)
gtk.main()