[gobject-introspection] docwriter: don't ignore disguised structures



commit 63022d4290264182d1d41cffc9bf12f202931379
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Tue Feb 25 15:16:12 2014 +0100

    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.

 giscanner/docwriter.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/giscanner/docwriter.py b/giscanner/docwriter.py
index b0f80e6..d62425b 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)
 


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