summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiovanni Campagna <gcampagna@src.gnome.org>2014-02-25 15:16:12 +0100
committerGiovanni Campagna <gcampagna@src.gnome.org>2014-02-26 17:27:08 +0100
commit63022d4290264182d1d41cffc9bf12f202931379 (patch)
treea81c94f291437bcc86d4144119e6058478a0cc7f
parenta9203dd3e98665982b380a40867eeb6f4e5f678b (diff)
downloadgobject-introspection-63022d4290264182d1d41cffc9bf12f202931379.tar.gz
docwriter: don't ignore disguised structures
Unless they have no methods, static methods and constructors (because then they are useless) Fixes GLib.BookmarkFile, GLib.PatternSpec and probably others.
-rw-r--r--giscanner/docwriter.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/giscanner/docwriter.py b/giscanner/docwriter.py
index b0f80e6d..d62425b2 100644
--- a/giscanner/docwriter.py
+++ b/giscanner/docwriter.py
@@ -603,6 +603,10 @@ class DocFormatterGjs(DocFormatterIntrospectableBase):
if isinstance(node, (ast.Compound, ast.Boxed)):
self.resolve_gboxed_constructor(node)
+ if isinstance(node, ast.Compound) and node.disguised and \
+ len(node.methods) == len(node.static_methods) == len(node.constructors) == 0:
+ return False
+
# Nodes without namespace are AST bugs really
# They are used for structs and unions declared
# inline inside other structs, but they are not
@@ -900,8 +904,6 @@ class DocWriter(object):
def _walk_node(self, output, node, chain):
if isinstance(node, ast.Function) and node.moved_to is not None:
return False
- if getattr(node, 'disguised', False):
- return False
if self._formatter.should_render_node(node):
self._render_node(node, chain, output)