mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 00:35:50 +02:00
Hide null installer (fixes #789).
This commit is contained in:
@@ -50,6 +50,11 @@ class PluginEntryPoint(object):
|
||||
"""Description with name. Handy for UI."""
|
||||
return "{0} ({1})".format(self.description, self.name)
|
||||
|
||||
@property
|
||||
def hidden(self):
|
||||
"""Should this plugin be hidden from UI?"""
|
||||
return getattr(self.plugin_cls, "hidden", False)
|
||||
|
||||
def ifaces(self, *ifaces_groups):
|
||||
"""Does plugin implements specified interface groups?"""
|
||||
return not ifaces_groups or any(
|
||||
@@ -183,6 +188,10 @@ class PluginsRegistry(collections.Mapping):
|
||||
return type(self)(dict((name, plugin_ep) for name, plugin_ep
|
||||
in self._plugins.iteritems() if pred(plugin_ep)))
|
||||
|
||||
def visible(self):
|
||||
"""Filter plugins based on visibility."""
|
||||
return self.filter(lambda plugin_ep: not plugin_ep.hidden)
|
||||
|
||||
def ifaces(self, *ifaces_groups):
|
||||
"""Filter plugins based on interfaces."""
|
||||
# pylint: disable=star-args
|
||||
|
||||
@@ -17,6 +17,7 @@ class Installer(common.Plugin):
|
||||
zope.interface.classProvides(interfaces.IPluginFactory)
|
||||
|
||||
description = "Null Installer"
|
||||
hidden = True
|
||||
|
||||
# pylint: disable=missing-docstring,no-self-use
|
||||
|
||||
|
||||
Reference in New Issue
Block a user