certbot/examples/plugins/letsencrypt_example_plugins.py
Roy Wellington Ⅳ b6142c13d6 Change zope's implements to be a class decorator.
When attempting to import any module that uses zope.interface.implements
in Python 3, a TypeError is raised; it reads:

    TypeError: Class advice impossible in Python3.  Use the @implementer
    class decorator instead.

Following the listed advice seems to function in Python 3.
2016-02-20 00:37:40 -08:00

31 lines
895 B
Python

"""Example Let's Encrypt plugins.
For full examples, see `letsencrypt.plugins`.
"""
import zope.interface
from letsencrypt import interfaces
from letsencrypt.plugins import common
@zope.interface.implementer(interfaces.IAuthenticator)
class Authenticator(common.Plugin):
"""Example Authenticator."""
zope.interface.classProvides(interfaces.IPluginFactory)
description = "Example Authenticator plugin"
# Implement all methods from IAuthenticator, remembering to add
# "self" as first argument, e.g. def prepare(self)...
@zope.interface.implementer(interfaces.IInstaller)
class Installer(common.Plugin):
"""Example Installer."""
zope.interface.classProvides(interfaces.IPluginFactory)
description = "Example Installer plugin"
# Implement all methods from IInstaller, remembering to add
# "self" as first argument, e.g. def get_all_names(self)...