summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk>2010-10-28 16:41:41 -0400
committerLouis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk>2010-12-03 10:55:44 -0500
commit6bfba32a582e3ee29033206c9d5c547817ca7dce (patch)
tree2ab4e39e0dcf2206ac8e28e4e2480ccb2590269d /src
parent8a9fa626c7ee9183a6d275e8cb1134ee35c73eef (diff)
Add default implementation of GetParameters using Protocol
Connection managers that don't support Protocol have to override the method (should already be the case in actual CMs)
Diffstat (limited to 'src')
-rw-r--r--src/server/connmgr.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/server/connmgr.py b/src/server/connmgr.py
index bdf1dc6..b490834 100644
--- a/src/server/connmgr.py
+++ b/src/server/connmgr.py
@@ -75,6 +75,18 @@ class ConnectionManager(_ConnectionManager, DBusProperties):
if proto not in self._protos:
raise NotImplemented('unknown protocol %s' % proto)
+ def check_protocol(self, proto):
+ if proto not in self._protocols:
+ raise NotImplemented('no protocol object for %s' % proto)
+
+ @dbus.service.method(CONN_MGR_INTERFACE, in_signature='s', out_signature='a(susv)')
+ def GetParameters(self, proto):
+ "Returns the mandatory and optional parameters for the given proto."
+ self.check_proto(proto)
+ self.check_protocol(proto)
+
+ return self._protocols[proto].parameters
+
@dbus.service.method(CONN_MGR_INTERFACE, in_signature='', out_signature='as')
def ListProtocols(self):
return self._protos.keys()