summaryrefslogtreecommitdiffstats
path: root/scripts
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:47:33 +0100
commit5daadf85eddf6c5898fe2b9a9ef7b1e9ed434d84 (patch)
tree22c66f274b871c0f325b450bce5a59b1496ba271 /scripts
parentcfe64126c8d9afce907e51093e33c9805fa71b25 (diff)
downloadpoky-5daadf85eddf6c5898fe2b9a9ef7b1e9ed434d84.tar.gz
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] (From OE-Core rev: 0997208266686473d23aed0fab58a1fd7c5d8cae) 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>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/image/help.py18
-rwxr-xr-xscripts/wic2
2 files changed, 19 insertions, 1 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 @@
28import subprocess 28import subprocess
29import logging 29import logging
30 30
31from wic.plugin import pluginmgr, PLUGIN_TYPES
31 32
32def subcommand_error(args): 33def subcommand_error(args):
33 logging.info("invalid subcommand %s" % args[0]) 34 logging.info("invalid subcommand %s" % args[0])
@@ -55,6 +56,23 @@ def wic_help(args, usage_str, subcommands):
55 print(usage_str) 56 print(usage_str)
56 57
57 58
59def get_wic_plugins_help():
60 """
61 Combine wic_plugins_help with the help for every known
62 source plugin.
63 """
64 result = wic_plugins_help
65 for plugin_type in PLUGIN_TYPES:
66 result += '\n\n%s PLUGINS\n\n' % plugin_type.upper()
67 for name, plugin in pluginmgr.get_plugins(plugin_type).iteritems():
68 result += "\n %s plugin:\n" % name
69 if plugin.__doc__:
70 result += plugin.__doc__
71 else:
72 result += "\n %s is missing docstring\n" % plugin
73 return result
74
75
58def invoke_subcommand(args, parser, main_command_usage, subcommands): 76def invoke_subcommand(args, parser, main_command_usage, subcommands):
59 """ 77 """
60 Dispatch to subcommand handler borrowed from combo-layer. 78 Dispatch to subcommand handler borrowed from combo-layer.
diff --git a/scripts/wic b/scripts/wic
index cf968591e2..dda72a9c27 100755
--- a/scripts/wic
+++ b/scripts/wic
@@ -277,7 +277,7 @@ subcommands = {
277 hlp.wic_list_help], 277 hlp.wic_list_help],
278 "plugins": [wic_help_topic_subcommand, 278 "plugins": [wic_help_topic_subcommand,
279 wic_help_topic_usage, 279 wic_help_topic_usage,
280 hlp.wic_plugins_help], 280 hlp.get_wic_plugins_help()],
281 "overview": [wic_help_topic_subcommand, 281 "overview": [wic_help_topic_subcommand,
282 wic_help_topic_usage, 282 wic_help_topic_usage,
283 hlp.wic_overview_help], 283 hlp.wic_overview_help],