From cf8a92e4eb2273def41e90cba42ecc4e54e49108 Mon Sep 17 00:00:00 2001 From: Scott Date: Tue, 13 Dec 2016 17:01:29 -0600 Subject: [PATCH] Fixes reconnect regression --- setup.py | 2 +- shreddit/shredder.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 212480b..6c4b7ff 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup from codecs import open from os import path -VERSION = "6.0.3" +VERSION = "6.0.4" DESCRIPTION = " Remove your comment history on Reddit as deleting an account does not do so." here = path.abspath(path.dirname(__file__)) diff --git a/shreddit/shredder.py b/shreddit/shredder.py index 08c6d9f..05c1065 100644 --- a/shreddit/shredder.py +++ b/shreddit/shredder.py @@ -24,7 +24,8 @@ class Shredder(object): self._logger.setLevel(level=logging.DEBUG if config.get("verbose", True) else logging.INFO) self.__dict__.update({"_{}".format(k): config[k] for k in config}) - self._connect(user) + self._user = user + self._connect() if self._save_directory: self._r.config.store_json_result = True @@ -71,12 +72,12 @@ class Shredder(object): # while and do it again. self._logger.info("Waiting {} seconds and continuing...".format(self._batch_cooldown)) time.sleep(self._batch_cooldown) - self._connect(None, self._username, self._password) + self._connect() self.shred() - def _connect(self, user): + def _connect(self): try: - self._r = praw.Reddit(user, user_agent="python:shreddit:v6.0.0") + self._r = praw.Reddit(self._user, user_agent="python:shreddit:v6.0.4") self._logger.info("Logged in as {user}.".format(user=self._r.user.me())) except ResponseException: raise ShredditError("Bad OAuth credentials")