[CMF-checkins] SVN: CMF/branches/1.6/ Avoid deprecation warnings
with Zope 2.10.
Florent Guillaume
fg at nuxeo.com
Fri Jun 9 09:40:33 EDT 2006
Log message for revision 68537:
Avoid deprecation warnings with Zope 2.10.
Changed:
U CMF/branches/1.6/CMFCore/FSFile.py
U CMF/branches/1.6/DCWorkflow/Expression.py
-=-
Modified: CMF/branches/1.6/CMFCore/FSFile.py
===================================================================
--- CMF/branches/1.6/CMFCore/FSFile.py 2006-06-09 12:41:27 UTC (rev 68536)
+++ CMF/branches/1.6/CMFCore/FSFile.py 2006-06-09 13:40:32 UTC (rev 68537)
@@ -22,9 +22,14 @@
from OFS.Cache import Cacheable
from OFS.Image import File
try:
- from zope.app.content_types import guess_content_type
-except ImportError: # BBB: for Zope < 2.9
- from OFS.content_types import guess_content_type
+ from zope.contenttype import guess_content_type
+except ImportError:
+ # BBB: for Zope < 2.10
+ try:
+ from zope.app.content_types import guess_content_type
+ except ImportError:
+ # BBB: for Zope < 2.9
+ from OFS.content_types import guess_content_type
from DirectoryView import registerFileExtension
from DirectoryView import registerMetaType
Modified: CMF/branches/1.6/DCWorkflow/Expression.py
===================================================================
--- CMF/branches/1.6/DCWorkflow/Expression.py 2006-06-09 12:41:27 UTC (rev 68536)
+++ CMF/branches/1.6/DCWorkflow/Expression.py 2006-06-09 13:40:32 UTC (rev 68537)
@@ -24,9 +24,26 @@
from Products.CMFCore.WorkflowCore import ObjectDeleted, ObjectMoved
from Products.CMFCore.Expression import Expression
from Products.PageTemplates.Expressions import getEngine
-from Products.PageTemplates.TALES import SafeMapping
from Products.PageTemplates.Expressions import SecureModuleImporter
+
+# We don't import SafeMapping from Products.PageTemplates.TALES
+# because it's deprecated in Zope 2.10
+from MultiMapping import MultiMapping
+class SafeMapping(MultiMapping):
+ """Mapping with security declarations and limited method exposure.
+
+ Since it subclasses MultiMapping, this class can be used to wrap
+ one or more mapping objects. Restricted Python code will not be
+ able to mutate the SafeMapping or the wrapped mappings, but will be
+ able to read any value.
+ """
+ __allow_access_to_unprotected_subobjects__ = 1
+ push = pop = None
+ _push = MultiMapping.push
+ _pop = MultiMapping.pop
+
+
class StateChangeInfo:
'''
Provides information for expressions and scripts.
More information about the CMF-checkins
mailing list