diff options
author | Seth Nickell <seth@gnome.org> | 2003-09-25 08:46:39 +0000 |
---|---|---|
committer | Seth Nickell <seth@gnome.org> | 2003-09-25 08:46:39 +0000 |
commit | dcc037cc1f008eae9f6a35aca5b1935459e44647 (patch) | |
tree | ab2087886c9a851fa3b77c9652303823bd0a6f07 /python/examples | |
parent | 6f5fc71b10ab910612b7af767308f52bb8266b1e (diff) |
2003-09-25 Seth Nickell <seth@gnome.org>
* 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.
Diffstat (limited to 'python/examples')
-rw-r--r-- | python/examples/example-client.py | 7 | ||||
-rw-r--r-- | python/examples/example-service.py | 7 |
2 files changed, 9 insertions, 5 deletions
diff --git a/python/examples/example-client.py b/python/examples/example-client.py index 24906b83..0038b2db 100644 --- a/python/examples/example-client.py +++ b/python/examples/example-client.py @@ -4,6 +4,9 @@ import dbus bus = dbus.Bus() remote_service = bus.get_service("org.designfu.SampleService") -remote_object = remote_service.get_object("/MyObject", "org.designfu.SampleInterface") +remote_object = remote_service.get_object("/SomeObject", + "org.designfu.SampleInterface") -remote_object.HelloWorld("Hello from example-client.py!") +hello_reply = remote_object.HelloWorld("Hello from example-client.py!") + +print (hello_reply) diff --git a/python/examples/example-service.py b/python/examples/example-service.py index eb55af44..88f6b500 100644 --- a/python/examples/example-service.py +++ b/python/examples/example-service.py @@ -6,10 +6,11 @@ import gtk class MyObject(dbus.Object): def __init__(self): service = dbus.Service("org.designfu.SampleService") - dbus.Object("/MyObject", [self.HelloWorld], service) + dbus.Object("/SomeObject", [self.HelloWorld], service) - def HelloWorld(self, arg1): - print ("Hello World!: %s" % (arg1)) + def HelloWorld(self, hello_message): + print (hello_message) + return "Hello from example-service.py" object = MyObject() |