diff --git a/loops/expert/browser/report.py b/loops/expert/browser/report.py index 7f7ad2a..9ce1992 100755 --- a/loops/expert/browser/report.py +++ b/loops/expert/browser/report.py @@ -1,29 +1,12 @@ -# -# Copyright (c) 2016 Helmut Merz helmutm@cy55.de -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# +# loops.expert.browser.report -""" -View classes for reporting. +""" View classes for reporting. """ from logging import getLogger -from urllib import urlencode +from urllib.parse import urlencode from zope import interface, component -from zope.app.pagetemplate import ViewPageTemplateFile +from zope.browserpage import ViewPageTemplateFile from zope.cachedescriptors.property import Lazy from zope.traversing.api import getName, getParent diff --git a/loops/knowledge/README.txt b/loops/knowledge/README.txt index 1617034..fba2c52 100644 --- a/loops/knowledge/README.txt +++ b/loops/knowledge/README.txt @@ -150,8 +150,8 @@ For testing, we first have to provide the needed utilities and settings >>> auth = PrincipalRegistry() >>> component.provideUtility(auth, IAuthentication) - >>> from zope.app.principalannotation.interfaces import IPrincipalAnnotationUtility - >>> from zope.app.principalannotation import PrincipalAnnotationUtility + >>> from zope.principalannotation.interfaces import IPrincipalAnnotationUtility + >>> from zope.principalannotation.utility import PrincipalAnnotationUtility >>> principalAnnotations = PrincipalAnnotationUtility() >>> component.provideUtility(principalAnnotations, IPrincipalAnnotationUtility) diff --git a/loops/organize/README.txt b/loops/organize/README.txt index 7dd3cd1..456664b 100644 --- a/loops/organize/README.txt +++ b/loops/organize/README.txt @@ -32,7 +32,7 @@ ZCML setup): >>> from loops.concept import Concept >>> from loops.setup import addAndConfigureObject - >>> johnC = addAndConfigureObject(concepts, Concept, 'john', title=u'John', + >>> johnC = addAndConfigureObject(concepts, Concept, 'john', title='John', ... conceptType=person) @@ -45,10 +45,10 @@ The classes used in this package are just adapters to IConcept. >>> john = IPerson(johnC) >>> john.title - u'John' - >>> john.firstName = u'John' + 'John' + >>> john.firstName = 'John' >>> johnC._firstName - u'John' + 'John' >>> john.lastName is None True >>> john.someOtherAttribute @@ -76,7 +76,7 @@ For testing, we first have to provide the needed utilities and settings >>> auth = setupData.auth >>> principalAnnotations = setupData.principalAnnotations - >>> principal = auth.definePrincipal('users.john', u'John', login='john') + >>> principal = auth.definePrincipal('users.john', 'John', login='john') >>> john.userId = 'users.john' >>> annotations = principalAnnotations.getAnnotationsById('users.john') @@ -86,7 +86,7 @@ For testing, we first have to provide the needed utilities and settings Change a userId assignment: - >>> principal = auth.definePrincipal('users.johnny', u'Johnny', login='johnny') + >>> principal = auth.definePrincipal('users.johnny', 'Johnny', login='johnny') >>> john.userId = 'users.johnny' >>> annotations = principalAnnotations.getAnnotationsById('users.johnny') @@ -127,13 +127,13 @@ principal annotation: If we try to assign a userId of a principal that already has a person concept assigned we should get an error: - >>> johnC = concepts['john'] = Concept(u'John') + >>> johnC = concepts['john'] = Concept('John') >>> johnC.conceptType = person >>> john = IPerson(johnC) >>> john.userId = 'users.john' >>> john.email = 'john@loopz.org' - >>> marthaC = concepts['martha'] = Concept(u'Martha') + >>> marthaC = concepts['martha'] = Concept('Martha') >>> marthaC.conceptType = person >>> martha = IPerson(marthaC) @@ -150,15 +150,15 @@ The member registration needs the whole pluggable authentication stuff with a principal folder: >>> from zope.app.appsetup.bootstrap import ensureUtility - >>> from zope.app.authentication.authentication import PluggableAuthentication - >>> from zope.app.security.interfaces import IAuthentication + >>> from zope.pluggableauth import PluggableAuthentication + >>> from zope.authentication.interfaces import IAuthentication >>> ensureUtility(site, IAuthentication, '', PluggableAuthentication, ... copy_to_zlog=False) <...PluggableAuthentication...> >>> pau = component.getUtility(IAuthentication, context=site) - >>> from zope.app.authentication.principalfolder import PrincipalFolder - >>> from zope.app.authentication.interfaces import IAuthenticatorPlugin + >>> from zope.pluggableauth.plugins.principalfolder import PrincipalFolder + >>> from zope.pluggableauth.interfaces import IAuthenticatorPlugin >>> pFolder = PrincipalFolder('loops.') >>> pau['loops'] = pFolder >>> pau.authenticatorPlugins = ('loops',) @@ -179,12 +179,12 @@ sure that a principal object can be served by a corresponding factory): >>> from zope.app.authentication.principalfolder import FoundPrincipalFactory >>> component.provideAdapter(FoundPrincipalFactory) - >>> data = {'loginName': u'newuser', - ... 'password': u'quack', - ... 'passwordConfirm': u'quack', - ... 'lastName': u'Sawyer', - ... 'firstName': u'Tom', - ... 'email': u'tommy@sawyer.com', + >>> data = {'loginName': 'newuser', + ... 'password': 'quack', + ... 'passwordConfirm': 'quack', + ... 'lastName': 'Sawyer', + ... 'firstName': 'Tom', + ... 'email': 'tommy@sawyer.com', ... 'form.action': 'update',} and register it. @@ -200,19 +200,19 @@ and register it. >>> person = concepts['person.newuser'] >>> pa = adapted(person) >>> pa.lastName, pa.userId - (u'Sawyer', u'loops.newuser') + ('Sawyer', 'loops.newuser') Now we can also retrieve it from the authentication utility: >>> pau.getPrincipal('loops.newuser').title - u'Tom Sawyer' + 'Tom Sawyer' Change Password --------------- - >>> data = {'oldPassword': u'tiger', - ... 'password': u'lion', - ... 'passwordConfirm': u'lion', + >>> data = {'oldPassword': 'tiger', + ... 'password': 'lion', + ... 'passwordConfirm': 'lion', ... 'action': 'update'} >>> request = TestRequest(form=data) @@ -235,7 +235,7 @@ Invalidates the user account by generating a new password. A mail ist sent to the email address of the person with a link for re-activating the account and enter a new password. - >>> data = {'loginName': u'dummy', + >>> data = {'loginName': 'dummy', ... 'action': 'update'} >>> request = TestRequest(form=data) @@ -257,14 +257,14 @@ store a persistent (internal) principal object. >>> pau['persons'] = pbAuth >>> pau.authenticatorPlugins = ('loops', 'persons',) - >>> eddieC = addAndConfigureObject(concepts, Concept, 'eddie', title=u'Eddie', + >>> eddieC = addAndConfigureObject(concepts, Concept, 'eddie', title='Eddie', ... conceptType=person) >>> eddie = adapted(eddieC) >>> eddie.userId = 'persons.eddie' >>> pbAuth.setPassword('eddie', 'secret') >>> pbAuth.authenticateCredentials(dict(login='eddie', password='secret')) - PrincipalInfo(u'persons.eddie') + PrincipalInfo('persons.eddie') Security @@ -275,7 +275,7 @@ Automatic security settings on persons >>> from zope.traversing.api import getName >>> list(sorted(getName(c) for c in concepts['person'].getChildren())) - [u'jim', u'john', u'martha', u'person.newuser'] + ['jim', 'john', 'martha', 'person.newuser'] Person objects that have a user assigned to them receive this user (principal) as their owner. @@ -284,7 +284,7 @@ Person objects that have a user assigned to them receive this user >>> IPrincipalRoleMap(concepts['john']).getPrincipalsAndRoles() [('loops.Person', 'users.john', PermissionSetting: Allow)] >>> IPrincipalRoleMap(concepts['person.newuser']).getPrincipalsAndRoles() - [('loops.Person', u'loops.newuser', PermissionSetting: Allow)] + [('loops.Person', 'loops.newuser', PermissionSetting: Allow)] The person ``martha`` hasn't got a user id, so there is no role assigned to it. @@ -299,7 +299,7 @@ We also need an interaction with a participation based on the principal whose permissions we want to check. >>> from zope.app.authentication.principalfolder import Principal - >>> pJohn = Principal('users.john', 'xxx', u'John') + >>> pJohn = Principal('users.john', 'xxx', 'John') >>> from loops.tests.auth import login >>> login(pJohn) @@ -335,7 +335,7 @@ So let's try with another user with another role setting. >>> principalRoles.assignRoleToPrincipal('loops.Staff', 'users.martha') >>> principalRoles.assignRoleToPrincipal('zope.Member', 'users.martha') - >>> pMartha = Principal('users.martha', 'xxx', u'Martha') + >>> pMartha = Principal('users.martha', 'xxx', 'Martha') >>> login(pMartha) >>> canAccess(john, 'title') @@ -364,14 +364,14 @@ Task view with edit action -------------------------- >>> from loops.organize.interfaces import ITask - >>> task = addAndConfigureObject(concepts, Concept, 'task', title=u'Task', + >>> task = addAndConfigureObject(concepts, Concept, 'task', title='Task', ... conceptType=type, typeInterface=ITask) >>> from loops.organize.task import Task >>> component.provideAdapter(Task) >>> task01 = addAndConfigureObject(concepts, Concept, 'task01', - ... title=u'Task #1', conceptType=task) + ... title='Task #1', conceptType=task) >>> from loops.organize.browser.task import TaskView >>> view = TaskView(task01, TestRequest()) @@ -389,21 +389,22 @@ but has to be entered as a type option. Events listing -------------- - >>> event = addAndConfigureObject(concepts, Concept, 'event', title=u'Event', + >>> event = addAndConfigureObject(concepts, Concept, 'event', title='Event', ... conceptType=type, typeInterface=ITask) >>> event01 = addAndConfigureObject(concepts, Concept, 'event01', - ... title=u'Event #1', conceptType=event, + ... title='Event #1', conceptType=event, ... ) >>> from loops.organize.browser.event import Events - >>> events = addAndConfigureObject(concepts, Concept, 'events', title=u'Events', + >>> events = addAndConfigureObject(concepts, Concept, 'events', title='Events', ... conceptType=concepts['query']) >>> listing = Events(events, TestRequest()) >>> listing.getActions('portlet') [] >>> from loops.config.base import QueryOptions - >>> component.provideAdapter(QueryOptions) + >>> from cybertools.meta.interfaces import IOptions + >>> component.provideAdapter(QueryOptions, provides=IOptions) >>> list(listing.events()) [] @@ -422,12 +423,15 @@ Send Email to Members >>> from loops.organize.browser.party import SendEmailForm >>> form = SendEmailForm(menu, TestRequest()) >>> form.members - [{'object': <...Person...>, 'email': 'john@loopz.org', 'title': u'John'}, - {'object': <...Person...>, 'email': u'tommy@sawyer.com', 'title': u'Tom Sawyer'}] + [{'title': 'John', ...}, {'title': 'Tom Sawyer', ...}] + +[{'object': <...Person...>, 'email': 'john@loopz.org', 'title': 'John'}, + {'object': <...Person...>, 'email': 'tommy@sawyer.com', 'title': 'Tom Sawyer'}] + >>> form.subject - u"loops Notification from '$site'" + "loops Notification from '$site'" >>> form.mailBody - u'\n\nEvent #1\nhttp://127.0.0.1/loops/views/menu/.118\n\n' + '\n\nEvent #1\nhttp://127.0.0.1/loops/views/menu/.118\n\n' Show Presence of Other Users @@ -453,7 +457,7 @@ may be chosen from an arbitrary list.) >>> from loops.organize.interfaces import IHasRole >>> predicate = concepts['predicate'] >>> hasRole = addAndConfigureObject(concepts, Concept, 'hasrole', - ... title=u'has Role', + ... title='has Role', ... conceptType=predicate, predicateInterface=IHasRole) Let's now assign john to task01 and have a look at the relation created. diff --git a/loops/organize/auth.py b/loops/organize/auth.py index f98dd61..a1277f1 100644 --- a/loops/organize/auth.py +++ b/loops/organize/auth.py @@ -1,36 +1,17 @@ -# -# Copyright (c) 2009 Helmut Merz helmutm@cy55.de -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# +# loops.organize.auth -""" -Specialized authentication components. - -$Id$ +""" Specialized authentication components. """ from persistent import Persistent -from zope.app.container.contained import Contained +from zope.authentication.interfaces import IAuthentication +from zope.container.contained import Contained from zope import component -from zope.interface import Interface, implements -from zope.app.authentication.interfaces import IAuthenticatorPlugin -from zope.app.authentication.principalfolder import IInternalPrincipal -from zope.app.authentication.principalfolder import PrincipalInfo -from zope.app.principalannotation.interfaces import IPrincipalAnnotationUtility -from zope.app.security.interfaces import IAuthentication +from zope.interface import Interface, implementer +from zope.pluggableauth.factories import PrincipalInfo +from zope.pluggableauth.interfaces import IAuthenticatorPlugin +from zope.pluggableauth.plugins.principalfolder import IInternalPrincipal +from zope.principalannotation.interfaces import IPrincipalAnnotationUtility from zope import schema from zope.traversing.api import getParent @@ -52,15 +33,14 @@ class IPersonBasedAuthenticator(Interface): readonly=True) +@implementer(IAuthenticatorPlugin, IPersonBasedAuthenticator) class PersonBasedAuthenticator(Persistent, Contained): - implements(IAuthenticatorPlugin, IPersonBasedAuthenticator) - passwordKey = 'loops.organize.password' ignoreCase = True def __init__(self, prefix=''): - self.prefix = unicode(prefix) + self.prefix = prefix def authenticateCredentials(self, credentials): if not isinstance(credentials, dict): diff --git a/loops/organize/browser/event.py b/loops/organize/browser/event.py index 8f43548..c1e8f5d 100644 --- a/loops/organize/browser/event.py +++ b/loops/organize/browser/event.py @@ -1,31 +1,14 @@ -# -# Copyright (c) 2012 Helmut Merz helmutm@cy55.de -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# +# loops.organize.browser.event -""" -Definition of view classes and other browser related stuff for tasks. +""" Definition of view classes and other browser related stuff for tasks. """ import calendar from datetime import date, datetime, timedelta -from urllib import urlencode -from zope.app.container.interfaces import INameChooser -from zope.app.pagetemplate import ViewPageTemplateFile +from urllib.parse import urlencode +from zope.browserpage import ViewPageTemplateFile from zope.cachedescriptors.property import Lazy +from zope.container.interfaces import INameChooser from zope import interface, component from zope.traversing.api import getName diff --git a/loops/organize/browser/member.py b/loops/organize/browser/member.py index 9ffe903..13e43b0 100644 --- a/loops/organize/browser/member.py +++ b/loops/organize/browser/member.py @@ -1,36 +1,19 @@ -# -# Copyright (c) 2015 Helmut Merz helmutm@cy55.de -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# +# loops.organize.browser.member -""" -Definition of view classes and other browser related stuff for +""" Definition of view classes and other browser related stuff for members (persons). """ from datetime import datetime -from email.MIMEText import MIMEText +from email.mime.text import MIMEText from zope import interface, component from zope.app.authentication.principalfolder import InternalPrincipal from zope.app.authentication.principalfolder import PrincipalInfo from zope.app.form.browser.textwidgets import PasswordWidget as BasePasswordWidget -from zope.app.pagetemplate import ViewPageTemplateFile -from zope.app.principalannotation import annotations +from zope.browserpage import ViewPageTemplateFile from zope.cachedescriptors.property import Lazy from zope.i18nmessageid import MessageFactory +from zope.principalannotation.utility import annotations from zope.security import checkPermission from zope.sendmail.interfaces import IMailDelivery from zope.traversing.browser import absoluteURL @@ -249,7 +232,7 @@ class SecureMemberRegistration(BaseMemberRegistration, CreateForm): result = regMan.register(login, pw, form.get('lastName'), form.get('firstName'), email=email,) - except ValueError, e: + except ValueError: fi = formState.fieldInstances['loginName'] fi.setError('duplicate_loginname', self.formErrors) formState.severity = max(formState.severity, fi.severity) @@ -505,7 +488,7 @@ class FixPersonRoles(object): for p in concepts['person'].getChildren([concepts['hasType']]): person = adapted(p) userId = person.userId - print '***', userId + print('***', userId) person.userId = userId return 'blubb' diff --git a/loops/organize/browser/party.py b/loops/organize/browser/party.py index d2f8d5a..da5e323 100644 --- a/loops/organize/browser/party.py +++ b/loops/organize/browser/party.py @@ -1,29 +1,12 @@ -# -# Copyright (c) 2016 Helmut Merz helmutm@cy55.de -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# +# loops.organize.browser.party -""" -Definition of view classes and other browser related stuff (e.g. actions) for +""" Definition of view classes and other browser related stuff (e.g. actions) for loops.organize.party. """ -from email.MIMEText import MIMEText +from email.mime.text import MIMEText from zope import interface, component -from zope.app.pagetemplate import ViewPageTemplateFile +from zope.browserpage import ViewPageTemplateFile from zope.cachedescriptors.property import Lazy from zope.dublincore.interfaces import IZopeDublinCore from zope.sendmail.interfaces import IMailDelivery diff --git a/loops/organize/member.py b/loops/organize/member.py index 50eb0db..75fc76f 100644 --- a/loops/organize/member.py +++ b/loops/organize/member.py @@ -1,40 +1,22 @@ -# -# Copyright (c) 2015 Helmut Merz helmutm@cy55.de -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# +# loops.organize.member -""" -Member registration adapter(s). +""" Member registration adapter(s). """ from zope import interface, component, schema -from zope.app.component import queryNextUtility -from zope.app.container.interfaces import INameChooser +from zope.authentication.interfaces import IAuthentication, PrincipalLookupError +from zope.cachedescriptors.property import Lazy +from zope.component import adapts, queryNextUtility +from zope.container.interfaces import INameChooser from zope.cachedescriptors.property import Lazy -from zope.component import adapts -from zope.interface import implements -from zope.app.authentication.interfaces import IPluggableAuthentication -from zope.app.authentication.interfaces import IAuthenticatorPlugin -from zope.app.authentication.principalfolder import IInternalPrincipal -from zope.app.authentication.principalfolder import InternalPrincipal -from zope.lifecycleevent import ObjectCreatedEvent, ObjectModifiedEvent -from zope.app.security.interfaces import IAuthentication, PrincipalLookupError from zope.event import notify from zope.i18nmessageid import MessageFactory -from zope.cachedescriptors.property import Lazy +from zope.interface import implementer +from zope.lifecycleevent import ObjectCreatedEvent, ObjectModifiedEvent +from zope.pluggableauth.interfaces import IPluggableAuthentication +from zope.pluggableauth.interfaces import IAuthenticatorPlugin +from zope.pluggableauth.plugins.principalfolder import IInternalPrincipal +from zope.pluggableauth.plugins.principalfolder import InternalPrincipal from cybertools.meta.interfaces import IOptions from cybertools.typology.interfaces import IType @@ -49,9 +31,9 @@ from loops.type import getOptionsDict from loops.util import _ +@implementer(IMemberRegistrationManager) class MemberRegistrationManager(object): - implements(IMemberRegistrationManager) adapts(ILoops) person_typeName = 'person' diff --git a/loops/organize/presence.py b/loops/organize/presence.py index 766f146..71efc07 100644 --- a/loops/organize/presence.py +++ b/loops/organize/presence.py @@ -1,30 +1,11 @@ -# -# Copyright (c) 2009 Helmut Merz helmutm@cy55.de -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# +# loops.organize.presence -""" -Utility for collecting information about logged-in/active users. +""" Utility for collecting information about logged-in/active users. Author: Hannes Plattner. - -$Id$ """ -from zope.interface import implements +from zope.interface import implementer from zope.cachedescriptors.property import Lazy from cybertools.meta.interfaces import IOptions @@ -34,10 +15,9 @@ from loops.organize.party import getPersonForUser from loops.organize import util +@implementer(IPresence) class Presence(object): - implements(IPresence) - def __init__(self, min_until_logout=10, presentUsers=None): self.min_until_logout = min_until_logout self.presentUsers = presentUsers or {} diff --git a/loops/organize/setup.py b/loops/organize/setup.py index 92abcff..40e0463 100644 --- a/loops/organize/setup.py +++ b/loops/organize/setup.py @@ -1,29 +1,7 @@ -# -# Copyright (c) 2006 Helmut Merz helmutm@cy55.de -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# +# loops.organize.setup +""" Automatic setup of a loops site for the organize package. """ -Automatic setup of a loops site for the organize package. - -$Id$ -""" - -from zope.component import adapts -from zope.interface import implements, Interface from loops.concept import Concept from loops.interfaces import ITypeConcept diff --git a/loops/organize/tests.py b/loops/organize/tests.py index b0d5e9f..3a0ceb4 100755 --- a/loops/organize/tests.py +++ b/loops/organize/tests.py @@ -4,17 +4,17 @@ from zope.interface.verify import verifyClass from zope import component from zope.app.appsetup.bootstrap import ensureUtility -from zope.app.authentication.authentication import PluggableAuthentication -from zope.app.authentication.interfaces import IAuthenticatorPlugin -from zope.app.authentication.principalfolder import FoundPrincipalFactory -from zope.app.authentication.principalfolder import InternalPrincipal -from zope.app.authentication.principalfolder import Principal -from zope.app.authentication.principalfolder import PrincipalFolder -from zope.app.principalannotation import PrincipalAnnotationUtility -from zope.app.principalannotation import annotations -from zope.app.principalannotation.interfaces import IPrincipalAnnotationUtility -from zope.app.security.interfaces import IAuthentication -from zope.app.security.principalregistry import PrincipalRegistry +from zope.authentication.interfaces import IAuthentication +from zope.pluggableauth import PluggableAuthentication +from zope.pluggableauth.interfaces import IAuthenticatorPlugin +from zope.pluggableauth.factories import FoundPrincipalFactory +from zope.pluggableauth.factories import Principal +from zope.pluggableauth.plugins.principalfolder import InternalPrincipal +from zope.pluggableauth.plugins.principalfolder import PrincipalFolder +from zope.principalannotation.utility import PrincipalAnnotationUtility +from zope.principalannotation.utility import annotations +from zope.principalannotation.interfaces import IPrincipalAnnotationUtility +from zope.principalregistry.principalregistry import PrincipalRegistry from zope.securitypolicy.interfaces import IRolePermissionManager from zope.securitypolicy.interfaces import IPrincipalRoleManager diff --git a/pyproject.toml b/pyproject.toml index 2f3231e..18ad513 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,7 @@ dependencies = [ "py-scopes", "markdown", "python-dotenv", + "zope.app.appsetup", "zope.app.authentication", "zope.app.exception", "zope.app.renderer",