[gobject-introspection] first pass at python backend for doc tools



commit 57143d2bf01db4f9013193a2a2148b83b03c6722
Author: John (J5) Palmieri <johnp redhat com>
Date:   Mon Aug 15 08:01:43 2011 -0400

    first pass at python backend for doc tools

 giscanner/mallardwriter.py |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/giscanner/mallardwriter.py b/giscanner/mallardwriter.py
index 28b21af..bf87aea 100644
--- a/giscanner/mallardwriter.py
+++ b/giscanner/mallardwriter.py
@@ -261,7 +261,17 @@ class MallardFormatterC(MallardFormatter):
             return node.c_name
 
 class MallardFormatterPython(MallardFormatter):
-    pass
+    def get_title(self, node, parent):
+        if isinstance(node, ast.Namespace):
+            return "%s Documentation" % node.name
+        elif isinstance(node, ast.Function):
+            return "%s.%s" % (node.namespace, node.name)
+        elif isinstance(node, ast.Property):
+            return "%s" % parent.name
+        elif isinstance(node, ast.Signal):
+            return "%s" % node.name
+        else:
+            return "%s.%s" % (node.namespace, node.name)
 
 class MallardPage(object):
     def __init__(self, writer, node, parent):



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