summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2010-09-30 19:57:21 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2010-09-30 20:26:58 +0100
commit9845cc9ad7c9120803d8667711687c87e82de207 (patch)
tree3acc7c4ea448cfd4affe23c5cb87f9631a150b6d /tools
parent76c7b1e027797254e2d03fea748efe9ca4caa161 (diff)
List known DBus_Property parameters with well-known names
Diffstat (limited to 'tools')
-rw-r--r--tools/specparser.py29
1 files changed, 29 insertions, 0 deletions
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 <tp:list-dbus-property-parameters/> 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)