Skip to content

Commit

Permalink
Drop support for Python 2.4 and 2.5.
Browse files Browse the repository at this point in the history
Replace deprecated 'zope.interface.implements' usage with equivalent
'zope.interface.implementer' decorator.
  • Loading branch information
tseaver committed May 18, 2012
1 parent 8c92e8e commit ff5b783
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
7 changes: 6 additions & 1 deletion CHANGES.txt
Expand Up @@ -2,9 +2,14 @@
CHANGES
=======

3.7.0 (unreleased)
4.0.0 (unreleased)
------------------

- Replaced deprecated ``zope.interface.implements`` usage with equivalent
``zope.interface.implementer`` decorator.

- Dropped support for Python 2.4 and 2.5.

- Add a new IMatchingPasswordManager interface with a 'match' method, which
returns True if a given password hash was encdoded with the scheme
implemented by the specific manager. All managers in this package implement
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Expand Up @@ -17,7 +17,7 @@


setup(name='zope.password',
version='3.7.0dev',
version='4.0.0dev',
author='Zope Foundation and Contributors',
author_email='zope-dev@zope.org',
description='Password encoding and checking utilities',
Expand All @@ -34,6 +34,9 @@
'Intended Audience :: Developers',
'License :: OSI Approved :: Zope Public License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Natural Language :: English',
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
Expand Down
6 changes: 3 additions & 3 deletions src/zope/password/legacy.py
Expand Up @@ -24,13 +24,14 @@
# The crypt module is not universally available, apparently
crypt = None

from zope.interface import implements
from zope.interface import implementer
from zope.password.interfaces import IMatchingPasswordManager

_encoder = getencoder("utf-8")


if crypt is not None:
@implementer(IMatchingPasswordManager)
class CryptPasswordManager(object):
"""Crypt password manager.
Expand Down Expand Up @@ -95,7 +96,6 @@ class CryptPasswordManager(object):
"""

implements(IMatchingPasswordManager)

def encodePassword(self, password, salt=None):
if salt is None:
Expand All @@ -113,6 +113,7 @@ def match(self, encoded_password):
return encoded_password.startswith('{CRYPT}')


@implementer(IMatchingPasswordManager)
class MySQLPasswordManager(object):
"""A MySQL digest manager.
Expand Down Expand Up @@ -162,7 +163,6 @@ class MySQLPasswordManager(object):
"""

implements(IMatchingPasswordManager)

def encodePassword(self, password):
nr = 1345345333L
Expand Down
4 changes: 2 additions & 2 deletions src/zope/password/password.py
Expand Up @@ -28,12 +28,13 @@
from md5 import new as md5
from sha import new as sha1

from zope.interface import implements
from zope.interface import implementer
from zope.password.interfaces import IMatchingPasswordManager

_encoder = getencoder("utf-8")


@implementer(IMatchingPasswordManager)
class PlainTextPasswordManager(object):
"""Plain text password manager.
Expand Down Expand Up @@ -62,7 +63,6 @@ class PlainTextPasswordManager(object):
False
"""

implements(IMatchingPasswordManager)

def encodePassword(self, password):
return password
Expand Down

0 comments on commit ff5b783

Please sign in to comment.