summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2010-10-08 11:16:57 +0100
committerJonny Lamb <jonny.lamb@collabora.co.uk>2010-10-08 11:16:57 +0100
commit1b9908e08dbae7c869828270bb2b16638ca959d2 (patch)
treeb3b6c5b558e19390eca9739ead7c01f538c72c56 /tools
parentb3af367d8def5455d979bd64beee534ca0766b34 (diff)
specparser: add a tp:error-ref element
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r--tools/specparser.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/specparser.py b/tools/specparser.py
index e4cb490a..d3d516ba 100644
--- a/tools/specparser.py
+++ b/tools/specparser.py
@@ -266,6 +266,23 @@ class Base(object):
n.namespaceURI = None
n.setAttribute('href', t.get_url())
+ # rewrite <tp:error-ref>
+ error_ns = 'org.freedesktop.Telepathy.Error.'
+ for n in node.getElementsByTagNameNS(XMLNS_TP, 'error-ref'):
+ try:
+ e = spec.errors[error_ns + getText(n)]
+ except KeyError:
+ print >> sys.stderr, """
+WARNING: Error '%s' not known in error namespace '%s'
+ (<tp:error-ref> in %s)
+ """.strip() % (getText(n), error_ns[:-1], self)
+ continue
+
+ n.tagName = 'a'
+ n.namespaceURI = None
+ n.setAttribute('href', e.get_url())
+ n.setAttribute('title', error_ns + getText(n))
+
# rewrite <tp:member-ref>
for n in node.getElementsByTagNameNS(XMLNS_TP, 'member-ref'):
key = getText(n)