[gnome-continuous-yocto/gnomeostree-3.28-rocko: 63/8267] bitbake: bb.utils: let loaded plugins provide a plugin object



commit 94655584cba7543781a8d45fdacbb6027a38b07c
Author: Christopher Larson <chris_larson mentor com>
Date:   Sat Apr 30 12:40:59 2016 -0700

    bitbake: bb.utils: let loaded plugins provide a plugin object
    
    This lets us avoid treating the module like an object, so no globals are
    needed, if one chooses to do so.
    
    (Bitbake rev: 71bfd5beb0d0ed88c7c14bbfd5ca1a1b56122bc1)
    
    Signed-off-by: Christopher Larson <chris_larson mentor com>
    Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>

 bitbake/lib/bb/utils.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index c54ff5b..5e735d3 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -1477,5 +1477,7 @@ def load_plugins(logger, plugins, pluginpath):
         if name != '__init__':
             plugin = load_plugin(name)
             if hasattr(plugin, 'plugin_init'):
-                plugin.plugin_init(plugins)
-            plugins.append(plugin)
+                obj = plugin.plugin_init(plugins)
+                plugins.append(obj or plugin)
+            else:
+                plugins.append(plugin)


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