diff options
author | Jakub Warmuz <jakub@warmuz.org> | 2015-05-02 10:01:44 +0300 |
---|---|---|
committer | Jakub Warmuz <jakub@warmuz.org> | 2015-05-02 10:01:44 +0300 |
commit | 19cff0083556288fb64b4dbb38d2f3a7949d43e4 (patch) | |
tree | eeceb1a9ef67c22e4d3b8080f3dbd12beff53cf7 /examples | |
parent | 17e8ddcb5cca97d6f3568ebbcc3cd755363b59da (diff) |
common.Plugin (with .conf(var), PluginEntryPoint, PluginRegistry
Diffstat (limited to 'examples')
-rw-r--r-- | examples/plugins/letsencrypt_example_plugins.py | 21 | ||||
-rw-r--r-- | examples/plugins/setup.py | 3 |
2 files changed, 17 insertions, 7 deletions
diff --git a/examples/plugins/letsencrypt_example_plugins.py b/examples/plugins/letsencrypt_example_plugins.py index 987a2b33b..11baf35a7 100644 --- a/examples/plugins/letsencrypt_example_plugins.py +++ b/examples/plugins/letsencrypt_example_plugins.py @@ -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)... diff --git a/examples/plugins/setup.py b/examples/plugins/setup.py index 599d57020..71bb95333 100644 --- a/examples/plugins/setup.py +++ b/examples/plugins/setup.py @@ -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', ], }, ) |