[Checkins] SVN: zope.authentication/trunk/ Drop support for Python 2.4 and 2.5.
Tres Seaver
cvs-admin at zope.org
Fri May 18 03:26:02 UTC 2012
Log message for revision 126026:
Drop support for Python 2.4 and 2.5.
Replace deprecated 'zope.component.adapts' usage with equivalent
'zope.component.adapter' decorator.
Replace deprecated 'zope.interface.implements' usage with equivalent
'zope.interface.implementer' decorator.
Changed:
U zope.authentication/trunk/CHANGES.txt
U zope.authentication/trunk/setup.py
U zope.authentication/trunk/src/zope/authentication/loginpassword.py
U zope.authentication/trunk/src/zope/authentication/logout.py
U zope.authentication/trunk/src/zope/authentication/logout.txt
U zope.authentication/trunk/src/zope/authentication/principal.py
U zope.authentication/trunk/src/zope/authentication/principalterms.txt
U zope.authentication/trunk/src/zope/authentication/tests/test_logout.py
-=-
Modified: zope.authentication/trunk/CHANGES.txt
===================================================================
--- zope.authentication/trunk/CHANGES.txt 2012-05-18 03:24:36 UTC (rev 126025)
+++ zope.authentication/trunk/CHANGES.txt 2012-05-18 03:25:59 UTC (rev 126026)
@@ -2,10 +2,18 @@
CHANGES
=======
-3.7.2 (unreleased)
+4.0.0 (unreleased)
------------------
+- Replaced deprecated ``zope.component.adapts`` usage with equivalent
+ ``zope.component.adapter`` decorator.
+- Replaced deprecated ``zope.interface.implements`` usage with equivalent
+ ``zope.interface.implementer`` decorator.
+
+- Dropped support for Python 2.4 and 2.5.
+
+
3.7.1 (2010-04-30)
------------------
Modified: zope.authentication/trunk/setup.py
===================================================================
--- zope.authentication/trunk/setup.py 2012-05-18 03:24:36 UTC (rev 126025)
+++ zope.authentication/trunk/setup.py 2012-05-18 03:25:59 UTC (rev 126026)
@@ -20,7 +20,7 @@
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
setup(name='zope.authentication',
- version = '3.7.2dev',
+ version = '4.0.0dev',
author='Zope Foundation and Contributors',
author_email='zope-dev at zope.org',
description='Definition of authentication basics for the Zope Framework',
@@ -43,6 +43,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',
Modified: zope.authentication/trunk/src/zope/authentication/loginpassword.py
===================================================================
--- zope.authentication/trunk/src/zope/authentication/loginpassword.py 2012-05-18 03:24:36 UTC (rev 126025)
+++ zope.authentication/trunk/src/zope/authentication/loginpassword.py 2012-05-18 03:25:59 UTC (rev 126026)
@@ -13,17 +13,17 @@
##############################################################################
"""Login/Password provider.
"""
-from zope.interface import implements
+from zope.interface import implementer
from zope.authentication.interfaces import ILoginPassword
+ at implementer(ILoginPassword)
class LoginPassword(object):
"""Basic ILoginPassword implementation.
This class can be used as a base for implementing ILoginPassword adapters.
"""
- implements(ILoginPassword)
def __init__(self, login, password):
self.__login = login
Modified: zope.authentication/trunk/src/zope/authentication/logout.py
===================================================================
--- zope.authentication/trunk/src/zope/authentication/logout.py 2012-05-18 03:24:36 UTC (rev 126025)
+++ zope.authentication/trunk/src/zope/authentication/logout.py 2012-05-18 03:25:59 UTC (rev 126026)
@@ -13,18 +13,18 @@
##############################################################################
"""ILogout implementations
"""
-from zope.component import adapts
-from zope.interface import implements, Interface
+from zope.component import adapter
+from zope.interface import implementer, Interface
from zope.authentication.interfaces import IAuthentication
from zope.authentication.interfaces import ILogout, ILogoutSupported
+ at adapter(IAuthentication)
+ at implementer(ILogout)
class NoLogout(object):
"""An adapter for IAuthentication utilities that don't implement ILogout."""
- adapts(IAuthentication)
- implements(ILogout)
def __init__(self, auth):
pass
@@ -33,11 +33,11 @@
pass
+ at adapter(Interface)
+ at implementer(ILogoutSupported)
class LogoutSupported(object):
"""A class that can be registered as an adapter to flag logout support."""
- adapts(Interface)
- implements(ILogoutSupported)
def __init__(self, dummy):
pass
Modified: zope.authentication/trunk/src/zope/authentication/logout.txt
===================================================================
--- zope.authentication/trunk/src/zope/authentication/logout.txt 2012-05-18 03:24:36 UTC (rev 126025)
+++ zope.authentication/trunk/src/zope/authentication/logout.txt 2012-05-18 03:25:59 UTC (rev 126026)
@@ -12,11 +12,10 @@
To illustrate, we'll create a simple logout implementation that adapts
IAuthentication:
- >>> class SimpleLogout(object):
+ >>> @adapter(IAuthentication)
+ ... @implementer(ILogout)
+ ... class SimpleLogout(object):
...
- ... adapts(IAuthentication)
- ... implements(ILogout)
- ...
... def __init__(self, auth):
... pass
...
@@ -27,9 +26,9 @@
and something to represent an authentication utility:
- >>> class Authentication(object):
- ...
- ... implements(IAuthentication)
+ >>> @implementer(IAuthentication)
+ ... class Authentication(object):
+ ... pass
>>> auth = Authentication()
Modified: zope.authentication/trunk/src/zope/authentication/principal.py
===================================================================
--- zope.authentication/trunk/src/zope/authentication/principal.py 2012-05-18 03:24:36 UTC (rev 126025)
+++ zope.authentication/trunk/src/zope/authentication/principal.py 2012-05-18 03:25:59 UTC (rev 126026)
@@ -14,8 +14,8 @@
"""Principal source and helper function
"""
from zope.browser.interfaces import ITerms
-from zope.component import getUtility, queryNextUtility, adapts
-from zope.interface import implements, Interface
+from zope.component import getUtility, queryNextUtility, adapter
+from zope.interface import implementer, Interface
from zope.schema.interfaces import ISourceQueriables
from zope.authentication.interfaces import IAuthentication, IPrincipalSource
@@ -30,10 +30,9 @@
To test it, let's create and register a dummy authentication utility.
- >>> class DummyUtility:
+ >>> @implementer(IAuthentication)
+ ... class DummyUtility:
...
- ... implements(IAuthentication)
- ...
... def getPrincipal(self, id):
... if id == 'bob':
... return id
@@ -60,11 +59,10 @@
raise ValueError("Undefined principal id", principal_id)
+ at implementer(IPrincipalSource, ISourceQueriables)
class PrincipalSource(object):
"""Generic Principal Source"""
- implements(IPrincipalSource, ISourceQueriables)
-
def __contains__(self, id):
"""Test for the existence of a user.
@@ -77,8 +75,8 @@
First we need to create a dummy utility that will return a user, if
the id is 'bob'.
- >>> class DummyUtility:
- ... implements(IAuthentication)
+ >>> @implementer(IAuthentication)
+ ... class DummyUtility:
... def getPrincipal(self, id):
... if id == 'bob':
... return id
@@ -113,21 +111,21 @@
various queriables). This method will walk up through all of the
authentication utilities to look for queriables.
- >>> class DummyUtility1:
- ... implements(IAuthentication)
+ >>> @implementer(IAuthentication)
+ ... class DummyUtility1:
... __parent__ = None
... def __repr__(self): return 'dummy1'
>>> dummy1 = DummyUtility1()
- >>> class DummyUtility2:
- ... implements(ISourceQueriables, IAuthentication)
+ >>> @implementer(ISourceQueriables, IAuthentication)
+ ... class DummyUtility2:
... __parent__ = None
... def getQueriables(self):
... return ('1', 1), ('2', 2), ('3', 3)
>>> dummy2 = DummyUtility2()
- >>> class DummyUtility3(DummyUtility2):
- ... implements(IAuthentication)
+ >>> @implementer(IAuthentication)
+ ... class DummyUtility3(DummyUtility2):
... def getQueriables(self):
... return ('4', 4),
>>> dummy3 = DummyUtility3()
@@ -163,10 +161,10 @@
i += 1
+ at implementer(ITerms)
+ at adapter(IPrincipalSource, Interface)
class PrincipalTerms(object):
- implements(ITerms)
- adapts(IPrincipalSource, Interface)
def __init__(self, context, request):
self.context = context
Modified: zope.authentication/trunk/src/zope/authentication/principalterms.txt
===================================================================
--- zope.authentication/trunk/src/zope/authentication/principalterms.txt 2012-05-18 03:24:36 UTC (rev 126025)
+++ zope.authentication/trunk/src/zope/authentication/principalterms.txt 2012-05-18 03:25:59 UTC (rev 126026)
@@ -11,11 +11,11 @@
... def __init__(self, id, title):
... self.id, self.title = id, title
- >>> from zope.interface import implements
+ >>> from zope.interface import implementer
>>> from zope.authentication.interfaces import IAuthentication
>>> from zope.authentication.interfaces import PrincipalLookupError
- >>> class AuthUtility:
- ... implements(IAuthentication)
+ >>> @implementer(IAuthentication)
+ ... class AuthUtility:
... data = {'jim': 'Jim Fulton', 'stephan': 'Stephan Richter'}
...
... def getPrincipal(self, id):
Modified: zope.authentication/trunk/src/zope/authentication/tests/test_logout.py
===================================================================
--- zope.authentication/trunk/src/zope/authentication/tests/test_logout.py 2012-05-18 03:24:36 UTC (rev 126025)
+++ zope.authentication/trunk/src/zope/authentication/tests/test_logout.py 2012-05-18 03:25:59 UTC (rev 126026)
@@ -17,8 +17,8 @@
import doctest
import unittest
-from zope.component import provideAdapter, adapts
-from zope.interface import implements
+from zope.component import provideAdapter, adapter
+from zope.interface import implementer
from zope.authentication.interfaces import IAuthentication
@@ -29,8 +29,8 @@
'../logout.txt',
globs={'provideAdapter': provideAdapter,
'TestRequest': object,
- 'implements': implements,
- 'adapts': adapts,
+ 'implementer': implementer,
+ 'adapter': adapter,
'IAuthentication': IAuthentication
},
),
More information about the checkins
mailing list