Verbosity in config

pull/5/head
David Trail 13 years ago
parent 9d230704cd
commit 0ed52bd6bc

@ -10,6 +10,7 @@ config.read('shreddit.cfg')
days = config.getint('main', 'days') days = config.getint('main', 'days')
whitelist = config.get('main', 'whitelist') whitelist = config.get('main', 'whitelist')
sort = config.get('main', 'sort') sort = config.get('main', 'sort')
verbose = config.getboolean('main', 'verbose')
r = reddit.Reddit(user_agent="Shreddit-PRAW") r = reddit.Reddit(user_agent="Shreddit-PRAW")
# add user: <YourUsername> / pswd: <YourPassword> to the [reddit] config section # add user: <YourUsername> / pswd: <YourPassword> to the [reddit] config section
@ -24,5 +25,6 @@ for comment in r.user.get_comments(limit=None, sort=sort):
next next
now_time = datetime.fromtimestamp(comment.created) now_time = datetime.fromtimestamp(comment.created)
if now_time < before_time: if now_time < before_time:
if verbose:
print 'Deleting: [%s]: "%s"' % (comment.subreddit, comment.body[:20]) print 'Deleting: [%s]: "%s"' % (comment.subreddit, comment.body[:20])
comment.delete() comment.delete()

@ -2,8 +2,7 @@
# or can be edited in the reddit_api [reddit] section # or can be edited in the reddit_api [reddit] section
[main] [main]
days = 7 days = 7
sort = new
verbose = True
# Don't delete from these subreddits # Don't delete from these subreddits
whitelist = AskScience, TheCulture, redditdev, sysadmin, programming whitelist = AskScience, TheCulture, redditdev, sysadmin, programming
sort = new

Loading…
Cancel
Save