[Zope3-checkins] SVN: Zope3/trunk/src/RestrictedPython/SafeMapping.py Deleted an unused module.

Shane Hathaway shane at zope.com
Mon Nov 22 14:48:21 EST 2004


Log message for revision 28490:
  Deleted an unused module.
  
  No Zope 3 code uses SafeMapping, and SafeMapping depends on a Python 
  extension module (MultiMapping) not present in Zope 3.  In fact, if you 
  import SafeMapping using the API documentation browser, and you happen
  to have ZODB 3.2 installed, Python crashes with a fatal error related in 
  some way to ExtensionClass.
  
  

Changed:
  D   Zope3/trunk/src/RestrictedPython/SafeMapping.py

-=-
Deleted: Zope3/trunk/src/RestrictedPython/SafeMapping.py
===================================================================
--- Zope3/trunk/src/RestrictedPython/SafeMapping.py	2004-11-22 16:38:56 UTC (rev 28489)
+++ Zope3/trunk/src/RestrictedPython/SafeMapping.py	2004-11-22 19:48:21 UTC (rev 28490)
@@ -1,44 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.0 (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
-#
-##############################################################################
-__doc__='''Read-only Mapping class based on MultiMapping
-
-$Id$'''
-__version__='$Revision: 1.3 $'[11:-2]
-
-from MultiMapping import MultiMapping
-
-_marker = []
-
-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
-    def _push(self, ob):
-        MultiMapping.push(self, ob)
-    def _pop(self, *args):
-        if args:
-            return apply(MultiMapping.pop, (self,) + args)
-        else:
-            return MultiMapping.pop(self)
-    def has_get(self, key):
-        v = self.get(key, _marker)
-        if v is _marker:
-            return 0, None
-        else:
-            return 1, v



More information about the Zope3-Checkins mailing list