From 59abef7f6936a75dc1de28a76778ea89915cb8dc Mon Sep 17 00:00:00 2001 From: Daniel Johnson Date: Tue, 24 Jan 2023 17:26:28 -0500 Subject: [PATCH] Placate flake8! Every single change is just whitespace. Python! --- lutris/gui/dialogs/game_import.py | 1 + lutris/scanners/default_installers.py | 2 +- lutris/scanners/tosec.py | 3 ++- lutris/util/system.py | 3 +-- tests/test_moddb_helper.py | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lutris/gui/dialogs/game_import.py b/lutris/gui/dialogs/game_import.py index 296e9e652..9de711c96 100644 --- a/lutris/gui/dialogs/game_import.py +++ b/lutris/gui/dialogs/game_import.py @@ -14,6 +14,7 @@ from lutris.util.system import get_md5_hash, get_md5_in_zip from lutris.util.strings import slugify from lutris.services.lutris import download_lutris_media + class ImportGameDialog(ModalDialog): def __init__(self, files, parent=None) -> None: super().__init__( diff --git a/lutris/scanners/default_installers.py b/lutris/scanners/default_installers.py index 18bdd1932..794639f62 100644 --- a/lutris/scanners/default_installers.py +++ b/lutris/scanners/default_installers.py @@ -42,7 +42,7 @@ DEFAULT_INSTALLERS = { }, "atari2600": { "runner": "stella", - "game": {"main_file": "rom" } + "game": {"main_file": "rom"} }, "lynx": { "runner": "libretro", diff --git a/lutris/scanners/tosec.py b/lutris/scanners/tosec.py index d82eb6da4..debaa70aa 100644 --- a/lutris/scanners/tosec.py +++ b/lutris/scanners/tosec.py @@ -46,6 +46,7 @@ PLATFORM_PATTERNS = { "CD-i": "cdi", } + def search_tosec_by_md5(md5sum): """Retrieve a lutris bundle from the API""" if not md5sum: @@ -147,7 +148,7 @@ def clean_rom_name(name): good_index = i if c in ("(", "]"): in_parens = False - name = name[:len(name)-good_index].strip() + name = name[:len(name) - good_index].strip() if name.endswith(", The"): name = "The " + name[:-5] return name diff --git a/lutris/util/system.py b/lutris/util/system.py index f26c6cd1a..c66e21525 100644 --- a/lutris/util/system.py +++ b/lutris/util/system.py @@ -163,14 +163,13 @@ def get_md5_hash(filename): """Return the md5 hash of a file.""" try: with open(filename, "rb") as _file: - _hash = read_file_md5(_file) + _hash = read_file_md5(_file) except IOError: logger.warning("Error reading %s", filename) return False return _hash - def read_file_md5(filedesc): md5 = hashlib.md5() for chunk in iter(lambda: filedesc.read(8192), b""): diff --git a/tests/test_moddb_helper.py b/tests/test_moddb_helper.py index 4430adf7f..b373271e3 100644 --- a/tests/test_moddb_helper.py +++ b/tests/test_moddb_helper.py @@ -52,6 +52,7 @@ class ModDBHelperTests(unittest.TestCase): def test_ctor_custom_method(self): if SKIP_TESTS: return + def custom(): pass hlpr = ModDB(parse_page_method=custom)