[gobject-introspection] docwriter: Add support for adding additional attrs to the xref writer



commit 2ebd527a853638eb3c13d00dedca1353dcffb212
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Feb 15 06:00:51 2013 -0500

    docwriter: Add support for adding additional attrs to the xref writer

 giscanner/docwriter.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/giscanner/docwriter.py b/giscanner/docwriter.py
index affcd2d..7f337d2 100644
--- a/giscanner/docwriter.py
+++ b/giscanner/docwriter.py
@@ -313,12 +313,13 @@ class DocFormatter(object):
         else:
             return make_page_id(node)
 
-    def format_xref(self, node):
+    def format_xref(self, node, **attrdict):
         if isinstance(node, ast.Member):
             # Enum/BitField members are linked to the main enum page.
-            return self.format_xref(node.parent) + '.' + node.name
+            return self.format_xref(node.parent, **attrdict) + '.' + node.name
         else:
-            return xmlwriter.build_xml_tag('link', [('xref', make_page_id(node))])
+            attrs = [('xref', make_page_id(node))] + attrdict.items()
+            return xmlwriter.build_xml_tag('link', attrs)
 
     def format_property_flags(self, property_, construct_only=False):
         flags = []


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]