Add max_score parameter to only delete comments with this score

or less.
pull/33/head
Dave Disser 10 years ago
parent e682468eb3
commit c16b28e99c

@ -55,4 +55,9 @@ whitelist_gilded = True
# except on whitelisted subreddits but after 3 months delete everything.
nuke_hours = 0
# Only delete comments with this score or less, or delete all comments
# if this is not set.
max_score =
# vim: syntax=config

@ -56,6 +56,10 @@ item = config.get('main', 'item')
whitelist_distinguished = config.getboolean('main', 'whitelist_distinguished')
whitelist_gilded = config.getboolean('main', 'whitelist_gilded')
nuke_hours = config.getint('main', 'nuke_hours')
try:
max_score = config.getint('main', 'max_score')
except ValueError:
max_score = None
_user = config.get('main', 'username')
_pass = config.get('main', 'password')
@ -127,6 +131,8 @@ for thing in things:
continue
if whitelist_gilded and thing.gilded:
continue
if max_score is not None and thing.score > max_score:
continue
if trial_run: # Don't do anything, trial mode!
if verbose:

Loading…
Cancel
Save