mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
PluginEntryPoint.description, show in CLI
This commit is contained in:
parent
aa6984e310
commit
5863323eb0
3 changed files with 11 additions and 2 deletions
|
|
@ -302,7 +302,8 @@ def create_parser(plugins):
|
|||
# TODO: plugin_parser should be called for every detected plugin
|
||||
for name, plugin_ep in plugins.iteritems():
|
||||
plugin_ep.plugin_cls.inject_parser_options(
|
||||
parser.add_argument_group(name), name)
|
||||
parser.add_argument_group(
|
||||
name, description=plugin_ep.description), name)
|
||||
|
||||
return parser
|
||||
|
||||
|
|
|
|||
|
|
@ -30,10 +30,15 @@ class PluginEntryPoint(object):
|
|||
return entry_point.name
|
||||
return entry_point.dist.key + ":" + entry_point.name
|
||||
|
||||
@property
|
||||
def description(self):
|
||||
"""Description of the plugin."""
|
||||
return self.plugin_cls.description
|
||||
|
||||
@property
|
||||
def name_with_description(self):
|
||||
"""Name with description. Handy for UI."""
|
||||
return "{0} ({1})".format(self.name, self.plugin_cls.description)
|
||||
return "{0} ({1})".format(self.name, self.description)
|
||||
|
||||
def ifaces(self, *ifaces_groups):
|
||||
"""Does plugin implements specified interface groups?"""
|
||||
|
|
|
|||
|
|
@ -49,6 +49,9 @@ class PluginEntryPointTest(unittest.TestCase):
|
|||
self.assertEqual(
|
||||
name, PluginEntryPoint.entry_point_to_plugin_name(entry_point))
|
||||
|
||||
def test_description(self):
|
||||
self.assertEqual("Standalone Authenticator", self.plugin_ep.description)
|
||||
|
||||
def test_name_with_description(self):
|
||||
self.assertTrue(
|
||||
self.plugin_ep.name_with_description.startswith("sa ("))
|
||||
|
|
|
|||
Loading…
Reference in a new issue