From f1c2dcd0f7b9d177877aafed95fe64343862c1cf Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 4 Jun 2007 12:24:58 +0100 Subject: [PATCH] dbus.service: change unexport() to remove_from_connection() at J5's request --- dbus/service.py | 14 ++++++++------ test/test-client.py | 2 +- test/test-service.py | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dbus/service.py b/dbus/service.py index 65af3ff..ae50751 100644 --- a/dbus/service.py +++ b/dbus/service.py @@ -426,8 +426,10 @@ class Object(Interface): __dbus_object_path__ = property(lambda self: self._object_path, None, None, "The D-Bus object path of this object") - def unexport(self, connection=None, path=None): - """Unexport this object. It will no longer be accessible via D-Bus. + def remove_from_connection(self, connection=None, path=None): + """Make this object inaccessible via the given D-Bus connection + and object path. If no connection or path is specified, + the object ceases to be accessible via any connection or path. It's not currently possible to export an object on more than one connection or with more than one object-path, but this will be @@ -435,11 +437,11 @@ class Object(Interface): :Parameters: `connection` : dbus.connection.Connection or None - Only unexport the object from this Connection. If None, - unexport from all Connections. + Only remove the object from this Connection. If None, + remove from all Connections on which it's exported. `path` : dbus.ObjectPath or other str, or None - Only unexport the object from this object path. If None, - unexport from all object paths. + Only remove the object from this object path. If None, + remove from all object paths. :Raises LookupError: if the object was not exported on the requested connection or path, or (if both are None) was not exported at all. diff --git a/test/test-client.py b/test/test-client.py index fbf0555..7616d3c 100755 --- a/test/test-client.py +++ b/test/test-client.py @@ -388,7 +388,7 @@ class TestDBusBindings(unittest.TestCase): def testListExportedChildObjects(self): self.assert_(self.iface.TestListExportedChildObjects()) - def testUnexport(self): + def testRemoveFromConnection(self): # https://bugs.freedesktop.org/show_bug.cgi?id=10457 self.assert_(not self.iface.HasRemovableObject()) self.assert_(self.iface.AddRemovableObject()) diff --git a/test/test-service.py b/test/test-service.py index 8f588c8..fe24010 100755 --- a/test/test-service.py +++ b/test/test-service.py @@ -59,7 +59,7 @@ class RemovableObject(dbus.service.Object): @dbus.service.method(IFACE, in_signature='', out_signature='b') def RemoveSelf(self): - self.unexport() + self.remove_from_connection() return True class TestGObject(ExportedGObject): -- 2.11.4.GIT