[Checkins] SVN: zope.location/branches/optional-zope.copy/ - New feature release: deprecated locationCopy, CopyPersistent and

Fabio Tranchitella kobold at kobold.it
Sat Aug 22 16:17:09 EDT 2009


Log message for revision 103092:
  - New feature release: deprecated locationCopy, CopyPersistent and
    PathPersistent from zope.location.pickling. These changes were already part
    of the 3.5.3 release, which was erroneously numbered as a bugfix relese.
  
  - Removed dependency on zope.deferredimport, directly import deprecated modules
    without using it.
  
  - Removed dependency on zope.copy: the adapter registration for
    zope.location.pickling.LocationCopyHook is conditional and only run if
    zope.copy is installed.
  
  

Changed:
  U   zope.location/branches/optional-zope.copy/CHANGES.txt
  U   zope.location/branches/optional-zope.copy/setup.py
  U   zope.location/branches/optional-zope.copy/src/zope/location/configure.zcml
  U   zope.location/branches/optional-zope.copy/src/zope/location/pickling.py

-=-
Modified: zope.location/branches/optional-zope.copy/CHANGES.txt
===================================================================
--- zope.location/branches/optional-zope.copy/CHANGES.txt	2009-08-22 20:16:34 UTC (rev 103091)
+++ zope.location/branches/optional-zope.copy/CHANGES.txt	2009-08-22 20:17:09 UTC (rev 103092)
@@ -2,6 +2,20 @@
 CHANGES
 =======
 
+3.6.0 (unreleased)
+------------------
+
+- New feature release: deprecated locationCopy, CopyPersistent and
+  PathPersistent from zope.location.pickling. These changes were already part
+  of the 3.5.3 release, which was erroneously numbered as a bugfix relese.
+
+- Removed dependency on zope.deferredimport, directly import deprecated modules
+  without using it.
+
+- Removed dependency on zope.copy: the adapter registration for
+  zope.location.pickling.LocationCopyHook is conditional and only run if
+  zope.copy is installed.
+
 3.5.5 (2009-08-15)
 ------------------
 

Modified: zope.location/branches/optional-zope.copy/setup.py
===================================================================
--- zope.location/branches/optional-zope.copy/setup.py	2009-08-22 20:16:34 UTC (rev 103091)
+++ zope.location/branches/optional-zope.copy/setup.py	2009-08-22 20:17:09 UTC (rev 103092)
@@ -21,7 +21,7 @@
     return text
 
 setup(name='zope.location',
-      version = '3.5.5dev',
+      version = '3.6.0',
       author='Zope Corporation and Contributors',
       author_email='zope-dev at zope.org',
       description='Zope Location',
@@ -36,7 +36,7 @@
           read('CHANGES.txt')
           ),
       license='ZPL 2.1',
-      keywords=('zope3 location strutural'),
+      keywords=('zope3 location structural'),
       classifiers = [
           'Development Status :: 5 - Production/Stable',
           'Environment :: Web Environment',
@@ -53,11 +53,9 @@
       namespace_packages=['zope',],
       install_requires=['setuptools',
                         'zope.interface',
-                        'zope.deferredimport',
                         'zope.schema>=3.5.1dev',
                         'zope.component',
                         'zope.proxy>3.3',
-                        'zope.copy',
                         ],
       include_package_data = True,
       zip_safe = False,

Modified: zope.location/branches/optional-zope.copy/src/zope/location/configure.zcml
===================================================================
--- zope.location/branches/optional-zope.copy/src/zope/location/configure.zcml	2009-08-22 20:16:34 UTC (rev 103091)
+++ zope.location/branches/optional-zope.copy/src/zope/location/configure.zcml	2009-08-22 20:17:09 UTC (rev 103092)
@@ -1,7 +1,9 @@
-<configure xmlns="http://namespaces.zope.org/zope">
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:zcml="http://namespaces.zope.org/zcml">
 
   <adapter factory=".location.LocationProxy" />
-  <adapter factory=".pickling.LocationCopyHook" />
+  <adapter zcml:condition="installed zope.copy"
+           factory=".pickling.LocationCopyHook" />
   <adapter factory=".traversing.LocationPhysicallyLocatable" />
   <adapter factory=".traversing.RootPhysicallyLocatable" />
 

Modified: zope.location/branches/optional-zope.copy/src/zope/location/pickling.py
===================================================================
--- zope.location/branches/optional-zope.copy/src/zope/location/pickling.py	2009-08-22 20:16:34 UTC (rev 103091)
+++ zope.location/branches/optional-zope.copy/src/zope/location/pickling.py	2009-08-22 20:17:09 UTC (rev 103092)
@@ -19,13 +19,13 @@
 
 from zope.component import adapts
 from zope.copy.interfaces import ICopyHook, ResumeCopy
-from zope.deferredimport import deprecated
 from zope.interface import implements
 
-import zope.location.interfaces
+from zope.location.interfaces import ILocation, IRoot, ITraverser
 from zope.location.location import inside
 from zope.location.traversing import LocationPhysicallyLocatable
 
+
 class LocationCopyHook(object):
     """Copy hook to preserve copying referenced objects that are not
     located inside object that's being copied.
@@ -62,7 +62,7 @@
     
     """
     
-    adapts(zope.location.interfaces.ILocation)
+    adapts(ILocation)
     implements(ICopyHook)
     
     def __init__(self, context):
@@ -74,18 +74,17 @@
         raise ResumeCopy
         
 # BBB 2009/02/09
-deprecated(
-    'The locationCopy was replaced by more generic "clone" function'
-    'in the zope.copy package. This reference may be removed someday.',
-    locationCopy='zope.copy:clone'
-    )
-deprecated(
-    'The CopyPersistent was made more generic and moved to the'
-    'zope.copy package. This reference may be removed someday.',
-    CopyPersistent='zope.copy:CopyPersistent',
-)
+# The locationCopy was replaced by more generic "clone" function
+# in the zope.copy package. This reference may be removed someday.
+from zope.copy import clone as locationCopy
 
-# XXX: is this actually used anywhere? (nadako, 2009/02/09)
+# BBB 2009/02/09
+# The CopyPersistent was made more generic and moved to the
+# zope.copy package. This reference may be removed someday.
+from zope.copy import CopyPersistent
+
+# BBB 2009/08/22
+# This class is not used anywhere; this reference may be removed someday.
 class PathPersistent(object):
     """Persistence hooks for pickling locations
 
@@ -124,7 +123,7 @@
     >>> from zope.location.tests import TLocation
     >>> from zope.interface import directlyProvides
     >>> root = TLocation()
-    >>> directlyProvides(root, zope.location.interfaces.IRoot)
+    >>> directlyProvides(root, IRoot)
     >>> o3 = TLocation()
     >>> o3.__name__ = 'o3'
     >>> o3.__parent__ = root
@@ -162,7 +161,7 @@
         self.location = location
 
     def id(self, object):
-        if zope.location.interfaces.ILocation.providedBy(object):
+        if ILocation.providedBy(object):
             if not inside(object, self.location):
                 return LocationPhysicallyLocatable(object).getPath()
         return None
@@ -171,4 +170,4 @@
         if not path.startswith(u'/'):
             raise ValueError("Persistent paths must be absolute", path)
         root = LocationPhysicallyLocatable(self.location).getRoot()
-        return zope.location.interfaces.ITraverser(root).traverse(path[1:])
+        return ITraverser(root).traverse(path[1:])



More information about the Checkins mailing list