[oe-commits] [bitbake] 03/03: bb.utils: let loaded plugins provide a plugin object

git at git.openembedded.org git at git.openembedded.org
Fri May 6 09:20:37 UTC 2016


rpurdie pushed a commit to branch master
in repository bitbake.

commit 71bfd5beb0d0ed88c7c14bbfd5ca1a1b56122bc1
Author: Christopher Larson <chris_larson at mentor.com>
AuthorDate: Sat Apr 30 12:40:59 2016 -0700

    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.
    
    Signed-off-by: Christopher Larson <chris_larson at mentor.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/utils.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index c54ff5b..5e735d3 100644
--- a/lib/bb/utils.py
+++ b/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)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list