[Checkins] SVN: z3c.proxy/trunk/ - Replaced ``zope.app.container`` by ``zope.container``.

Michael Howitz mh at gocept.com
Mon Aug 23 02:16:25 EDT 2010


Log message for revision 115867:
  - Replaced ``zope.app.container`` by ``zope.container``.
  
  - Using Python's ``doctest`` module instead of deprecated ``zope.testing.doctestunit``.
  

Changed:
  U   z3c.proxy/trunk/CHANGES.txt
  U   z3c.proxy/trunk/setup.py
  U   z3c.proxy/trunk/src/z3c/proxy/README.txt
  U   z3c.proxy/trunk/src/z3c/proxy/container.py
  U   z3c.proxy/trunk/src/z3c/proxy/interfaces.py
  U   z3c.proxy/trunk/src/z3c/proxy/overrides.zcml
  U   z3c.proxy/trunk/src/z3c/proxy/testing.py
  U   z3c.proxy/trunk/src/z3c/proxy/tests.py

-=-
Modified: z3c.proxy/trunk/CHANGES.txt
===================================================================
--- z3c.proxy/trunk/CHANGES.txt	2010-08-23 06:11:08 UTC (rev 115866)
+++ z3c.proxy/trunk/CHANGES.txt	2010-08-23 06:16:25 UTC (rev 115867)
@@ -2,12 +2,15 @@
 CHANGES
 =======
 
-Version 0.5.1dev (unreleased)
------------------------------
+0.5.1dev (unreleased)
+---------------------
 
-- ...
+- Replaced ``zope.app.container`` by ``zope.container``.
 
-Version 0.5.0 (2008-04-12)
---------------------------
+- Using Python's ``doctest`` module instead of deprecated
+  ``zope.testing.doctestunit``.
 
+0.5.0 (2008-04-12)
+------------------
+
 - Initial Release

Modified: z3c.proxy/trunk/setup.py
===================================================================
--- z3c.proxy/trunk/setup.py	2010-08-23 06:11:08 UTC (rev 115866)
+++ z3c.proxy/trunk/setup.py	2010-08-23 06:16:25 UTC (rev 115867)
@@ -59,11 +59,11 @@
         ),
     install_requires = [
         'setuptools',
-        'zope.app.container',
+        'zope.container',
         'zope.copypastemove',
         'zope.interface',
         'zope.location',
         'zope.proxy',
         ],
     zip_safe = False,
-)
\ No newline at end of file
+)

Modified: z3c.proxy/trunk/src/z3c/proxy/README.txt
===================================================================
--- z3c.proxy/trunk/src/z3c/proxy/README.txt	2010-08-23 06:11:08 UTC (rev 115866)
+++ z3c.proxy/trunk/src/z3c/proxy/README.txt	2010-08-23 06:16:25 UTC (rev 115867)
@@ -2,11 +2,11 @@
 README
 ======
 
-We can proxy a regular container derived from zope's btree container for 
+We can proxy a regular container derived from zope's btree container for
 example:
 
-  >>> from zope.app.container.interfaces import IContainer
-  >>> from zope.app.container.btree import BTreeContainer
+  >>> from zope.container.interfaces import IContainer
+  >>> from zope.container.btree import BTreeContainer
   >>> container = BTreeContainer()
   >>> container.__name__, container.__parent__ = u'c1', u'p1'
 
@@ -66,7 +66,7 @@
   ...
   KeyError: 'x'
 
-  >>> from zope.app.container.contained import Contained
+  >>> from zope.container.contained import Contained
   >>> proxy['x'] = x = Contained()
 
 Now we added our first item. This item should be added to the container.
@@ -168,7 +168,7 @@
   >>> iterator.next() in proxy
   True
 
-  >>> iterator.next()     
+  >>> iterator.next()
   Traceback (most recent call last):
   ...
   StopIteration
@@ -188,21 +188,21 @@
 ObjectMover
 -----------
 
-To use an object mover, pass a contained ``object`` to the class. The 
-contained ``object`` should implement ``IContained``.  It should be contained 
+To use an object mover, pass a contained ``object`` to the class. The
+contained ``object`` should implement ``IContained``.  It should be contained
 in a container that has an adapter to ``INameChooser``.
 
 Setup test container and proxies:
 
   >>> from zope.interface import implements
-  >>> from zope.app.container.interfaces import INameChooser
+  >>> from zope.container.interfaces import INameChooser
   >>> from zope.copypastemove import ExampleContainer
   >>> from z3c.proxy.container import ProxyAwareObjectMover
-  
+
   >>> class ContainerLocationProxyStub(ContainerLocationProxy):
-  ... 
+  ...
   ...     implements(INameChooser)
-  ... 
+  ...
   ...     def chooseName(self, name, ob):
   ...        while name in self:
   ...            name += '_'
@@ -217,14 +217,14 @@
   >>> ob = proxy[u'foo']
   >>> mover = ProxyAwareObjectMover(ob)
 
