diff MoinMoin/security/antispam.py @ 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 0d3e9b79dde3
children a4f0632414da
line wrap: on
line diff
--- 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)