diff --git a/itchiodl/downloader/__main__.py b/itchiodl/downloader/__main__.py index 3830a93..164f9bf 100644 --- a/itchiodl/downloader/__main__.py +++ b/itchiodl/downloader/__main__.py @@ -23,8 +23,8 @@ def main(): type=bool, default=False, const=True, - nargs='?', - help="Download Folders are named based on the full text version of the title instead of the trimmed URL title" + nargs="?", + help="Download Folders are named based on the full text version of the title instead of the trimmed URL title", ) parser.add_argument( diff --git a/itchiodl/game.py b/itchiodl/game.py index 55b5641..feaa1d6 100644 --- a/itchiodl/game.py +++ b/itchiodl/game.py @@ -3,8 +3,8 @@ import json import urllib import datetime from pathlib import Path -import requests from sys import argv +import requests from itchiodl import utils @@ -14,7 +14,7 @@ class Game: def __init__(self, data): self.args = argv[1:] - if '--human-folders' in self.args: + if "--human-folders" in self.args: self.humanFolders = True else: self.humanFolders = False @@ -35,7 +35,8 @@ class Game: if self.humanFolders: self.game_slug = utils.clean_path(self.data["title"]) self.publisher_slug = self.data.get("user").get("display_name") - # This Branch covers the case that the user has not set a display name, and defaults to their username + # This Branch covers the case that the user has + # not set a display name, and defaults to their username if not self.publisher_slug: self.publisher_slug = self.data.get("user").get("username") else: diff --git a/itchiodl/utils.py b/itchiodl/utils.py index 4a7b78a..b5ee124 100644 --- a/itchiodl/utils.py +++ b/itchiodl/utils.py @@ -41,8 +41,9 @@ def clean_path(path): """Cleans a path on windows""" if sys.platform in ["win32", "cygwin", "msys"]: path_clean = re.sub(r"[<>:|?*\"\/\\]", "-", path) - # This checks for strings that end in ... or similar, weird corner case that affects fewer than 0.1% of titles - path_clean = re.sub(r'(.)[.]\1+$', "-", path_clean) + # This checks for strings that end in ... or similar, + # weird corner case that affects fewer than 0.1% of titles + path_clean = re.sub(r"(.)[.]\1+$", "-", path_clean) return path_clean return path