changeset 994:862edd1566bb

security package whitespace-only cleanup
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 19 Jul 2006 11:17:54 +0200
parents 1547a168325a
children b6ae650aec74
files MoinMoin/security/__init__.py MoinMoin/security/antispam.py MoinMoin/security/autoadmin.py
diffstat 3 files changed, 22 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/security/__init__.py	Wed Jul 19 11:13:15 2006 +0200
+++ b/MoinMoin/security/__init__.py	Wed Jul 19 11:17:54 2006 +0200
@@ -55,7 +55,7 @@
             return lambda pagename, Page=Page, request=request, attr=attr: Page(request, pagename).getACL(request).may(request, self.name, attr)
         else:
             raise AttributeError, attr
-        
+
 
 # make an alias for the default policy
 Default = Permissions
@@ -218,7 +218,7 @@
             if entries == ['Default']:
                 self.addDefault(cfg)
                 continue
-            
+
             for entry in entries:
                 if group_re.search(entry):
                     self._is_group[entry] = 1
@@ -228,7 +228,7 @@
                     # + add rights with value of 1
                     # - add right with value of 0
                     for right in rights:
-                        rightsdict[right] = (modifier == '+')    
+                        rightsdict[right] = (modifier == '+')
                 else:
                     # All rights from acl_rights_valid are added to the
                     # dict, user rights with value of 1, and other with
@@ -266,7 +266,7 @@
 
     def getString(self, b='#acl ', e='\n'):
         """print the acl strings we were fed with"""
-        return ''.join(["%s%s%s" % (b,l,e) for l in self.acl_lines])
+        return ''.join(["%s%s%s" % (b, l, e) for l in self.acl_lines])
 
     def _special_All(self, request, name, dowhat, rightsdict):
         return rightsdict.get(dowhat)
@@ -306,7 +306,7 @@
         for modifier, entries, rights in iter:
             # process data
     """
-    
+
     def __init__(self, rights, aclstring):
         """ Initialize acl iterator
 
@@ -320,7 +320,7 @@
     def __iter__(self):
         """ Required by the Iterator protocol """
         return self
-    
+
     def next(self):
         """ Return the next values from the acl string
 
@@ -336,7 +336,7 @@
             self.finished = 1
         if self.finished:
             raise StopIteration
-        
+
         # Get optional modifier [+|-]entries:rights
         modifier = ''
         if self.rest[0] in ('+', '-'):
@@ -344,9 +344,9 @@
 
         # Handle the Default meta acl
         if self.rest.startswith('Default ') or self.rest == 'Default':
-            self.rest = self.rest[8:]           
+            self.rest = self.rest[8:]
             entries, rights = ['Default'], []
-            
+
         # Handle entries:rights pairs
         else:
             # Get entries
@@ -359,10 +359,10 @@
                 entries = []
             else:
                 # TODO strip each entry from blanks?
-                entries = entries.split(',')            
+                entries = entries.split(',')
 
             # Get rights
-            try:         
+            try:
                 rights, self.rest = self.rest.split(' ', 1)
                 # Remove extra white space after rights fragment,
                 # allowing using multiple spaces between items.
--- a/MoinMoin/security/antispam.py	Wed Jul 19 11:13:15 2006 +0200
+++ b/MoinMoin/security/antispam.py	Wed Jul 19 11:17:54 2006 +0200
@@ -88,7 +88,7 @@
             timeout = 15 # time out for reaching the master server via xmlrpc
             old_timeout = socket.getdefaulttimeout()
             socket.setdefaulttimeout(timeout)
-            
+
             # For production code
             uri = "http://moinmaster.wikiwikiweb.de:8000/?action=xmlrpc2"
             # For testing (use your test wiki as BadContent source)
@@ -105,17 +105,17 @@
                 if isinstance(response, dict) and 'faultCode' in response:
                     raise WikirpcError("failed to get BadContent information",
                                        response)
-                
+
                 # Compare date against local BadContent copy
                 masterdate = response['lastModified']
 
-                if isinstance(masterdate, datetime.datetime): 
+                if isinstance(masterdate, datetime.datetime):
                     # for python 2.5a
                     mydate = datetime.datetime(*tuple(time.gmtime(mymtime))[0:6])
                 else:
                     # for python <= 2.4.x
                     mydate = xmlrpclib.DateTime(tuple(time.gmtime(mymtime)))
-                                                    
+
                 dprint("master: %s mine: %s" % (masterdate, mydate))
                 if mydate < masterdate:
                     # Get new copy and save
@@ -145,14 +145,14 @@
 
             # set back socket timeout
             socket.setdefaulttimeout(old_timeout)
-                
+
     blacklist = p.get_raw_body()
     return invalidate_cache, makelist(blacklist)
 
 
 class SecurityPolicy(Permissions):
     """ Extend the default security policy with antispam feature """
-    
+
     def save(self, editor, newtext, rev, **kw):
         BLACKLISTPAGES = ["BadContent", "LocalBadContent"]
         if not editor.page_name in BLACKLISTPAGES:
@@ -160,7 +160,7 @@
 
             # Start timing of antispam operation
             request.clock.start('antispam')
-            
+
             blacklist = []
             invalidate_cache = not getattr(request.cfg, "_mmblcache", None)
             for pn in BLACKLISTPAGES:
@@ -190,8 +190,8 @@
                 newset = sets.ImmutableSet(newtext.splitlines(1))
                 oldset = sets.ImmutableSet(oldtext.splitlines(1))
                 difference = newset.difference(oldset)
-                addedtext = ''.join(difference) 
-                
+                addedtext = ''.join(difference)
+
                 for blacklist_re in request.cfg._mmblcache:
                     match = blacklist_re.search(addedtext)
                     if match:
@@ -205,7 +205,7 @@
                         dprint(msg)
                         raise editor.SaveError(msg)
             request.clock.stop('antispam')
-            
+
         # No problem to save if my base class agree
         return Permissions.save(self, editor, newtext, rev, **kw)
 
--- a/MoinMoin/security/autoadmin.py	Wed Jul 19 11:13:15 2006 +0200
+++ b/MoinMoin/security/autoadmin.py	Wed Jul 19 11:17:54 2006 +0200
@@ -65,7 +65,7 @@
 
 class SecurityPolicy(Permissions):
     """ Extend the default security policy with autoadmin feature """
-    
+
     def admin(self, pagename):
         try:
             request = self.request