[Zope3-checkins]
SVN: Zope3/branches/srichter-blow-services/src/zope/app/
Added some more BBB. Fixed two test failures in page folders.
Stephan Richter
srichter at cosmos.phy.tufts.edu
Sat Feb 5 14:19:17 EST 2005
Log message for revision 29057:
Added some more BBB. Fixed two test failures in page folders.
Changed:
U Zope3/branches/srichter-blow-services/src/zope/app/presentation/registration.py
U Zope3/branches/srichter-blow-services/src/zope/app/presentation/tests/test_presentation.py
U Zope3/branches/srichter-blow-services/src/zope/app/registration/interfaces.py
U Zope3/branches/srichter-blow-services/src/zope/app/registration/registration.py
U Zope3/branches/srichter-blow-services/src/zope/app/site/folder.py
U Zope3/branches/srichter-blow-services/src/zope/app/site/interfaces.py
U Zope3/branches/srichter-blow-services/src/zope/app/site/metaconfigure.py
U Zope3/branches/srichter-blow-services/src/zope/app/site/service.py
U Zope3/branches/srichter-blow-services/src/zope/app/site/servicecontainer.py
A Zope3/branches/srichter-blow-services/src/zope/app/utility/
A Zope3/branches/srichter-blow-services/src/zope/app/utility/__init__.py
A Zope3/branches/srichter-blow-services/src/zope/app/utility/interfaces.py
A Zope3/branches/srichter-blow-services/src/zope/app/utility/utility.py
A Zope3/branches/srichter-blow-services/src/zope/app/utility/vocabulary.py
-=-
Modified: Zope3/branches/srichter-blow-services/src/zope/app/presentation/registration.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/presentation/registration.py 2005-02-05 15:22:33 UTC (rev 29056)
+++ Zope3/branches/srichter-blow-services/src/zope/app/presentation/registration.py 2005-02-05 19:19:17 UTC (rev 29057)
@@ -117,18 +117,16 @@
def PageRegistrationAddSubscriber(registration, event):
if registration.template is not None:
- # XXX: Needs investigating
dependents = IDependable(removeSecurityProxy(registration.template))
- #objectpath = zapi.getPath(registration)
- #dependents.addDependent(objectpath)
+ objectpath = zapi.getPath(registration)
+ dependents.addDependent(objectpath)
def PageRegistrationRemoveSubscriber(registration, event):
if registration.template is not None:
- # XXX: Needs investigating
dependents = IDependable(removeSecurityProxy(registration.template))
- #objectpath = zapi.getPath(registration)
- #dependents.removeDependent(objectpath)
+ objectpath = zapi.getPath(registration)
+ dependents.removeDependent(objectpath)
class TemplateViewFactory(object):
Modified: Zope3/branches/srichter-blow-services/src/zope/app/presentation/tests/test_presentation.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/presentation/tests/test_presentation.py 2005-02-05 15:22:33 UTC (rev 29056)
+++ Zope3/branches/srichter-blow-services/src/zope/app/presentation/tests/test_presentation.py 2005-02-05 19:19:17 UTC (rev 29057)
@@ -165,7 +165,7 @@
def test_factories_template(self):
registration = contained(
- PageRegistration(I1, 'test', 'zope.View',
+ PageRegistration('test', I1, 'zope.View',
"Foo.Bar.A",
template=self.__template,
),
Modified: Zope3/branches/srichter-blow-services/src/zope/app/registration/interfaces.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/registration/interfaces.py 2005-02-05 15:22:33 UTC (rev 29056)
+++ Zope3/branches/srichter-blow-services/src/zope/app/registration/interfaces.py 2005-02-05 19:19:17 UTC (rev 29057)
@@ -15,6 +15,7 @@
$Id: interfaces.py 28654 2004-12-20 21:13:50Z gintautasm $
"""
+from zope.deprecation import deprecated
from zope.interface import Interface, implements
from zope.schema import TextLine
from zope.schema.interfaces import ITextLine
@@ -24,13 +25,28 @@
RegisteredStatus = registration.InactiveStatus
ActiveStatus = registration.ActiveStatus
+deprecated(('UnregisteredStatus', 'RegisteredStatus'),
+ 'Registered and unregistered status has have been collapsed into '
+ 'zope.app.component.interfaces.registration.InactiveStatus. '
+ 'Will be gone in X3.3.')
+deprecated('ActiveStatus',
+ 'ActiveStatus is now available in '
+ 'zope.app.component.interfaces.registration. '
+ 'Will be gone in X3.3.')
+
IRegistrationEvent = registration.IRegistrationEvent
IRegistrationActivatedEvent = registration.IRegistrationActivatedEvent
IRegistrationDeactivatedEvent = registration.IRegistrationDeactivatedEvent
+deprecated(('IRegistrationEvent',
+ 'IRegistrationActivatedEvent', 'IRegistrationDeactivatedEvent'),
+ 'The registration events have moved to '
+ 'zope.app.component.interfaces.registration. '
+ 'Will be gone in X3.3.')
+
+
class INoLocalServiceError(Interface):
- """No local service to register with.
- """
+ """No local service to register with."""
class NoLocalServiceError(Exception):
"""No local service to configure
@@ -38,11 +54,20 @@
An attempt was made to register a registration for which there is
no local service.
"""
-
implements(INoLocalServiceError)
+deprecated(('INoLocalServiceError', 'NoLocalServiceError'),
+ 'The concept of services has been removed. This event will '
+ 'be gone in X3.3.')
+
IRegistration = registration.IRegistration
+deprecated(('IRegistrationEvent',
+ 'IRegistrationActivatedEvent', 'IRegistrationDeactivatedEvent'),
+ 'The registration events have moved to '
+ 'zope.app.component.interfaces.registration. '
+ 'Will be gone in X3.3.')
+
class IComponentPath(ITextLine):
"""A component path
@@ -58,12 +83,31 @@
"""
implements(IComponentPath)
+deprecated(('IComponentPath', 'ComponentPath'),
+ 'Registrations now use component references instead of component '
+ 'paths. Use zope.app.component.interfaces.registration.Component '
+ 'instead. This field will be gone in X3.3.')
+
IComponentRegistration = registration.IComponentRegistration
+deprecated('IComponentRegistration',
+ 'The IComponentRegistration interface has moved to '
+ 'zope.app.component.interfaces.registration. '
+ 'This reference will be gone in X3.3.')
+
from zope.app.component.bbb.interfaces import IRegistrationStack
+deprecated('IRegistrationStack',
+ 'The registration stack concept has been removed. '
+ 'This interface will be gone in X3.3.')
+
IRegistry = registration.IRegistry
+deprecated('IRegistry',
+ 'The IRegistry interface has moved to '
+ 'zope.app.component.interfaces.registration. '
+ 'This reference will be gone in X3.3.')
+
class IOrderedContainer(Interface):
"""Containers whose items can be reorderd."""
@@ -83,14 +127,30 @@
"""Move the objects corresponding to the given names down.
"""
+deprecated('IOrderedContainer',
+ 'The ordered container should have not been declared here. The '
+ 'registerable container does not support this interface anymore, '
+ 'since it was useless anyways. '
+ 'This interface will be gone in X3.3.')
+
IRegistrationManager = registration.IRegistrationManager
IRegisterableContainer = registration.IRegisterableContainer
IRegisterable = registration.IRegisterable
-
IRegistered = registration.IRegistered
+deprecated(('IRegistrationManager', 'IRegisterableContainer',
+ 'IRegisterable', 'IRegistered'),
+ 'This interface has moved to '
+ 'zope.app.component.interfaces.registration. '
+ 'This reference will be gone in X3.3.')
+
IAttributeRegisterable = IRegisterable
+deprecated('IAttributeRegisterable',
+ 'Registrations are not stored on the component anymore and thus '
+ 'the attribute registerable is now simply a registerable. '
+ 'This reference will be gone in X3.3.')
+
class INoRegistrationManagerError(Interface):
"""No registration manager error
"""
@@ -105,3 +165,7 @@
"""
implements(INoRegistrationManagerError)
+deprecated(('INoRegistrationManagerError', 'NoRegistrationManagerError'),
+ 'It is now guaranteed that a registerable container has a '
+ 'registration manager; thus this error is never raised. '
+ 'This event will be gone in X3.3.')
Modified: Zope3/branches/srichter-blow-services/src/zope/app/registration/registration.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/registration/registration.py 2005-02-05 15:22:33 UTC (rev 29056)
+++ Zope3/branches/srichter-blow-services/src/zope/app/registration/registration.py 2005-02-05 19:19:17 UTC (rev 29057)
@@ -15,6 +15,7 @@
$Id: registration.py 28601 2004-12-09 19:20:03Z srichter $
"""
+from zope.deprecation import deprecated
from zope.app.component import registration
@@ -22,11 +23,25 @@
RegistrationActivatedEvent = registration.RegistrationActivatedEvent
RegistrationDeactivatedEvent = registration.RegistrationDeactivatedEvent
+deprecated(('RegistrationEvent',
+ 'RegistrationActivatedEvent', 'RegistrationDeactivatedEvent'),
+ 'The registration events have moved to '
+ 'zope.app.component.registration. '
+ 'Will be gone in X3.3.')
+
RegistrationStatusPropery = registration.RegistrationStatusProperty
+deprecated('RegistrationStatusProperty',
+ 'The status property has moved to zope.app.component.registration. '
+ 'Will be gone in X3.3.')
+
from zope.app.component.bbb.registration import RegistrationStack
NotifyingRegistrationStack = RegistrationStack
+deprecated(('RegistrationStack', 'NotifyingRegistrationStack'),
+ 'The registration stack concept has been removed. '
+ 'This class will be gone in X3.3.')
+
SimpleRegistrationRemoveSubscriber = \
registration.SimpleRegistrationRemoveSubscriber
SimpleRegistration = registration.SimpleRegistration
@@ -43,3 +58,10 @@
RegistrationManager = registration.RegistrationManager
RegisterableContainer = registration.RegisterableContainer
+
+deprecated(('ComponentRegistration', 'ComponentRegistrationAddSubscriber',
+ 'ComponentRegistrationRemoveSubscriber',
+ 'RegisterableMoveSubscriber', 'Registered',
+ 'RegistrationManager', 'RegisterableContainer'),
+ 'This class has moved to zope.app.component.registration. '
+ 'The reference will be gone in X3.3.')
Modified: Zope3/branches/srichter-blow-services/src/zope/app/site/folder.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/site/folder.py 2005-02-05 15:22:33 UTC (rev 29056)
+++ Zope3/branches/srichter-blow-services/src/zope/app/site/folder.py 2005-02-05 19:19:17 UTC (rev 29057)
@@ -15,12 +15,20 @@
$Id: folder.py 25177 2004-06-02 13:17:31Z jim $
"""
+from zope.deprecation import deprecated
from zope.app.container.btree import BTreeContainer
from zope.app.component.site import SiteManagementFolder
from zope.app.component.site import SMFolderFactory
+deprecated(('SiteManagementFolder', 'SMFolderFactory'),
+ 'This class has moved to zope.app.component.site. '
+ 'The reference will be gone in X3.3.')
+
# I really hope that noone is using this.
class SiteManagementFolders(BTreeContainer):
pass
+deprecated('SiteManagementFolders',
+ 'This class has been deprecated. It was not used anyways. '
+ 'The reference will be gone in X3.3.')
Modified: Zope3/branches/srichter-blow-services/src/zope/app/site/interfaces.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/site/interfaces.py 2005-02-05 15:22:33 UTC (rev 29056)
+++ Zope3/branches/srichter-blow-services/src/zope/app/site/interfaces.py 2005-02-05 19:19:17 UTC (rev 29057)
@@ -15,6 +15,7 @@
$Id: interfaces.py 27514 2004-09-13 15:54:05Z fdrake $
"""
+from zope.deprecation import deprecated
from zope.interface import Interface
from zope.app.component.interfaces import registration
from zope.app.container.interfaces import IContainer
@@ -23,8 +24,17 @@
from zope.app.component.interfaces import ILocalSiteManager
from zope.app.component.interfaces import ISiteManagementFolder
+deprecated(('IPossibleSite', 'ISite'),
+ 'This interface has been moved to zope.app.component.interfaces. '
+ 'The reference will be gone in X3.3.')
+
ISiteManager = ILocalSiteManager
+deprecated('ISiteManager',
+ 'This interface has been moved to zope.app.component.interfaces '
+ 'and been renamed ISiteManager. '
+ 'The reference will be gone in X3.3.')
+
class ILocalService(registration.IRegisterable):
"""A local service isn't a local service if it doesn't implement this.
@@ -33,6 +43,7 @@
IRegisterable (which implies that it is adaptable to
IRegistered). Implementing ILocalService implies this.
"""
+
class ISimpleService(ILocalService):
"""Most local services should implement this instead of ILocalService.
@@ -40,6 +51,10 @@
by subclassing IAttributeRegisterable.
"""
+deprecated(('ILocalService', 'ISimpleService'),
+ 'The concept of services has been removed. Use utilities instead. '
+ 'The reference will be gone in X3.3.')
+
class IComponentManager(Interface):
def queryComponent(type=None, filter=None, all=0):
@@ -56,6 +71,10 @@
"""
+deprecated('IComponentManager',
+ 'This interface has been removed. It was horrible anyways. '
+ 'The reference will be gone in X3.3.')
+
class IBindingAware(Interface):
def bound(name):
@@ -72,6 +91,10 @@
this object from performing the named service.
"""
+deprecated('IBindingAware',
+ 'Now that services are gone, we do not need the binding support. '
+ 'The reference will be gone in X3.3.')
+
class ISiteManagementFolders(IContainer, IComponentManager):
"""A collection of ISiteManagementFolder objects.
@@ -79,3 +102,7 @@
well as package query and lookup.
"""
+
+deprecated('ISiteManagementFolders',
+ 'This interface has been removed. It was unused. '
+ 'The reference will be gone in X3.3.')
Modified: Zope3/branches/srichter-blow-services/src/zope/app/site/metaconfigure.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/site/metaconfigure.py 2005-02-05 15:22:33 UTC (rev 29056)
+++ Zope3/branches/srichter-blow-services/src/zope/app/site/metaconfigure.py 2005-02-05 19:19:17 UTC (rev 29057)
@@ -16,6 +16,7 @@
$Id$
"""
__docformat__ = "reStructuredText"
+from zope.deprecation import deprecated
from zope.interface import classImplements
from zope.app.component.contentdirective import ContentDirective
@@ -28,3 +29,7 @@
if not ISimpleService.implementedBy(class_):
classImplements(class_, ISimpleService)
super(LocalServiceDirective, self).__init__(_context, class_)
+
+deprecated('LocalServiceDirective',
+ 'The concept of services has been removed. Use utilities instead. '
+ 'The reference will be gone in X3.3.')
Modified: Zope3/branches/srichter-blow-services/src/zope/app/site/service.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/site/service.py 2005-02-05 15:22:33 UTC (rev 29056)
+++ Zope3/branches/srichter-blow-services/src/zope/app/site/service.py 2005-02-05 19:19:17 UTC (rev 29057)
@@ -16,11 +16,25 @@
$Id$
"""
__docformat__ = "reStructuredText"
+from zope.deprecation import deprecated
from zope.app.component.site import SiteManager, UtilityRegistration
from zope.app.component.interfaces.registration import \
IRegisterableContainerContaining as IRegisterableContainerContainer
+deprecated(('SiteManager', 'UtilityRegistration'),
+ 'This class has been moved to zope.app.component.site. '
+ 'The reference will be gone in X3.3.')
+
+deprecated('IRegisterableContainerContainer',
+ 'This interface has been moved to zope.app.component.interfaces '
+ 'and been renamed to IRegisterableContainerContaining. '
+ 'The reference will be gone in X3.3.')
+
ServiceManager = SiteManager
ServiceRegistration = UtilityRegistration
+
+deprecated(('ServiceManager', 'ServiceRegistration'),
+ 'The concept of services has been removed. Use utilities instead. '
+ 'The reference will be gone in X3.3.')
Modified: Zope3/branches/srichter-blow-services/src/zope/app/site/servicecontainer.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/site/servicecontainer.py 2005-02-05 15:22:33 UTC (rev 29056)
+++ Zope3/branches/srichter-blow-services/src/zope/app/site/servicecontainer.py 2005-02-05 19:19:17 UTC (rev 29057)
@@ -16,7 +16,13 @@
$Id$
"""
__docformat__ = "reStructuredText"
+from zope.deprecation import deprecated
from zope.app.component.site import SiteManagerContainer
ServiceManagerContainer = SiteManagerContainer
+
+deprecated('ServiceManagerContainer',
+ 'This class has been moved to zope.app.component.site '
+ 'and been renamed to SiteManagerContainer. '
+ 'The reference will be gone in X3.3.')
Added: Zope3/branches/srichter-blow-services/src/zope/app/utility/__init__.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/utility/__init__.py 2005-02-05 15:22:33 UTC (rev 29056)
+++ Zope3/branches/srichter-blow-services/src/zope/app/utility/__init__.py 2005-02-05 19:19:17 UTC (rev 29057)
@@ -0,0 +1,18 @@
+##############################################################################
+# Copyright (c) 2003 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+##############################################################################
+"""Local utility service implementation.
+
+$Id: __init__.py 25177 2004-06-02 13:17:31Z jim $
+"""
+
+from utility import UtilityRegistration, LocalUtilityService
+
Added: Zope3/branches/srichter-blow-services/src/zope/app/utility/interfaces.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/utility/interfaces.py 2005-02-05 15:22:33 UTC (rev 29056)
+++ Zope3/branches/srichter-blow-services/src/zope/app/utility/interfaces.py 2005-02-05 19:19:17 UTC (rev 29057)
@@ -0,0 +1,36 @@
+##############################################################################
+#
+# Copyright (c) 2003 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Interfaces pertaining to local utilities.
+
+$Id: interfaces.py 28582 2004-12-08 00:46:02Z srichter $
+"""
+import zope.component.interfaces
+from zope.deprecation import deprecated
+
+from zope.app.component.interfaces import IUtilityRegistration, ILocalUtility
+from zope.app.component.interfaces.registration import IRegistry
+
+deprecated(('IUtilityRegistration', 'ILocalUtility'),
+ 'This interface has been moved to zope.app.component.site. '
+ 'The reference will be gone in X3.3.')
+
+class ILocalUtilityService(
+ zope.component.interfaces.IUtilityService,
+ IRegistry,
+ ):
+ """Local Utility Service."""
+
+deprecated('ILocalUtilityService',
+ 'The concept of services has been removed. Use site manager API. '
+ 'The reference will be gone in X3.3.')
Added: Zope3/branches/srichter-blow-services/src/zope/app/utility/utility.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/utility/utility.py 2005-02-05 15:22:33 UTC (rev 29056)
+++ Zope3/branches/srichter-blow-services/src/zope/app/utility/utility.py 2005-02-05 19:19:17 UTC (rev 29057)
@@ -0,0 +1,39 @@
+##############################################################################
+# Copyright (c) 2003 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+##############################################################################
+"""Local utility service implementation.
+
+Besides being functional, this module also serves as an example of
+creating a local service; see README.txt.
+
+$Id: utility.py 28662 2004-12-21 03:29:21Z srichter $
+"""
+from zope.deprecation import deprecated
+
+from zope.app.component import getNextUtility, queryNextUtility
+from zope.app.component.testing import testingNextUtility
+
+deprecated(('getNextUtility', 'queryNextUtility'),
+ 'This function has been moved to zope.app.component. '
+ 'The reference will be gone in X3.3.')
+
+deprecated('testingNextUtility',
+ 'This function has been moved to zope.app.component.testing. '
+ 'The reference will be gone in X3.3.')
+
+
+class LocalUtilityService(object):
+ # I really hope noone noone is using this class manually!
+ pass
+
+deprecated('LocalUtilityService',
+ 'Services have been removed. Use site manager API. '
+ 'The reference will be gone in X3.3.')
Added: Zope3/branches/srichter-blow-services/src/zope/app/utility/vocabulary.py
===================================================================
--- Zope3/branches/srichter-blow-services/src/zope/app/utility/vocabulary.py 2005-02-05 15:22:33 UTC (rev 29056)
+++ Zope3/branches/srichter-blow-services/src/zope/app/utility/vocabulary.py 2005-02-05 19:19:17 UTC (rev 29057)
@@ -0,0 +1,28 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Utility Vocabulary.
+
+This vocabulary provides terms for all utilities providing a given interface.
+
+$Id: vocabulary.py 28582 2004-12-08 00:46:02Z srichter $
+"""
+from zope.deprecation import deprecated
+
+from zope.app.component.vocabulary import *
+
+deprecated(('UtilityTerm', 'UtilityVocabulary', 'UtilityNameTerm',
+ 'UtilityComponentInterfacesVocabulary', 'UtilityNames'),
+ 'This class has been moved to zope.app.component.vocabulary. '
+ 'The reference will be gone in X3.3.')
+
More information about the Zope3-Checkins
mailing list