-In addition to moving objects, object movers can tell you if the object is 
+In addition to moving objects, object movers can tell you if the object is
 movable:
 
   >>> mover.moveable()
   1
 
-which, at least for now, they always are.  A better question to ask is whether 
-we can move to a particular container. Right now, we can always move to a 
+which, at least for now, they always are.  A better question to ask is whether
+we can move to a particular container. Right now, we can always move to a
 container of the same class:
 
   >>> proxy2 = ContainerLocationProxyStub(container2)
@@ -236,7 +236,7 @@
   ...
   TypeError: Container is not a valid Zope container.
 
-Of course, once we've decided we can move an object, we can use the mover to 
+Of course, once we've decided we can move an object, we can use the mover to
 do so:
 
   >>> mover.moveTo(proxy2)
@@ -293,17 +293,17 @@
 ObjectCopier
 ------------
 
-To use an object copier, pass a contained ``object`` to the class. The 
-contained ``object`` should implement ``IContained``.  It should be contained 
+To use an object copier, pass a contained ``object`` to the class. The
+contained ``object`` should implement ``IContained``.  It should be contained
 in a container that has an adapter to `INameChooser`.
 
 Setup test container and proxies:
 
   >>> from z3c.proxy.container import ProxyAwareObjectCopier
   >>> class ContainerLocationProxyStub(ContainerLocationProxy):
-  ... 
+  ...
   ...     implements(INameChooser)
-  ... 
+  ...
   ...     def chooseName(self, name, ob):
   ...        while name in self:
   ...            name += '_'
@@ -318,14 +318,14 @@
   >>> ob = proxy[u'foo']
   >>> copier = ProxyAwareObjectCopier(ob)
 
-In addition to moving objects, object copiers can tell you if the object is 
+In addition to moving objects, object copiers can tell you if the object is
 movable:
 
   >>> copier.copyable()
   1
 
-which, at least for now, they always are.  A better question to ask is whether 
-we can copy to a particular container. Right now, we can always copy to a 
+which, at least for now, they always are.  A better question to ask is whether
+we can copy to a particular container. Right now, we can always copy to a
 container of the same class:
 
   >>> proxy2 = ContainerLocationProxyStub(container2)
@@ -337,7 +337,7 @@
   ...
   TypeError: Container is not a valid Zope container.
 
-Of course, once we've decided we can copy an object, we can use the copier to 
+Of course, once we've decided we can copy an object, we can use the copier to
 do so:
 
   >>> copier.copyTo(proxy2)
@@ -408,31 +408,31 @@
 ProxyAwareContainerItemRenamer
 ------------------------------
 
-This adapter uses IObjectMover to move an item within the same container to 
+This adapter uses IObjectMover to move an item within the same container to
 a different name. We need to first setup an adapter for IObjectMover:
 
 Setup test container and proxies:
 
-  >>> from zope.app.container.sample import SampleContainer
+  >>> from zope.container.sample import SampleContainer
   >>> from zope.copypastemove import ContainerItemRenamer
   >>> from zope.copypastemove import IObjectMover
   >>> from z3c.proxy.container import ProxyAwareContainerItemRenamer
 
   >>> import zope.component
