summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiovanni Campagna <gcampagna@src.gnome.org>2014-02-25 02:48:33 +0100
committerGiovanni Campagna <gcampagna@src.gnome.org>2014-02-26 17:27:08 +0100
commit15caff9c3e67e49763a7ff9368f4c0c8eda36f24 (patch)
treef6bcb51facbcab6c3bdd0bd38bfd0ce0ca19007d
parent5420484595418dc801d6f01ac02658f10255e699 (diff)
downloadgobject-introspection-15caff9c3e67e49763a7ff9368f4c0c8eda36f24.tar.gz
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)
-rw-r--r--giscanner/docwriter.py23
1 files changed, 10 insertions, 13 deletions
diff --git a/giscanner/docwriter.py b/giscanner/docwriter.py
index c18e8224..afad77b7 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