mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2025-12-30 20:00:11 +01:00
* python/dbus.py: * python/dbus_bindings.pyx.in: Handle return values. * python/examples/example-client.py: * python/examples/example-service.py: Pass back return values from the service to the client.
17 lines
367 B
Python
17 lines
367 B
Python
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)
|
|
|
|
def HelloWorld(self, hello_message):
|
|
print (hello_message)
|
|
return "Hello from example-service.py"
|
|
|
|
object = MyObject()
|
|
|
|
gtk.main()
|