mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
cfe64126c8
commit
5daadf85ed
@@ -28,6 +28,7 @@
|
|||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from wic.plugin import pluginmgr, PLUGIN_TYPES
|
||||||
|
|
||||||
def subcommand_error(args):
|
def subcommand_error(args):
|
||||||
logging.info("invalid subcommand %s" % args[0])
|
logging.info("invalid subcommand %s" % args[0])
|
||||||
@@ -55,6 +56,23 @@ def wic_help(args, usage_str, subcommands):
|
|||||||
print(usage_str)
|
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):
|
def invoke_subcommand(args, parser, main_command_usage, subcommands):
|
||||||
"""
|
"""
|
||||||
Dispatch to subcommand handler borrowed from combo-layer.
|
Dispatch to subcommand handler borrowed from combo-layer.
|
||||||
|
|||||||
+1
-1
@@ -277,7 +277,7 @@ subcommands = {
|
|||||||
hlp.wic_list_help],
|
hlp.wic_list_help],
|
||||||
"plugins": [wic_help_topic_subcommand,
|
"plugins": [wic_help_topic_subcommand,
|
||||||
wic_help_topic_usage,
|
wic_help_topic_usage,
|
||||||
hlp.wic_plugins_help],
|
hlp.get_wic_plugins_help()],
|
||||||
"overview": [wic_help_topic_subcommand,
|
"overview": [wic_help_topic_subcommand,
|
||||||
wic_help_topic_usage,
|
wic_help_topic_usage,
|
||||||
hlp.wic_overview_help],
|
hlp.wic_overview_help],
|
||||||
|
|||||||
Reference in New Issue
Block a user