From 9845cc9ad7c9120803d8667711687c87e82de207 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Thu, 30 Sep 2010 19:57:21 +0100 Subject: List known DBus_Property parameters with well-known names --- tools/specparser.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'tools') diff --git a/tools/specparser.py b/tools/specparser.py index d555e0b9..e4cb490a 100644 --- a/tools/specparser.py +++ b/tools/specparser.py @@ -339,6 +339,35 @@ WARNING: Key '%s' not known in namespace '%s' n.setAttribute('href', o.get_url()) n.setAttribute('title', o.get_title()) + # Fill in with a linkified list of + # properties which are also connection parameters + for n in node.getElementsByTagNameNS(XMLNS_TP, + 'list-dbus-property-parameters'): + n.tagName = 'ul' + n.namespaceURI = None + + props = (p for interface in spec.interfaces + for p in interface.properties + if p.is_connection_parameter + ) + + for p in props: + link_text = doc.createTextNode(p.name) + + a = doc.createElement('a') + a.setAttribute('href', p.get_url()) + a.appendChild(link_text) + + # FIXME: it'd be nice to include the rich type of the property + # here too. + type_text = doc.createTextNode(' (%s)' % p.dbus_type) + + li = doc.createElement('li') + li.appendChild(a) + li.appendChild(type_text) + + n.appendChild(li) + def get_title(self): return '%s %s' % (self.get_type_name(), self.name) -- cgit v1.2.3