[gobject-introspection] [giscanner] Calrify missing element-type validation
- From: Johan Dahlin <johan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] [giscanner] Calrify missing element-type validation
- Date: Thu, 22 Jul 2010 17:59:13 +0000 (UTC)
commit ffff8446807d340d9e556367d953e33b43f43e1e
Author: Johan Dahlin <johan gnome org>
Date: Thu Jul 22 14:58:13 2010 -0300
[giscanner] Calrify missing element-type validation
Avoid using tabs and too long lines as well
giscanner/glibtransformer.py | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/giscanner/glibtransformer.py b/giscanner/glibtransformer.py
index 1da1f3f..391042d 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, ),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]