Fixes reconnect regression

klloe-global_config
Scott 8 years ago
parent 5daf843d9d
commit cf8a92e4eb

@ -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__))

@ -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")

Loading…
Cancel
Save