common.Plugin (with .conf(var), PluginEntryPoint, PluginRegistry

This commit is contained in:
Jakub Warmuz
2015-05-02 07:01:44 +00:00
parent 17e8ddcb5c
commit 19cff00835
13 changed files with 278 additions and 135 deletions
@@ -1,18 +1,27 @@
"""Example Let's Encrypt plugins."""
"""Example Let's Encrypt plugins.
For full examples, see `letsencrypt.client.plugins`.
"""
import zope.interface
from letsencrypt.client import interfaces
from letsencrypt.client.plugins import common
class Authenticator(object):
class Authenticator(common.Plugin):
zope.interface.implements(interfaces.IAuthenticator)
description = 'Example Authenticator plugin'
def __init__(self, config):
self.config = config
# Implement all methods from IAuthenticator, remembering to add
# "self" as first argument, e.g. def prepare(self)...
# For full examples, see letsencrypt.client.plugins
class Installer(common.Plugins):
zope.interface.implements(interfaces.IInstaller)
description = 'Example Installer plugin'
# Implement all methods from IInstaller, remembering to add
# "self" as first argument, e.g. def get_all_names(self)...
+2 -1
View File
@@ -10,7 +10,8 @@ setup(
],
entry_points={
'letsencrypt.plugins': [
'example = letsencrypt_example_plugins:Authenticator',
'example_authenticator = letsencrypt_example_plugins:Authenticator',
'example_installer = letsencrypt_example_plugins:Installer',
],
},
)