diff --git a/setup.py b/setup.py index 632fb27..212480b 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.2" +VERSION = "6.0.3" 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 e54d432..9b456c8 100644 --- a/shreddit/shredder.py +++ b/shreddit/shredder.py @@ -97,8 +97,12 @@ class Shredder(object): return False def _save_item(self, item): - with open(os.path.join(self._save_directory, item.id), "w") as fh: - json.dump(item.json_dict, fh) + with open(os.path.join(self._save_directory, "{}.json".format(item.id)), "w") as fh: + # This is a temporary replacement for the old .json_dict property: + output = {k: item.__dict__[k] for k in item.__dict__ if not k.startswith("_")} + output["subreddit"] = output["subreddit"].title + output["author"] = output["author"].name + json.dump(output, fh) def _remove_submission(self, sub): self._logger.info("Deleting submission: #{id} {url}".format(id=sub.id, url=sub.url.encode("utf-8")))