Generate an improved pre-delete edit text.

pull/5/head
David Trail 12 years ago
parent 7b1f67c61d
commit e9abdf7a84

@ -5,6 +5,11 @@ import ConfigParser
import argparse import argparse
from datetime import datetime, timedelta from datetime import datetime, timedelta
try:
from loremipsum import get_sentence
except:
get_sentence = '''I have been Shreddited for privacy!'''
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('-c', '--config', help="config file to use instead of shreddit.cfg") parser.add_argument('-c', '--config', help="config file to use instead of shreddit.cfg")
args = parser.parse_args() args = parser.parse_args()
@ -21,6 +26,7 @@ whitelist_ids = config.get('main', 'whitelist_ids')
sort = config.get('main', 'sort') sort = config.get('main', 'sort')
verbose = config.getboolean('main', 'verbose') verbose = config.getboolean('main', 'verbose')
clear_vote = config.getboolean('main', 'clear_vote') clear_vote = config.getboolean('main', 'clear_vote')
trial_run = config.getboolean('main', 'trial_run')
item = config.get('main', 'item') item = config.get('main', 'item')
_user = config.get('main', 'username') _user = config.get('main', 'username')
@ -80,5 +86,10 @@ for thing in things:
print 'Deleting: [%s]: "%s"' % (thing.subreddit, thing.body[:20]) print 'Deleting: [%s]: "%s"' % (thing.subreddit, thing.body[:20])
if clear_vote: if clear_vote:
thing.clear_vote() thing.clear_vote()
thing.edit('Shredded') if trial_run:
thing.delete() thing.edit(get_sentence)
if verbose:
print "Edited comment with {0}".format(get_sentence)
thing.delete()
if verbose:
print "Comment deleted."

@ -34,3 +34,7 @@ whitelist = AskScience, TheCulture, redditdev, programming, charity
# If you want any specific posts to be whitelisted stick 'em in here # If you want any specific posts to be whitelisted stick 'em in here
whitelist_ids = abcdef whitelist_ids = abcdef
# If you set this then no editing or deleting will be done
# but the output from the program will be shown as an example
trial_run = True

Loading…
Cancel
Save