[Zope-Checkins] SVN: Zope/trunk/ forward port r109929: fix for lp #534653

2010-03-12 Thread Leonardo Rochael Almeida
Log message for revision 109931:
  forward port r109929: fix for lp #534653

Changed:
  _U  Zope/trunk/
  U   
Zope/trunk/src/Products/StandardCacheManagers/AcceleratedHTTPCacheManager.py
  U   Zope/trunk/src/Products/StandardCacheManagers/RAMCacheManager.py
  A   Zope/trunk/src/Products/StandardCacheManagers/configure.zcml
  A   Zope/trunk/src/Products/StandardCacheManagers/subscribers.py
  A   
Zope/trunk/src/Products/StandardCacheManagers/tests/test_CacheManagerLocation.py

-=-

Property changes on: Zope/trunk
___
Added: svn:mergeinfo
   + /Zope/branches/2.12:109929

Modified: 
Zope/trunk/src/Products/StandardCacheManagers/AcceleratedHTTPCacheManager.py
===
--- 
Zope/trunk/src/Products/StandardCacheManagers/AcceleratedHTTPCacheManager.py
2010-03-12 16:22:28 UTC (rev 109930)
+++ 
Zope/trunk/src/Products/StandardCacheManagers/AcceleratedHTTPCacheManager.py
2010-03-12 16:28:15 UTC (rev 109931)
@@ -166,12 +166,16 @@
 self._settings = {'anonymous_only':1,
   'interval':3600,
   'notify_urls':()}
-self.__cacheid = '%s_%f' % (id(self), time.time())
+self._resetCacheId()
 
 def getId(self):
 ' '
 return self.id
 
+security.declarePrivate('_resetCacheId')
+def _resetCacheId(self):
+self.__cacheid = '%s_%f' % (id(self), time.time())
+
 security.declarePrivate('ZCacheManager_getCache')
 def ZCacheManager_getCache(self):
 cacheid = self.__cacheid

Modified: Zope/trunk/src/Products/StandardCacheManagers/RAMCacheManager.py
===
--- Zope/trunk/src/Products/StandardCacheManagers/RAMCacheManager.py
2010-03-12 16:22:28 UTC (rev 109930)
+++ Zope/trunk/src/Products/StandardCacheManagers/RAMCacheManager.py
2010-03-12 16:28:15 UTC (rev 109931)
@@ -374,12 +374,16 @@
 'request_vars': ('AUTHENTICATED_USER',),
 'max_age': 3600,
 }
-self.__cacheid = '%s_%f' % (id(self), time.time())
+self._resetCacheId()
 
 def getId(self):
 ' '
 return self.id
 
+security.declarePrivate('_resetCacheId')
+def _resetCacheId(self):
+self.__cacheid = '%s_%f' % (id(self), time.time())
+
 ZCacheManager_getCache__roles__ = ()
 def ZCacheManager_getCache(self):
 cacheid = self.__cacheid

Copied: Zope/trunk/src/Products/StandardCacheManagers/configure.zcml (from rev 
109929, Zope/branches/2.12/src/Products/StandardCacheManagers/configure.zcml)
===
--- Zope/trunk/src/Products/StandardCacheManagers/configure.zcml
(rev 0)
+++ Zope/trunk/src/Products/StandardCacheManagers/configure.zcml
2010-03-12 16:28:15 UTC (rev 109931)
@@ -0,0 +1,13 @@
+http://namespaces.zope.org/zope";>
+
+  
+
+  
+
+

Copied: Zope/trunk/src/Products/StandardCacheManagers/subscribers.py (from rev 
109929, Zope/branches/2.12/src/Products/StandardCacheManagers/subscribers.py)
===
--- Zope/trunk/src/Products/StandardCacheManagers/subscribers.py
(rev 0)
+++ Zope/trunk/src/Products/StandardCacheManagers/subscribers.py
2010-03-12 16:28:15 UTC (rev 109931)
@@ -0,0 +1,24 @@
+##
+#
+# Copyright (c) 2010 Zope Foundation 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.
+#
+##
+""" subscribers to events affecting StandardCacheManagers
+"""
+
+
+def cloned(obj, event):
+"""
+Reset the Id of the module level cache so the clone gets a different cache
+than its source object
+""" 
+obj._resetCacheId()
+

Copied: 
Zope/trunk/src/Products/StandardCacheManagers/tests/test_CacheManagerLocation.py
 (from rev 109929, 
Zope/branches/2.12/src/Products/StandardCacheManagers/tests/test_CacheManagerLocation.py)
===
--- 
Zope/trunk/src/Products/StandardCacheManagers/tests/test_CacheManagerLocation.py
(rev 0)
+++ 
Zope/trunk/src/Products/StandardCacheManagers/tests/test_CacheManagerLocation.py
2010-03-12 16:28:15 UTC (rev 109931)
@@ -0,0 +1,133 @@
+#

