def _add_plugin_options(self, available_plugins):
"""Recovers the list of command line options implemented by the available plugins and adds them to the command
line parser.
"""
for plugin_class in available_plugins:
plugin_desc = plugin_class.get_interface()
# Add the current plugin's commands to the parser
group = OptionGroup(self._parser, plugin_desc.title, plugin_desc.description)
for cmd in plugin_desc.get_commands():
group.add_option(cmd)
# Add the current plugin's options to the parser
for option in plugin_desc.get_options():
group.add_option(option)
self._parser.add_option_group(group)
# Todo: Move formatting stuff to another file
评论列表
文章目录