mirror of
https://github.com/certbot/certbot.git
synced 2026-02-17 09:38:06 -05:00
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.
31 lines
895 B
Python
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)...
|