diff scripts/spam-remover @ 4661:73129d1a1bc3

Fix file options for spam-remover script, set content to single space.
author Ralf Schlatterbeck <rsc@runtux.com>
date Thu, 06 Sep 2012 11:24:19 +0200
parents 9f507a042c1b
children f841a5868101
line wrap: on
line diff
--- a/scripts/spam-remover	Thu Sep 06 10:57:51 2012 +0200
+++ b/scripts/spam-remover	Thu Sep 06 11:24:19 2012 +0200
@@ -96,11 +96,11 @@
     users = dict.fromkeys (db.user.lookup(u) for u in opt.users)
     files_to_remove = {}
     for fn in opt.filenames:
-        for fid in db.files.filter(None,name=fn):
+        for fid in db.file.filter(None,dict(name=fn)):
             if db.file.get(fid,'name') == fn:
                 files_to_remove[fid] = True
     for fn in opt.file_pattern:
-        for fid in db.files.filter(None,name=fn):
+        for fid in db.file.filter(None,dict(name=fn)):
             if db.file.get(fid,'name').startswith(fn):
                 files_to_remove[fid] = True
     files_found = {}
@@ -168,7 +168,7 @@
             db.setjournal(clsname, id, newjournal)
     if opt.doit:
         for f in files_found:
-            db.file.set(f, content='')
+            db.file.set(f, content=' ')
         db.commit()
     else:
         print "Database not changed"

Roundup Issue Tracker: http://roundup-tracker.org/