summaryrefslogtreecommitdiff
path: root/giscanner/glibtransformer.py
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-07-22 14:58:13 -0300
committerJohan Dahlin <johan@gnome.org>2010-07-22 14:58:58 -0300
commitffff8446807d340d9e556367d953e33b43f43e1e (patch)
treeaf8ae89d391a3d0dae891bae63123ef57bb356be /giscanner/glibtransformer.py
parentbff440ad1d5f7abd95d6da8db059e9c0eb7d1ed6 (diff)
downloadgobject-introspection-ffff8446807d340d9e556367d953e33b43f43e1e.tar.gz
[giscanner] Calrify missing element-type validation
Avoid using tabs and too long lines as well
Diffstat (limited to 'giscanner/glibtransformer.py')
-rw-r--r--giscanner/glibtransformer.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/giscanner/glibtransformer.py b/giscanner/glibtransformer.py
index 1da1f3fa..391042d5 100644
--- a/giscanner/glibtransformer.py
+++ b/giscanner/glibtransformer.py
@@ -1144,16 +1144,25 @@ class GLibTransformer(object):
"""Virtual function %r has no known invoker""" % (vfunc.name, ),
context=node)
+ def _is_unannotated_list(self, node):
+ # Already annotated
+ if isinstance(node.type, List):
+ return False
+ if (node.type.name == 'GLib.List' or
+ node.type.name == 'GLib.SList'):
+ return True
+ if (self._transformer._namespace.name == 'GLib' and
+ (node.type.name == 'List' or
+ node.type.name == 'SList')):
+ return True
+ return False
+
def _introspectable_analysis(self, node, stack):
if isinstance(node, TypeContainer):
parent = stack[-1]
if isinstance(node.type, Varargs):
parent.introspectable = False
- elif not isinstance(node.type, List) and \
- (node.type.name == 'GLib.List' or
- node.type.name == 'GLib.SList' or
- (self._transformer._namespace.name == 'GLib'
- and (node.type.name == 'List' or node.type.name == 'SList'))):
+ elif self._is_unannotated_list(node):
if isinstance(node, Parameter):
self._transformer.log_node_warning(parent,
"""Missing (element-type) annotation on argument %r""" % (node.name, ),