[Zope3-checkins] CVS: Zope3/src/zope/security - checker.py:1.1.2.3 interfaces.py:1.1.2.3 proxy.py:1.1.2.2 restrictedbuiltins.py:1.1.2.2 restrictedinterpreter.py:1.1.2.2 securitycontext.py:1.1.2.2 securitymanagement.py:1.1.2.2 securitymanager.py:1.1.2.2 setup.py:1.1.2.2 simplesecuritypolicies.py:1.1.2.2

Tim Peters tim.one@comcast.net
Tue, 24 Dec 2002 21:21:48 -0500


Update of /cvs-repository/Zope3/src/zope/security
In directory cvs.zope.org:/tmp/cvs-serv19240/src/zope/security

Modified Files:
      Tag: NameGeddon-branch
	checker.py interfaces.py proxy.py restrictedbuiltins.py 
	restrictedinterpreter.py securitycontext.py 
	securitymanagement.py securitymanager.py setup.py 
	simplesecuritypolicies.py 
Log Message:
Whitespace normalization, via Python's Tools/scripts/reindent.py.  The
files are fixed-points of that script now.  Fixed a few cases where
code relied on significant trailing whitespace (ouch).


=== Zope3/src/zope/security/checker.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/security/checker.py:1.1.2.2	Tue Dec 24 07:51:29 2002
+++ Zope3/src/zope/security/checker.py	Tue Dec 24 21:21:17 2002
@@ -23,11 +23,11 @@
 
     The proxy checker is looked up if not provided.
     """
-    
-    if checker is None:        
+
+    if checker is None:
         checker = getattr(object, '__Security_checker__', None)
-    
-    if checker is None:        
+
+    if checker is None:
 
         checker = selectChecker(object)
         if checker is None:
@@ -60,7 +60,7 @@
         then access will be granted without checking a permission.
 
         An optional setattr permission function or dictionary may be
-        provided for checking set attribute access. 
+        provided for checking set attribute access.
         """
 
         if type(permission_func) is dict:
@@ -247,10 +247,10 @@
     if type(object) is Proxy:
         # Is this already a security proxy?
         return None
-    
+
     checker = _getChecker(getattr(object, '__class__', type(object)),
                           _defaultChecker)
-    
+
     if checker is NoProxy:
         return None
 
@@ -261,7 +261,7 @@
         checker = checker(object)
         if checker is NoProxy or checker is None:
             return None
-    
+
     return checker
 
 def getCheckerForInstancesOf(class_):
@@ -278,7 +278,7 @@
                 'type_ must be a type, class or module, not a %s' % type_)
     if type_ in _checkers:
         raise DuplicationError(type_)
-    _checkers[type_] = checker    
+    _checkers[type_] = checker
 
 NoProxy = object()
 


=== Zope3/src/zope/security/interfaces.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/security/interfaces.py:1.1.2.2	Mon Dec 23 15:14:47 2002
+++ Zope3/src/zope/security/interfaces.py	Tue Dec 24 21:21:17 2002
@@ -54,7 +54,7 @@
 
     def setSecurityPolicy( aSecurityPolicy ):
         """
-            Set the system default security policy. 
+            Set the system default security policy.
 
             This method should only be called by system startup code.
             It should never, for example, be called during a web request.
@@ -85,7 +85,7 @@
 
     def getPrincipal():
         """
-            Return the authenticated principal. 
+            Return the authenticated principal.
 
             This is equivalent to something like::
 
@@ -123,7 +123,7 @@
             Return a boolean indicating whether the current request has
             invoked any IExecutableObjects.
 
-            This can be used to determine if an object was called 
+            This can be used to determine if an object was called
             (more or less) directly from a URL, or if it was called by
             through-the-web provided code.
         """


=== Zope3/src/zope/security/proxy.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/security/proxy.py:1.1.2.1	Mon Dec 23 14:33:15 2002
+++ Zope3/src/zope/security/proxy.py	Tue Dec 24 21:21:17 2002
@@ -2,14 +2,14 @@
 #
 # Copyright (c) 2001, 2002 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.
-# 
+#
 ##############################################################################
 """
 
@@ -43,4 +43,3 @@
     items = dict.items()
     items.sort()
     return items
-    


=== Zope3/src/zope/security/restrictedbuiltins.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/security/restrictedbuiltins.py:1.1.2.1	Mon Dec 23 14:33:15 2002
+++ Zope3/src/zope/security/restrictedbuiltins.py	Tue Dec 24 21:21:17 2002
@@ -2,14 +2,14 @@
 #
 # Copyright (c) 2002 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
