mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 22:08:07 -04:00
IPluginFactory
This commit is contained in:
parent
88dc56186e
commit
4f0d0936af
3 changed files with 26 additions and 0 deletions
|
|
@ -5,6 +5,26 @@ import zope.interface
|
|||
# pylint: disable=too-few-public-methods
|
||||
|
||||
|
||||
class IPluginFactory(zope.interface.Interface):
|
||||
|
||||
def __call__(config):
|
||||
"""Create new `IPlugin`.
|
||||
|
||||
:param IConfig config: Configuration.
|
||||
|
||||
"""
|
||||
|
||||
def add_parser_arguments(add):
|
||||
"""Add plugin arguments to the CLI argument parser.
|
||||
|
||||
:param callable add: Function that proxies calls to
|
||||
`argparse.ArgumentParser.add_argument` prepending options
|
||||
with unique plugin name prefix.
|
||||
|
||||
"""
|
||||
# TODO: move to IPlugin?
|
||||
|
||||
|
||||
class IPlugin(zope.interface.Interface):
|
||||
"""Let's Encrypt plugin."""
|
||||
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator):
|
|||
|
||||
"""
|
||||
zope.interface.implements(interfaces.IAuthenticator, interfaces.IInstaller)
|
||||
zope.interface.classProvides(interfaces.IPluginFactory)
|
||||
|
||||
description = "Apache Web Server"
|
||||
|
||||
|
|
|
|||
|
|
@ -30,9 +30,14 @@ class StandaloneAuthenticator(object):
|
|||
|
||||
"""
|
||||
zope.interface.implements(interfaces.IAuthenticator)
|
||||
zope.interface.classProvides(interfaces.IPluginFactory)
|
||||
|
||||
description = "Standalone Authenticator"
|
||||
|
||||
@classmethod
|
||||
def add_parser_arguments(cls, add):
|
||||
pass
|
||||
|
||||
def __init__(self, unused_config):
|
||||
self.child_pid = None
|
||||
self.parent_pid = os.getpid()
|
||||
|
|
|
|||
Loading…
Reference in a new issue