Skip to content

Commit

Permalink
Fix lint inconsistencies
Browse files Browse the repository at this point in the history
- inconsistent-quotes
- missing-module-docstring
  • Loading branch information
lah7 committed Jul 17, 2024
1 parent f3a550d commit f2f2c13
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dbpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
4 changes: 2 additions & 2 deletions sims2_4k_ui_patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f2f2c13

Please sign in to comment.