[gobject-introspection] docwriter/gjs: include non GObject instantiatable types



commit 15caff9c3e67e49763a7ff9368f4c0c8eda36f24
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Tue Feb 25 02:48:33 2014 +0100

    docwriter/gjs: include non GObject instantiatable types
    
    Support for fundamental types was just merged in gjs, so just
    filter out GParamSpec subclasses (because there is only one
    class in gjs)

 giscanner/docwriter.py |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)
---
diff --git a/giscanner/docwriter.py b/giscanner/docwriter.py
index c18e822..afad77b 100644
--- a/giscanner/docwriter.py
+++ b/giscanner/docwriter.py
@@ -618,19 +618,16 @@ class DocFormatterGjs(DocFormatterIntrospectableBase):
         if isinstance(node, ast.Union) and node.name is None:
             return False
         if isinstance(node, ast.Class):
-            is_gobject = False
-            parent = node
-            while parent:
-                if parent.namespace.name == 'GObject' and \
-                   parent.name == 'Object':
-                    is_gobject = True
-                    break
-                if not parent.parent_type:
-                    break
-                parent = self._transformer.lookup_typenode(parent.parent_type)
-            is_gparam = node.namespace.name == 'GObject' and \
-                node.name == 'ParamSpec'
-            if not is_gobject and not is_gparam:
+            is_gparam_subclass = False
+            if node.parent_type:
+                parent = self._transformer.lookup_typenode(node.parent_type)
+                while parent:
+                    if parent.namespace.name == 'GObject' and \
+                       parent.name == 'ParamSpec':
+                        is_gparam_subclass = True
+                        break
+                    parent = self._transformer.lookup_typenode(parent.parent_type)
+            if is_gparam_subclass:
                 return False
         if isinstance(node, ast.Function) and node.is_constructor:
             parent = node.parent


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