summaryrefslogtreecommitdiff
path: root/admin.py
diff options
context:
space:
mode:
authorrichard <devnull@localhost>2011-07-15 06:44:44 +0000
committerrichard <devnull@localhost>2011-07-15 06:44:44 +0000
commit43c500c2dc4d0203cf22a5015ee8c043cccf3ffa (patch)
tree20f3dee80e72ef0dcec7a93abfde47fcaa3331fc /admin.py
parent4f098d5e8280932a3e3747b253b0736761767402 (diff)
downloaddecorator-43c500c2dc4d0203cf22a5015ee8c043cccf3ffa.tar.gz
add test-run capability to nested list nuker
Diffstat (limited to 'admin.py')
-rw-r--r--admin.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/admin.py b/admin.py
index aa4b875..7012594 100644
--- a/admin.py
+++ b/admin.py
@@ -145,7 +145,7 @@ def merge_user(store, old, new):
c.execute('update comments_journal set submitted_by=%s where submitted_by=%s', (new, old))
c.execute('delete from users where name=%s', (old,))
-def nuke_nested_lists(store):
+def nuke_nested_lists(store, confirm):
c = store.get_cursor()
c.execute("""select name, version, summary from releases
where summary like '%nested lists%'""")
@@ -168,9 +168,13 @@ def nuke_nested_lists(store):
if 'def print_lol' in f.read():
hits[name] = summary
for name in hits:
- store.remove_package(name)
+ if confirm:
+ store.remove_package(name)
print '%s: %s' % (name, hits[name])
- print 'removed %d packages' % len(hits)
+ if confirm:
+ print 'removed %d packages' % len(hits)
+ else:
+ print 'WOULD HAVE removed %d packages' % len(hits)
if __name__ == '__main__':
config = config.Config('/data/pypi/config.ini')