summaryrefslogtreecommitdiff
path: root/scripts/lib
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-06-17 09:56:44 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-23 11:38:16 +0100
commit0997208266686473d23aed0fab58a1fd7c5d8cae (patch)
tree7c2ed63778a42904d3b6711a8e9eea29ad5e0323 /scripts/lib
parentd4414b45c81ab539f75a7bb16fc6412c30dfc45f (diff)
downloadopenembedded-core-0997208266686473d23aed0fab58a1fd7c5d8cae.tar.gz
openembedded-core-0997208266686473d23aed0fab58a1fd7c5d8cae.tar.bz2
openembedded-core-0997208266686473d23aed0fab58a1fd7c5d8cae.zip
wic: Integrated plugin docstrings into 'wic help plugins' output
Added mechanism to show docstrings of plugin classes as a part of plugins help page. For missing plugins the following warning message is shown: <class '<plugin class spec>'> is missing docstring. [YOCTO #7118] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/image/help.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/lib/image/help.py b/scripts/lib/image/help.py
index adfe976716..ce42627cdb 100644
--- a/scripts/lib/image/help.py
+++ b/scripts/lib/image/help.py
@@ -28,6 +28,7 @@
import subprocess
import logging
+from wic.plugin import pluginmgr, PLUGIN_TYPES
def subcommand_error(args):
logging.info("invalid subcommand %s" % args[0])
@@ -55,6 +56,23 @@ def wic_help(args, usage_str, subcommands):
print(usage_str)
+def get_wic_plugins_help():
+ """
+ Combine wic_plugins_help with the help for every known
+ source plugin.
+ """
+ result = wic_plugins_help
+ for plugin_type in PLUGIN_TYPES:
+ result += '\n\n%s PLUGINS\n\n' % plugin_type.upper()
+ for name, plugin in pluginmgr.get_plugins(plugin_type).iteritems():
+ result += "\n %s plugin:\n" % name
+ if plugin.__doc__:
+ result += plugin.__doc__
+ else:
+ result += "\n %s is missing docstring\n" % plugin
+ return result
+
+
def invoke_subcommand(args, parser, main_command_usage, subcommands):
"""
Dispatch to subcommand handler borrowed from combo-layer.