Fix linting conflicts

This commit is contained in:
64Core 2023-03-24 18:21:18 -05:00
parent 1eb2f69693
commit e7c28a8ca9
3 changed files with 8 additions and 6 deletions

View file

@ -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(

View file

@ -5,8 +5,8 @@ import datetime
from os import path
from os import mkdir
from os import makedirs
import requests
from sys import argv
import requests
from itchiodl import utils
@ -16,7 +16,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
@ -37,7 +37,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:

View file

@ -41,7 +41,8 @@ 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
# 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