-# 
+#
 ##############################################################################
 """
 
@@ -52,7 +52,7 @@
     # merge_class_dict in object.c. The assert macro seems to be doing
     # the wrong think. Basically, if an object has bases, then bases
     # is assumed to be a tuple.
-    
+
     # Anything that accesses an external file is a no no:
     # 'open', 'execfile', 'file'
 
@@ -91,8 +91,8 @@
             if l < 0:
                 return module
 
-            return sys.modules[name[:l]]                
-            
+            return sys.modules[name[:l]]
+
         except KeyError:
             raise ImportError(name)
 


=== Zope3/src/zope/security/restrictedinterpreter.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/security/restrictedinterpreter.py:1.1.2.1	Mon Dec 23 14:33:15 2002
+++ Zope3/src/zope/security/restrictedinterpreter.py	Tue Dec 24 21:21:17 2002
@@ -2,14 +2,14 @@
 #
 # Copyright (c) 2002 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
-# 
+#
 ##############################################################################
 """
 


=== Zope3/src/zope/security/securitycontext.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/security/securitycontext.py:1.1.2.1	Mon Dec 23 14:33:15 2002
+++ Zope3/src/zope/security/securitycontext.py	Tue Dec 24 21:21:17 2002
@@ -2,14 +2,14 @@
 #
 # Copyright (c) 2001, 2002 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.
-# 
+#
 ##############################################################################
 """ Default ISecurityContext impl """
 


=== Zope3/src/zope/security/securitymanagement.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/security/securitymanagement.py:1.1.2.1	Mon Dec 23 14:33:15 2002
+++ Zope3/src/zope/security/securitymanagement.py	Tue Dec 24 21:21:17 2002
@@ -2,14 +2,14 @@
 #
 # Copyright (c) 2001, 2002 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.
-# 
+#
 ##############################################################################
 """ Default ISecurityManagement implementation """
 
@@ -90,4 +90,3 @@
         It should never, for example, be called during a web request.
     """
     return _setSecurityPolicy( aSecurityPolicy )
-


=== Zope3/src/zope/security/securitymanager.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/security/securitymanager.py:1.1.2.1	Mon Dec 23 14:33:15 2002
+++ Zope3/src/zope/security/securitymanager.py	Tue Dec 24 21:21:17 2002
@@ -2,14 +2,14 @@
 #
 # Copyright (c) 2001, 2002 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.
-# 
+#
 ##############################################################################
 """ Default ISecurityManager implementation """
 
@@ -30,7 +30,7 @@
 
 def setSecurityPolicy( aSecurityPolicy ):
     """
-        Set the system default security policy. 
+        Set the system default security policy.
 
         This method should only be caused by system startup code. It should
         never, for example, be called during a web request.
@@ -49,7 +49,7 @@
         executable context and policies.
     """
     __implements__ = ISecurityManager
-    
+
     def __init__( self, context ):
         self._context = context
         self._policy = None
@@ -68,7 +68,7 @@
     #
     def getPrincipal( self ):
         """
-            Return the authenticated user. 
+            Return the authenticated user.
 
             This is equivalent to something like::
 
@@ -152,9 +152,8 @@
             Return a boolean indicating whether the current request has
             invoked any IExecutableObjects.
 
-            This can be used to determine if an object was called 
+            This can be used to determine if an object was called
             (more or less) directly from a URL, or if it was called by
             through-the-web provided code.
         """
         return len( self._context.stack )
-


=== Zope3/src/zope/security/setup.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/security/setup.py:1.1.2.1	Mon Dec 23 14:33:16 2002
+++ Zope3/src/zope/security/setup.py	Tue Dec 24 21:21:17 2002
@@ -3,14 +3,14 @@
 #
 # Copyright (c) 2001, 2002 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.
-# 
+#
 ##############################################################################
 
 from distutils.core import setup, Extension


=== Zope3/src/zope/security/simplesecuritypolicies.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/security/simplesecuritypolicies.py:1.1.2.1	Mon Dec 23 14:33:16 2002
+++ Zope3/src/zope/security/simplesecuritypolicies.py	Tue Dec 24 21:21:17 2002
@@ -2,14 +2,14 @@
 #
 # Copyright (c) 2001, 2002 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.
-# 
+#
 ##############################################################################
 """ Simple ISecurityPolicy implementations."""
 
@@ -28,7 +28,7 @@
             and not context.stack  # no untrusted code
             ):
             return 1 # Nobody not to trust!
-        
+
         return 0
 
 class PermissiveSecurityPolicy:
@@ -39,4 +39,3 @@
 
     def checkPermission( self, permission, object, context ):
         return 1
-