Browse Source

devtool: make plugin_init optional

So far all devtool and recipetool plugins were expected
to have plugin_init function. This function is empty in
most of plugins as they don't require initialisation.

Making plugin_init optional would allow not having empty
plugin_init in every plugin.

(From OE-Core rev: b99640c89f067866b264f4ee4030fae4c2f338c0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Ed Bartosh 9 years ago
parent
commit
9485888656

+ 0 - 4
scripts/lib/devtool/build-image.py

@@ -25,10 +25,6 @@ from devtool import exec_build_env_command, setup_tinfoil, parse_recipe
 
 logger = logging.getLogger('devtool')
 
-def plugin_init(pluginlist):
-    """Plugin initialization"""
-    pass
-
 def _get_recipes(workspace, config):
     """Get list of target recipes from the workspace."""
     result = []

+ 0 - 5
scripts/lib/devtool/deploy.py

@@ -23,11 +23,6 @@ from devtool import exec_fakeroot, setup_tinfoil, DevtoolError
 
 logger = logging.getLogger('devtool')
 
-def plugin_init(pluginlist):
-    """Plugin initialization"""
-    pass
-
-
 def deploy(args, config, basepath, workspace):
     """Entry point for the devtool 'deploy' subcommand"""
     import re

+ 0 - 5
scripts/lib/devtool/standard.py

@@ -31,11 +31,6 @@ from devtool import parse_recipe
 logger = logging.getLogger('devtool')
 
 
-def plugin_init(pluginlist):
-    """Plugin initialization"""
-    pass
-
-
 def add(args, config, basepath, workspace):
     """Entry point for the devtool 'add' subcommand"""
     import bb

+ 0 - 4
scripts/lib/recipetool/append.py

@@ -33,10 +33,6 @@ logger = logging.getLogger('recipetool')
 
 tinfoil = None
 
-def plugin_init(pluginlist):
-    # Don't need to do anything here right now, but plugins must have this function defined
-    pass
-
 def tinfoil_init(instance):
     global tinfoil
     tinfoil = instance

+ 0 - 3
scripts/lib/recipetool/create_buildsys.py

@@ -307,9 +307,6 @@ class MakefileRecipeHandler(RecipeHandler):
             self.genfunction(lines_after, 'do_install', ['# Specify install commands here'])
 
 
-def plugin_init(pluginlist):
-    pass
-
 def register_recipe_handlers(handlers):
     # These are in a specific order so that the right one is detected first
     handlers.append(CmakeRecipeHandler())

+ 0 - 4
scripts/lib/recipetool/create_buildsys_python.py

@@ -711,10 +711,6 @@ def has_non_literals(value):
         return any(has_non_literals(v) for v in value)
 
 
-def plugin_init(pluginlist):
-    pass
-
-
 def register_recipe_handlers(handlers):
     # We need to make sure this is ahead of the makefile fallback handler
     handlers.insert(0, PythonRecipeHandler())

+ 1 - 1
scripts/lib/scriptutils.py

@@ -57,7 +57,7 @@ def load_plugins(logger, plugins, pluginpath):
             plugin = load_plugin(name)
             if hasattr(plugin, 'plugin_init'):
                 plugin.plugin_init(plugins)
-                plugins.append(plugin)
+            plugins.append(plugin)
 
 def git_convert_standalone_clone(repodir):
     """If specified directory is a git repository, ensure it's a standalone clone"""