diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-06-11 14:51:59 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-06-11 14:51:59 +0100 |
commit | 7f2e0bfe0c205af512af716f4fcb7b8508269eb7 (patch) | |
tree | 712e21270ec3e14005615367a84e125f71a850f0 /test/test-service.py | |
parent | cc6ea2758794601e2747ad9deccf7c8e887b0100 (diff) |
dbus.service: Allow objects to start off unexported, and become exported later.
Also allow them to be exported on more than one object path or even connection.
dbus.decorators: Allow connection_keyword on signals and methods, so we can
tell which connection to use for any follow-up actions.
Diffstat (limited to 'test/test-service.py')
-rwxr-xr-x | test/test-service.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/test/test-service.py b/test/test-service.py index fe24010..4372392 100755 --- a/test/test-service.py +++ b/test/test-service.py @@ -50,9 +50,6 @@ OBJECT = "/org/freedesktop/DBus/TestSuitePythonObject" class RemovableObject(dbus.service.Object): # Part of test for https://bugs.freedesktop.org/show_bug.cgi?id=10457 - def __init__(self, bus_name, object_path=OBJECT + '/RemovableObject'): - super(RemovableObject, self).__init__(bus_name, object_path) - @dbus.service.method(IFACE, in_signature='', out_signature='b') def IsThere(self): return True @@ -78,7 +75,7 @@ class TestInterface(dbus.service.Interface): class TestObject(dbus.service.Object, TestInterface): def __init__(self, bus_name, object_path=OBJECT): dbus.service.Object.__init__(self, bus_name, object_path) - self._removables = [] + self._removable = RemovableObject() """ Echo whatever is sent """ @@ -229,7 +226,8 @@ class TestObject(dbus.service.Object, TestInterface): def AddRemovableObject(self): # Part of test for https://bugs.freedesktop.org/show_bug.cgi?id=10457 # Keep the removable object reffed, since that's the use case for this - self._removables.append(RemovableObject(global_name)) + self._removable.add_to_connection(self._connection, + OBJECT + '/RemovableObject') return True @dbus.service.method(IFACE, in_signature='', out_signature='b') |