diff options
Diffstat (limited to 'python/examples/example-service.py')
-rw-r--r-- | python/examples/example-service.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/python/examples/example-service.py b/python/examples/example-service.py new file mode 100644 index 00000000..79fb009d --- /dev/null +++ b/python/examples/example-service.py @@ -0,0 +1,18 @@ +import dbus + +import pygtk +import gtk + +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" + + +service = dbus.Service("org.designfu.SampleService") +object = SomeObject(service) + +gtk.main() |