diff options
author | Jakub Warmuz <jakub@warmuz.org> | 2015-03-26 16:55:23 +0300 |
---|---|---|
committer | Jakub Warmuz <jakub@warmuz.org> | 2015-03-26 16:55:23 +0300 |
commit | ff532469a56875ff24cc8aada7215ee2700111ab (patch) | |
tree | 5a32f377c0f6db10072c6078e1d47c88d9c5a616 /examples | |
parent | 197125bdda46897f226cb3b5408b81d63379051c (diff) |
Setuptools entry_points plugins
Diffstat (limited to 'examples')
-rw-r--r-- | examples/plugins/letsencrypt_example_plugins.py | 16 | ||||
-rw-r--r-- | examples/plugins/setup.py | 16 |
2 files changed, 32 insertions, 0 deletions
diff --git a/examples/plugins/letsencrypt_example_plugins.py b/examples/plugins/letsencrypt_example_plugins.py new file mode 100644 index 000000000..6817c7f1d --- /dev/null +++ b/examples/plugins/letsencrypt_example_plugins.py @@ -0,0 +1,16 @@ +"""Example Let's Encrypt plugins.""" +import zope.interface + +from letsencrypt.client import interfaces + + +class Authenticator(object): + 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)... diff --git a/examples/plugins/setup.py b/examples/plugins/setup.py new file mode 100644 index 000000000..845d6eb66 --- /dev/null +++ b/examples/plugins/setup.py @@ -0,0 +1,16 @@ +from setuptools import setup + + +setup( + name='letsencrypt-example-plugins', + package='letsencrypt_example_plugins.py', + install_requires=[ + 'letsencrypt', + 'zope.interface', + ], + entry_points={ + 'letsencrypt.authenticators': [ + 'example = letsencrypt_example_plugins:Authenticator', + ], + }, +) |