[Checkins] SVN: zope.container/trunk/ Break testing dependency on zope.app.dependable by moving the code and tests into that package.
Hanno Schlichting
hannosch at hannosch.eu
Tue Dec 15 16:24:08 EST 2009
Log message for revision 106582:
Break testing dependency on zope.app.dependable by moving the code and tests into that package.
Changed:
U zope.container/trunk/CHANGES.txt
U zope.container/trunk/setup.py
U zope.container/trunk/src/zope/container/configure.zcml
U zope.container/trunk/src/zope/container/dependency.py
D zope.container/trunk/src/zope/container/tests/test_dependency.py
-=-
Modified: zope.container/trunk/CHANGES.txt
===================================================================
--- zope.container/trunk/CHANGES.txt 2009-12-15 21:21:06 UTC (rev 106581)
+++ zope.container/trunk/CHANGES.txt 2009-12-15 21:24:07 UTC (rev 106582)
@@ -2,9 +2,12 @@
CHANGES
=======
-3.9.2 (Unreleased)
-------------------
+3.10.0 (Unreleased)
+-------------------
+- Break testing dependency on zope.app.dependable by moving the code and tests
+ into that package.
+
- Import ISite from zope.component after it was moved there from
zope.location.
Modified: zope.container/trunk/setup.py
===================================================================
--- zope.container/trunk/setup.py 2009-12-15 21:21:06 UTC (rev 106581)
+++ zope.container/trunk/setup.py 2009-12-15 21:24:07 UTC (rev 106582)
@@ -27,7 +27,7 @@
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
setup(name='zope.container',
- version = '3.9.2dev',
+ version = '3.10.0dev',
author='Zope Corporation and Contributors',
author_email='zope-dev at zope.org',
description='Zope Container',
@@ -40,7 +40,7 @@
+ '\n\n' +
read('CHANGES.txt')
),
- keywords = "zope3 container",
+ keywords = "zope container",
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
@@ -65,8 +65,6 @@
extras_require=dict(
test=['zope.copypastemove',
'zope.app.testing',
- 'zope.app.component',
- 'zope.app.dependable',
]),
install_requires=['setuptools',
'zope.interface',
Modified: zope.container/trunk/src/zope/container/configure.zcml
===================================================================
--- zope.container/trunk/src/zope/container/configure.zcml 2009-12-15 21:21:06 UTC (rev 106581)
+++ zope.container/trunk/src/zope/container/configure.zcml 2009-12-15 21:24:07 UTC (rev 106582)
@@ -57,13 +57,6 @@
/>
<subscriber
- zcml:condition="installed zope.app.dependable"
- handler=".dependency.CheckDependency"
- for="zope.lifecycleevent.interfaces.IObjectRemovedEvent"
- trusted="y"
- />
-
- <subscriber
for="zope.location.interfaces.ILocation
zope.lifecycleevent.interfaces.IObjectMovedEvent"
handler=".contained.dispatchToSublocations"
Modified: zope.container/trunk/src/zope/container/dependency.py
===================================================================
--- zope.container/trunk/src/zope/container/dependency.py 2009-12-15 21:21:06 UTC (rev 106581)
+++ zope.container/trunk/src/zope/container/dependency.py 2009-12-15 21:24:07 UTC (rev 106582)
@@ -12,35 +12,6 @@
#
##############################################################################
-"""Subscriber function checking dependencies if a removal is performed
-on an object having dependencies. It raises an exception if it's the
-case.
-
-$Id$
-"""
-__docformat__ = 'restructuredtext'
-
-from zope.i18nmessageid import Message
-from zope.container.i18n import ZopeMessageFactory as _
-from zope.app.dependable.interfaces import IDependable, DependencyError
-from zope.location.interfaces import ILocationInfo
-
-exception_msg = _("""
-Removal of object (${object}) which has dependents (${dependents})
-is not possible !
-
-You must deactivate this object before trying to remove it.
-""")
-
-def CheckDependency(event):
- object = event.object
- dependency = IDependable(object, None)
- if dependency is not None:
- dependents = dependency.dependents()
- if dependents:
- mapping = {
- "object": ILocationInfo(object).getPath(),
- "dependents": ", ".join(dependents)
- }
- raise DependencyError(Message(exception_msg, mapping=mapping))
-
+# BBB imports
+from zope.app.dependable.dependency import exception_msg
+from zope.app.dependable.dependency import CheckDependency
Deleted: zope.container/trunk/src/zope/container/tests/test_dependency.py
===================================================================
--- zope.container/trunk/src/zope/container/tests/test_dependency.py 2009-12-15 21:21:06 UTC (rev 106581)
+++ zope.container/trunk/src/zope/container/tests/test_dependency.py 2009-12-15 21:24:07 UTC (rev 106582)
@@ -1,52 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2008 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.
-#
-##############################################################################
-"""Test the CheckDependency event subscriber.
-
-$Id$
-"""
-import unittest
-
-from zope.interface import implements
-from zope.app.dependable.interfaces import IDependable, DependencyError
-from zope.lifecycleevent import ObjectRemovedEvent
-from zope.container.dependency import CheckDependency
-from zope.traversing.interfaces import IPhysicallyLocatable
-
-class DummyObject(object):
-
- implements(IDependable, IPhysicallyLocatable)
-
- def dependents(self):
- return ['dependency1', 'dependency2']
-
- def getPath(self):
- return '/dummy-object'
-
-
-class Test(unittest.TestCase):
-
- def testCheckDependency(self):
- obj = DummyObject()
- parent = object()
- event = ObjectRemovedEvent(obj, parent, 'oldName')
- self.assertRaises(DependencyError, CheckDependency, event)
-
-
-def test_suite():
- return unittest.TestSuite((
- unittest.makeSuite(Test),
- ))
-
-if __name__=='__main__':
- unittest.main()
More information about the checkins
mailing list