Tres Seaver
2012-03-18 1fa5607e67892c812830b64f2aa8a795ce063df8
Use Py3k-compatible 'implementer' class decorator.
6 files modified
34 ■■■■ changed files
repoze/who/api.py 6 ●●●● patch | view | raw | blame | history
repoze/who/plugins/auth_tkt.py 4 ●●●● patch | view | raw | blame | history
repoze/who/plugins/basicauth.py 4 ●●●● patch | view | raw | blame | history
repoze/who/plugins/htpasswd.py 4 ●●●● patch | view | raw | blame | history
repoze/who/plugins/redirector.py 6 ●●●● patch | view | raw | blame | history
repoze/who/plugins/sql.py 10 ●●●● patch | view | raw | blame | history
repoze/who/api.py
@@ -1,4 +1,4 @@
from zope.interface import implements
from zope.interface import implementer
from repoze.who.interfaces import IAPI
from repoze.who.interfaces import IAPIFactory
@@ -12,8 +12,8 @@
    return environ.get('repoze.who.api')
@implementer(IAPIFactory)
class APIFactory(object):
    implements(IAPIFactory)
    def __init__(self,
                 identifiers=(),
@@ -95,8 +95,8 @@
    return result
@implementer(IAPI)
class API(object):
    implements(IAPI)
    def __init__(self,
                 environ,
repoze/who/plugins/auth_tkt.py
@@ -4,7 +4,7 @@
import os
import time
from zope.interface import implements
from zope.interface import implementer
from repoze.who.interfaces import IIdentifier
from repoze.who.interfaces import IAuthenticator
@@ -18,8 +18,8 @@
        return _NOW_TESTING
    return datetime.datetime.now()
@implementer(IIdentifier, IAuthenticator)
class AuthTktCookiePlugin(object):
    implements(IIdentifier, IAuthenticator)
    userid_type_decoders = {'int':int}
repoze/who/plugins/basicauth.py
@@ -3,14 +3,14 @@
from repoze.who._compat import AUTHORIZATION
from webob.exc import HTTPUnauthorized
from zope.interface import implements
from zope.interface import implementer
from repoze.who.interfaces import IIdentifier
from repoze.who.interfaces import IChallenger
@implementer(IIdentifier, IChallenger)
class BasicAuthPlugin(object):
    implements(IIdentifier, IChallenger)
    
    def __init__(self, realm):
        self.realm = realm
repoze/who/plugins/htpasswd.py
@@ -1,6 +1,6 @@
import itertools
from zope.interface import implements
from zope.interface import implementer
from repoze.who.interfaces import IAuthenticator
from repoze.who.utils import resolveDotted
@@ -10,9 +10,9 @@
    yield 'aaaaaa:bbbbbb'
@implementer(IAuthenticator)
class HTPasswdPlugin(object):
    implements(IAuthenticator)
    def __init__(self, filename, check):
        self.filename = filename
repoze/who/plugins/redirector.py
@@ -6,12 +6,13 @@
import cgi
from webob.exc import HTTPFound
from zope.interface import implements
from zope.interface import implementer
from repoze.who.interfaces import IChallenger
from repoze.who._compat import construct_url
from repoze.who._compat import header_value
@implementer(IChallenger)
class RedirectorPlugin(object):
    """ Plugin for issuing challenges as redirects to a configured URL.
@@ -19,8 +20,7 @@
      supplied an ``X-Authorization-Failure-Reason`` header, the plugin
      includes that reason in the query string of the redirected URL.
    """
    implements(IChallenger)
    def __init__(self,
                 login_url,
                 came_from_param='came_from',
repoze/who/plugins/sql.py
@@ -1,4 +1,4 @@
from zope.interface import implements
from zope.interface import implementer
from repoze.who.interfaces import IAuthenticator
from repoze.who.interfaces import IMetadataProvider
@@ -30,9 +30,9 @@
        return psycopg2.connect(kw['repoze.who.dsn']) #pragma NO COVERAGE
    return conn_factory #pragma NO COVERAGE
@implementer(IAuthenticator)
class SQLAuthenticatorPlugin:
    implements(IAuthenticator)
    def __init__(self, query, conn_factory, compare_fn):
        # statement should be pyformat dbapi binding-style, e.g.
        # "select user_id, password from users where login=%(login)s"
@@ -56,9 +56,9 @@
            if self.compare_fn(identity['password'], password):
                return user_id
@implementer(IMetadataProvider)
class SQLMetadataProviderPlugin:
    implements(IMetadataProvider)
    def __init__(self, name, query, conn_factory, filter):
        self.name = name
        self.query = query