mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 10:42:11 +02:00
PluginEntryPoint.description, show in CLI
This commit is contained in:
@@ -302,7 +302,8 @@ def create_parser(plugins):
|
|||||||
# TODO: plugin_parser should be called for every detected plugin
|
# TODO: plugin_parser should be called for every detected plugin
|
||||||
for name, plugin_ep in plugins.iteritems():
|
for name, plugin_ep in plugins.iteritems():
|
||||||
plugin_ep.plugin_cls.inject_parser_options(
|
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
|
return parser
|
||||||
|
|
||||||
|
|||||||
@@ -30,10 +30,15 @@ class PluginEntryPoint(object):
|
|||||||
return entry_point.name
|
return entry_point.name
|
||||||
return entry_point.dist.key + ":" + 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
|
@property
|
||||||
def name_with_description(self):
|
def name_with_description(self):
|
||||||
"""Name with description. Handy for UI."""
|
"""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):
|
def ifaces(self, *ifaces_groups):
|
||||||
"""Does plugin implements specified interface groups?"""
|
"""Does plugin implements specified interface groups?"""
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ class PluginEntryPointTest(unittest.TestCase):
|
|||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
name, PluginEntryPoint.entry_point_to_plugin_name(entry_point))
|
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):
|
def test_name_with_description(self):
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
self.plugin_ep.name_with_description.startswith("sa ("))
|
self.plugin_ep.name_with_description.startswith("sa ("))
|
||||||
|
|||||||
Reference in New Issue
Block a user