[Zope-Checkins] SVN: Zope/branches/2.12/src/Products/StandardCacheManagers/ fix lp #534653, reset *CacheManager module level cache id on clone

2010-03-12 Thread Leonardo Rochael Almeida
Log message for revision 109929:
  fix lp #534653, reset *CacheManager module level cache id on clone

Changed:
  U   
Zope/branches/2.12/src/Products/StandardCacheManagers/AcceleratedHTTPCacheManager.py
  U   Zope/branches/2.12/src/Products/StandardCacheManagers/RAMCacheManager.py
  A   Zope/branches/2.12/src/Products/StandardCacheManagers/configure.zcml
  A   Zope/branches/2.12/src/Products/StandardCacheManagers/subscribers.py
  A   
Zope/branches/2.12/src/Products/StandardCacheManagers/tests/test_CacheManagerLocation.py

-=-
Modified: 
Zope/branches/2.12/src/Products/StandardCacheManagers/AcceleratedHTTPCacheManager.py
===
--- 
Zope/branches/2.12/src/Products/StandardCacheManagers/AcceleratedHTTPCacheManager.py
2010-03-12 15:37:56 UTC (rev 109928)
+++ 
Zope/branches/2.12/src/Products/StandardCacheManagers/AcceleratedHTTPCacheManager.py
2010-03-12 16:07:59 UTC (rev 109929)
@@ -166,12 +166,16 @@
 self._settings = {'anonymous_only':1,
   'interval':3600,
   'notify_urls':()}
-self.__cacheid = '%s_%f' % (id(self), time.time())
+self._resetCacheId()
 
 def getId(self):
 ' '
 return self.id
 
+security.declarePrivate('_resetCacheId')
+def _resetCacheId(self):
+self.__cacheid = '%s_%f' % (id(self), time.time())
+
 security.declarePrivate('ZCacheManager_getCache')
 def ZCacheManager_getCache(self):
 cacheid = self.__cacheid

Modified: 
Zope/branches/2.12/src/Products/StandardCacheManagers/RAMCacheManager.py
===
--- Zope/branches/2.12/src/Products/StandardCacheManagers/RAMCacheManager.py
2010-03-12 15:37:56 UTC (rev 109928)
+++ Zope/branches/2.12/src/Products/StandardCacheManagers/RAMCacheManager.py
2010-03-12 16:07:59 UTC (rev 109929)
@@ -374,12 +374,16 @@
 'request_vars': ('AUTHENTICATED_USER',),
 'max_age': 3600,
 }
-self.__cacheid = '%s_%f' % (id(self), time.time())
+self._resetCacheId()
 
 def getId(self):
 ' '
 return self.id
 
+security.declarePrivate('_resetCacheId')
+def _resetCacheId(self):
+self.__cacheid = '%s_%f' % (id(self), time.time())
+
 ZCacheManager_getCache__roles__ = ()
 def ZCacheManager_getCache(self):
 cacheid = self.__cacheid

Added: Zope/branches/2.12/src/Products/StandardCacheManagers/configure.zcml
===
--- Zope/branches/2.12/src/Products/StandardCacheManagers/configure.zcml
(rev 0)
+++ Zope/branches/2.12/src/Products/StandardCacheManagers/configure.zcml
2010-03-12 16:07:59 UTC (rev 109929)
@@ -0,0 +1,13 @@
+http://namespaces.zope.org/zope";>
+
+  
+
+  
+
+

Added: Zope/branches/2.12/src/Products/StandardCacheManagers/subscribers.py
===
--- Zope/branches/2.12/src/Products/StandardCacheManagers/subscribers.py
(rev 0)
+++ Zope/branches/2.12/src/Products/StandardCacheManagers/subscribers.py
2010-03-12 16:07:59 UTC (rev 109929)
@@ -0,0 +1,24 @@
+##
+#
+# Copyright (c) 2010 Zope Foundation 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.
+#
+##
+""" subscribers to events affecting StandardCacheManagers
+"""
+
+
+def cloned(obj, event):
+"""
+Reset the Id of the module level cache so the clone gets a different cache
+than its source object
+""" 
+obj._resetCacheId()
+

Added: 
Zope/branches/2.12/src/Products/StandardCacheManagers/tests/test_CacheManagerLocation.py
===
--- 
Zope/branches/2.12/src/Products/StandardCacheManagers/tests/test_CacheManagerLocation.py
(rev 0)
+++ 
Zope/branches/2.12/src/Products/StandardCacheManagers/tests/test_CacheManagerLocation.py
2010-03-12 16:07:59 UTC (rev 109929)
@@ -0,0 +1,133 @@
+##
+#
+# Copyright (c) 2010 Zope Foundation 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" A