diff --git a/deletefb/tools/archive.py b/deletefb/tools/archive.py index 36692d8..cb4c41f 100644 --- a/deletefb/tools/archive.py +++ b/deletefb/tools/archive.py @@ -9,9 +9,9 @@ from pybloom_live import BloomFilter def make_filter(): return BloomFilter( - capacity=settings["MAX_POSTS"], - error_rate=0.001 - ) + capacity=settings["MAX_POSTS"], + error_rate=0.001 + ) @attr.s class Archive: @@ -33,15 +33,19 @@ class Archive: if content.name not in self._bloom_filter: self.archive_file.write(json.dumps(attr.asdict(content)) + "\n") self._bloom_filter.add(content.name) - return + return @contextmanager def archiver(archive_type): - archive_file = open("./%s.log" % archive_type, mode="ta", buffering=1) + archive_file = open( + "./{0}.log".format(archive_type), + mode="ta", + buffering=1 + ) archiver_instance = Archive( - archive_type=archive_type, - archive_file=archive_file + archive_type=archive_type, + archive_file=archive_file ) try: diff --git a/deletefb/tools/common.py b/deletefb/tools/common.py index 6b6c74e..7f6364a 100644 --- a/deletefb/tools/common.py +++ b/deletefb/tools/common.py @@ -36,8 +36,7 @@ def logger(name): """ # Make sure the path always points to the correct directory - config_path = os.path.dirname( - os.path.realpath(__file__)) + "/../logging_conf.json" + config_path = os.path.dirname(os.path.realpath(__file__)) + "/../logging_conf.json" if not isfile(config_path): # called from file (deletefb.py) os.chdir("..") @@ -46,7 +45,6 @@ def logger(name): logging.config.dictConfig(config["logging"]) return logging.getLogger(name) - NO_CHROME_DRIVER = """ You need to install the chromedriver for Selenium\n Please see this link https://github.com/weskerfoot/DeleteFB#how-to-use-it\n diff --git a/deletefb/tools/likes.py b/deletefb/tools/likes.py index 5a8497f..091a144 100644 --- a/deletefb/tools/likes.py +++ b/deletefb/tools/likes.py @@ -112,4 +112,3 @@ def unlike_pages(driver, profile_url): except SELENIUM_EXCEPTIONS: # We're done break -