-  >>> from zope.app.container.interfaces import IContained
-  >>> zope.component.provideAdapter(ProxyAwareObjectMover, [IContained], 
+  >>> from zope.container.interfaces import IContained
+  >>> zope.component.provideAdapter(ProxyAwareObjectMover, [IContained],
   ...     IObjectMover)
-  
+
   >>> class ContainerLocationProxyStub(ContainerLocationProxy):
-  ... 
+  ...
   ...     implements(INameChooser)
-  ... 
+  ...
   ...     def chooseName(self, name, ob):
   ...        while name in self:
   ...            name += '_'
   ...        return name
 
-To rename an item in a container, instantiate a ContainerItemRenamer with the 
+To rename an item in a container, instantiate a ContainerItemRenamer with the
 container:
 
   >>> container = SampleContainer()

Modified: z3c.proxy/trunk/src/z3c/proxy/container.py
===================================================================
--- z3c.proxy/trunk/src/z3c/proxy/container.py	2010-08-23 06:11:08 UTC (rev 115866)
+++ z3c.proxy/trunk/src/z3c/proxy/container.py	2010-08-23 06:16:25 UTC (rev 115867)
@@ -25,7 +25,7 @@
 from zope.proxy import non_overridable
 from zope.proxy import isProxy
 
-from zope.app.container.interfaces import IContainer
+from zope.container.interfaces import IContainer
 from z3c.proxy import interfaces
 
 

Modified: z3c.proxy/trunk/src/z3c/proxy/interfaces.py
===================================================================
--- z3c.proxy/trunk/src/z3c/proxy/interfaces.py	2010-08-23 06:11:08 UTC (rev 115866)
+++ z3c.proxy/trunk/src/z3c/proxy/interfaces.py	2010-08-23 06:16:25 UTC (rev 115867)
@@ -18,9 +18,9 @@
 
 
 from zope.location.interfaces import ILocation
-from zope.app.container.interfaces import IContainer
+from zope.container.interfaces import IContainer
 
 
 
 class IContainerLocationProxy(ILocation, IContainer):
-    """Container proxy supporting a location."""
\ No newline at end of file
+    """Container proxy supporting a location."""

Modified: z3c.proxy/trunk/src/z3c/proxy/overrides.zcml
===================================================================
--- z3c.proxy/trunk/src/z3c/proxy/overrides.zcml	2010-08-23 06:11:08 UTC (rev 115866)
+++ z3c.proxy/trunk/src/z3c/proxy/overrides.zcml	2010-08-23 06:16:25 UTC (rev 115867)
@@ -1,9 +1,9 @@
-<configure 
+<configure
     xmlns="http://namespaces.zope.org/zope"
     i18n_domain="z3c">
 
   <!-- TODO: This adapter should be regsitred to the the LocationProxy class
-       and not use overrides.zcml. But this doesn't work. Find a way where we 
+       and not use overrides.zcml. But this doesn't work. Find a way where we
        can register this adapters without overrides.zcml. -->
 
   <!-- support move for LocationProxy items -->
@@ -11,7 +11,7 @@
       factory="z3c.proxy.container.ProxyAwareObjectMover"
       provides="zope.copypastemove.interfaces.IObjectMover"
       permission="zope.ManageContent"
-      for="zope.app.container.interfaces.IContained"
+      for="zope.container.interfaces.IContained"
       trusted="True"
       />
 
@@ -21,7 +21,7 @@
       factory="z3c.proxy.container.ProxyAwareObjectCopier"
       provides="zope.copypastemove.interfaces.IObjectCopier"
       permission="zope.ManageContent"
-      for="zope.app.container.interfaces.IContained"
+      for="zope.container.interfaces.IContained"
       trusted="True"
       />
 
@@ -31,7 +31,7 @@
       factory="z3c.proxy.container.ProxyAwareContainerItemRenamer"
       provides="zope.copypastemove.interfaces.IContainerItemRenamer"
       permission="zope.ManageContent"
-      for="zope.app.container.interfaces.IContainer"
+      for="zope.container.interfaces.IContainer"
       trusted="True"
       />
 

Modified: z3c.proxy/trunk/src/z3c/proxy/testing.py
===================================================================
--- z3c.proxy/trunk/src/z3c/proxy/testing.py	2010-08-23 06:11:08 UTC (rev 115866)
+++ z3c.proxy/trunk/src/z3c/proxy/testing.py	2010-08-23 06:16:25 UTC (rev 115867)
@@ -17,9 +17,9 @@
 __docformat__ = 'restructuredtext'
 
 import zope.interface
-from zope.app.container.interfaces import IContainer
-from zope.app.container.tests.test_icontainer import BaseTestIContainer as BT
-from zope.app.container.tests.test_icontainer import DefaultTestData
+from zope.container.interfaces import IContainer
+from zope.container.tests.test_icontainer import BaseTestIContainer as BT
+from zope.container.tests.test_icontainer import DefaultTestData
 
 from z3c.testing.app import InterfaceBaseTest
 from z3c.proxy import interfaces

Modified: z3c.proxy/trunk/src/z3c/proxy/tests.py
===================================================================
--- z3c.proxy/trunk/src/z3c/proxy/tests.py	2010-08-23 06:11:08 UTC (rev 115866)
+++ z3c.proxy/trunk/src/z3c/proxy/tests.py	2010-08-23 06:16:25 UTC (rev 115867)
@@ -16,16 +16,14 @@
 """
 __docformat__ = 'restructuredtext'
 
-import unittest
-from zope.testing.doctestunit import DocTestSuite
-from zope.testing.doctestunit import DocFileSuite
-from zope.app.container.sample import SampleContainer
+from z3c.proxy import testing
 from zope.app.testing.placelesssetup import setUp
 from zope.app.testing.placelesssetup import tearDown
+from zope.container.sample import SampleContainer
+import doctest
+import unittest
 
-from z3c.proxy import testing
 
-
 class SampleContainerTest(testing.BaseTestIContainerLocationProxy):
     """Base container test sample."""
 
@@ -33,7 +31,7 @@
         return testing.ISampleContainerProxy
 
     def getTestClass(self):
-        return testing.SampleContainerProxy 
+        return testing.SampleContainerProxy
 
     def makeTestObject(self):
         obj = SampleContainer()
@@ -42,7 +40,7 @@
 
 def test_suite():
     return unittest.TestSuite((
-        DocFileSuite('README.txt',
+        doctest.DocFileSuite('README.txt',
                      setUp=setUp, tearDown=tearDown),
         unittest.makeSuite(SampleContainerTest),
         ))



More information about the checkins mailing list