|
|
@ -161,13 +161,21 @@ def remove_things(things):
|
|
|
|
url=thing.url.encode('utf-8'))
|
|
|
|
url=thing.url.encode('utf-8'))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
elif isinstance(thing, Comment):
|
|
|
|
elif isinstance(thing, Comment):
|
|
|
|
|
|
|
|
rep_format = config.get('replacement_format')
|
|
|
|
|
|
|
|
if rep_format == 'random':
|
|
|
|
replacement_text = get_sentence()
|
|
|
|
replacement_text = get_sentence()
|
|
|
|
|
|
|
|
elif rep_format == 'dot':
|
|
|
|
|
|
|
|
replacement_text = '.'
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
replacement_text = rep_format
|
|
|
|
|
|
|
|
|
|
|
|
msg = '/r/{3}/ #{0} with:\n\t"{1}" to\n\t"{2}"'.format(
|
|
|
|
msg = '/r/{3}/ #{0} with:\n\t"{1}" to\n\t"{2}"'.format(
|
|
|
|
thing.id,
|
|
|
|
thing.id,
|
|
|
|
sub(b'\n\r\t', ' ', thing.body[:78].encode('utf-8')),
|
|
|
|
sub(b'\n\r\t', ' ', thing.body[:78].encode('utf-8')),
|
|
|
|
replacement_text[:78],
|
|
|
|
replacement_text[:78],
|
|
|
|
thing.subreddit
|
|
|
|
thing.subreddit
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
if config.get('edit_only'):
|
|
|
|
if config.get('edit_only'):
|
|
|
|
log.info('Editing (not removing) {msg}'.format(msg=msg))
|
|
|
|
log.info('Editing (not removing) {msg}'.format(msg=msg))
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|