changeset 2438:609ef7393a14

remove bogus copy statements
author Johannes Berg <johannes AT sipsolutions DOT net>
date Fri, 20 Jul 2007 13:46:45 +0200
parents 0b2a95feb672
children 08f64645042e
files MoinMoin/request/__init__.py
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/request/__init__.py	Fri Jul 20 13:24:48 2007 +0200
+++ b/MoinMoin/request/__init__.py	Fri Jul 20 13:46:45 2007 +0200
@@ -9,7 +9,6 @@
 
 import os, re, time, sys, cgi, StringIO
 import logging
-import copy
 import Cookie
 
 try:
@@ -300,15 +299,15 @@
                         t = int(t)
                         maxnum, dt = limits.get(action, default_limit)
                         if t >= now - dt:
-                            events = surgedict.setdefault(id, copy.copy({}))
-                            timestamps = events.setdefault(action, copy.copy([]))
+                            events = surgedict.setdefault(id, {})
+                            timestamps = events.setdefault(action, [])
                             timestamps.append((t, surge_indicator))
                     except StandardError:
                         pass
 
             maxnum, dt = limits.get(current_action, default_limit)
-            events = surgedict.setdefault(current_id, copy.copy({}))
-            timestamps = events.setdefault(current_action, copy.copy([]))
+            events = surgedict.setdefault(current_id, {})
+            timestamps = events.setdefault(current_action, [])
             surge_detected = len(timestamps) > maxnum
 
             surge_indicator = surge_detected and "!" or ""
@@ -320,8 +319,8 @@
             if current_action != 'AttachFile': # don't add AttachFile accesses to all or picture galleries will trigger SP
                 current_action = 'all' # put a total limit on user's requests
                 maxnum, dt = limits.get(current_action, default_limit)
-                events = surgedict.setdefault(current_id, copy.copy({}))
-                timestamps = events.setdefault(current_action, copy.copy([]))
+                events = surgedict.setdefault(current_id, {})
+                timestamps = events.setdefault(current_action, [])
 
                 if kick_him: # ban this guy, NOW
                     timestamps.extend([(now + self.cfg.surge_lockout_time, "!")] * (2*maxnum))