From f2f2c137ab1e2a07fef65a01106b02e6ea541911 Mon Sep 17 00:00:00 2001 From: Luke Horwell Date: Wed, 17 Jul 2024 22:43:27 +0100 Subject: [PATCH] Fix lint inconsistencies - inconsistent-quotes - missing-module-docstring --- dbpf.py | 2 +- patches.py | 10 +++++----- setup.py | 6 ++++++ sims2_4k_ui_patcher.py | 4 ++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/dbpf.py b/dbpf.py index dae6332..717183b 100755 --- a/dbpf.py +++ b/dbpf.py @@ -468,7 +468,7 @@ def _write_int_next_4_bytes(integer): # Write header: DBPF f.seek(0) - f.write(b'\x44\x42\x50\x46') + f.write(b"\x44\x42\x50\x46") # Write header: Major version _write_int_at_pos(4, self.header.major_version) diff --git a/patches.py b/patches.py index 610fb82..d0be086 100755 --- a/patches.py +++ b/patches.py @@ -55,13 +55,13 @@ def get_image_file_type(data: bytes) -> str: # Check the first 4 bytes start = data[:4] - if start[:3] in [b'\x00\x00\x02', b'\x00\x00\n']: + if start[:3] in [b"\x00\x00\x02", b"\x00\x00\n"]: return IMAGE_FORMAT_TGA - elif start[:2] == b'BM': + elif start[:2] == b"BM": return IMAGE_FORMAT_BMP - elif start[:3] == b'\xff\xd8\xff': + elif start[:3] == b"\xff\xd8\xff": return IMAGE_FORMAT_JPG - elif start[:4] == b'\x89PNG': + elif start[:4] == b"\x89PNG": return IMAGE_FORMAT_PNG else: return IMAGE_UNKNOWN @@ -129,7 +129,7 @@ def _update_attribute_coord(data, name): values = part.split("(")[1].split(")")[0] for number in values.split(","): new_values.append(str(int(int(number) * UI_MULTIPLIER))) - part = f"{name}={part.replace(values, ','.join(new_values))}" + part = f"{name}={part.replace(values, ",".join(new_values))}" output.append(part) return "".join(output) diff --git a/setup.py b/setup.py index 4c1e7f8..d469bb3 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,9 @@ +""" +For creating an application build using cx_Freeze. +For maintainer use only. + +It is not needed to run the patcher from the repository. +""" from cx_Freeze import Executable, setup build_exe_options = { diff --git a/sims2_4k_ui_patcher.py b/sims2_4k_ui_patcher.py index f06884e..c1d06da 100755 --- a/sims2_4k_ui_patcher.py +++ b/sims2_4k_ui_patcher.py @@ -254,9 +254,9 @@ def __init__(self, *args, **kwargs): # Set window properties self.title("UI Patcher for The Sims 2") - self.eval('tk::PlaceWindow . center') + self.eval("tk::PlaceWindow . center") - if self.tk.call("tk", "windowingsystem") == 'win32': + if self.tk.call("tk", "windowingsystem") == "win32": self.iconbitmap(get_resource("assets/icon.ico")) # A list of controls for selecting options