Coverage for certbot/plugins/disco.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
"""Utilities for plugins discovery and selection."""
"""Plugin entry point."""
"certbot", "certbot-apache", "certbot-dns-cloudflare", "certbot-dns-cloudxns", "certbot-dns-digitalocean", "certbot-dns-dnsimple", "certbot-dns-dnsmadeeasy", "certbot-dns-gehirn", "certbot-dns-google", "certbot-dns-linode", "certbot-dns-luadns", "certbot-dns-nsone", "certbot-dns-ovh", "certbot-dns-rfc2136", "certbot-dns-route53", "certbot-dns-sakuracloud", "certbot-nginx", "certbot-postfix", ] """Distributions for which prefix will be omitted."""
# this object is mutable, don't allow it to be hashed!
def entry_point_to_plugin_name(cls, entry_point): """Unique plugin name for an ``entry_point``"""
def description(self): """Description of the plugin."""
def description_with_name(self): """Description with name. Handy for UI."""
def long_description(self): """Long description of the plugin."""
def hidden(self): """Should this plugin be hidden from UI?"""
"""Does plugin implements specified interface groups?""" all(iface.implementedBy(self.plugin_cls) for iface in ifaces) for ifaces in ifaces_groups)
def initialized(self): """Has the plugin been initialized already?"""
"""Memoized plugin initialization."""
"""Verify that the plugin conforms to the specified interfaces.""" "%s implements %s but object does not verify: %s", self.plugin_cls, iface.__name__, error, exc_info=True)
def prepared(self): """Has the plugin been prepared already?"""
"""Memoized plugin preparation.""" "No installation (%r): %s", self, error, exc_info=True) else:
def misconfigured(self): """Is plugin misconfigured?"""
def problem(self): """Return the Exception raised during plugin setup, or None if all is well"""
def available(self): """Is plugin available, i.e. prepared or misconfigured?"""
"* {0}".format(self.name), "Description: {0}".format(self.plugin_cls.description), "Interfaces: {0}".format(", ".join( iface.__name__ for iface in zope.interface.implementedBy( self.plugin_cls))), "Entry point: {0}".format(self.entry_point), ]
"""Plugins registry."""
# plugins are sorted so the same order is used between runs. # This prevents deadlock caused by plugins acquiring a lock # and ensures at least one concurrent Certbot instance will run # successfully.
def find_all(cls): """Find plugins using setuptools entry points.""" # pylint: disable=not-callable pkg_resources.iter_entry_points( constants.SETUPTOOLS_PLUGINS_ENTRY_POINT), pkg_resources.iter_entry_points( constants.OLD_SETUPTOOLS_PLUGINS_ENTRY_POINT),) "PREFIX_FREE_DISTRIBUTIONS messed up") # providedBy | pylint: disable=no-member else: # pragma: no cover logger.warning( "%r does not provide IPluginFactory, skipping", plugin_ep)
"""Initialize all plugins in the registry.""" in six.itervalues(self._plugins)]
"""Filter plugins based on predicate.""" in six.iteritems(self._plugins) if pred(plugin_ep)))
"""Filter plugins based on visibility."""
"""Filter plugins based on interfaces.""" # pylint: disable=star-args
"""Filter plugins based on verification."""
"""Prepare all plugins in the registry."""
"""Filter plugins based on availability.""" # successfully prepared + misconfigured
"""Find an initialized plugin.
This is particularly useful for finding a name for the plugin (although `.IPluginFactory.__call__` takes ``name`` as one of the arguments, ``IPlugin.name`` is not part of the interface)::
# plugin is an instance providing IPlugin, initialized # somewhere else in the code plugin_registry.find_init(plugin).name
Returns ``None`` if ``plugin`` is not found in the registry.
""" # use list instead of set because PluginEntryPoint is not hashable if plugin_ep.initialized and plugin_ep.init() is plugin] else:
self.__class__.__name__, ','.join( repr(p_ep) for p_ep in six.itervalues(self._plugins)))
|