From 57143d2bf01db4f9013193a2a2148b83b03c6722 Mon Sep 17 00:00:00 2001 From: "John (J5) Palmieri" Date: Mon, 15 Aug 2011 08:01:43 -0400 Subject: first pass at python backend for doc tools --- giscanner/mallardwriter.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'giscanner') diff --git a/giscanner/mallardwriter.py b/giscanner/mallardwriter.py index 28b21af0..bf87aea7 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): -- cgit v1.2.1