[gobject-introspection] maintransformer: split up a complex conditional



commit f2858cff69da8bcd4cbe196ed3a2f20b93872ad4
Author: Ryan Lortie <desrt desrt ca>
Date:   Wed Apr 16 17:15:05 2014 -0400

    maintransformer: split up a complex conditional
    
    We assign node.allow_none in two separate cases:
    
     - if the (allow-none) annotation was given
    
     - for GCancellable and GAsyncReadyCallback, as special cases
    
    Split the two up.  This will simplify future commits.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660879

 giscanner/maintransformer.py |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index afab7bc..d957a1f 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -579,9 +579,11 @@ class MainTransformer(object):
 
         self._adjust_container_type(parent, node, annotations)
 
-        if (ANN_ALLOW_NONE in annotations
-        or node.type.target_giname == 'Gio.AsyncReadyCallback'
-        or node.type.target_giname == 'Gio.Cancellable'):
+        if ANN_ALLOW_NONE in annotations:
+            node.allow_none = True
+
+        if (node.type.target_giname == 'Gio.AsyncReadyCallback' or
+                node.type.target_giname == 'Gio.Cancellable'):
             node.allow_none = True
 
         if tag and tag.description:


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