Skip to content

Commit 5ab9cc8

Browse files
[pre-commit.ci] Auto fixes from pre-commit.com hooks.
1 parent 2e357d6 commit 5ab9cc8

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

games/stalker2heartofchornobyl/paks/model.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,16 @@ def _init_mod_states(self):
4040
paks_txt = QFileInfo(profile.absoluteFilePath("stalker2_paks.txt"))
4141
if paks_txt.exists():
4242
try:
43-
with open(paks_txt.absoluteFilePath(), "r", encoding="utf-8") as paks_file:
43+
with open(
44+
paks_txt.absoluteFilePath(), "r", encoding="utf-8"
45+
) as paks_file:
4446
index = 0
4547
for line in paks_file:
4648
stripped_line = line.strip()
4749
if stripped_line:
4850
self.paks[index] = (stripped_line, "", "", "")
4951
index += 1
50-
except (IOError, OSError) as e:
52+
except (IOError, OSError):
5153
pass
5254

5355
def set_paks(self, paks: dict[int, _PakInfo]):

games/stalker2heartofchornobyl/paks/widget.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
from functools import cmp_to_key
32
from pathlib import Path
43
from typing import cast
@@ -50,7 +49,9 @@ def load_paks_list(self) -> list[str]:
5049
paks_list: list[str] = []
5150
if paks_txt.exists():
5251
try:
53-
with open(paks_txt.absoluteFilePath(), "r", encoding="utf-8") as paks_file:
52+
with open(
53+
paks_txt.absoluteFilePath(), "r", encoding="utf-8"
54+
) as paks_file:
5455
for line in paks_file:
5556
stripped_line = line.strip()
5657
if stripped_line:
@@ -151,9 +152,8 @@ def _parse_pak_files(self):
151152
continue
152153
filetree = mod_item.fileTree()
153154

154-
has_logicmods = (
155-
filetree.find("Content/Paks/LogicMods")
156-
or filetree.find("Paks/LogicMods")
155+
has_logicmods = filetree.find("Content/Paks/LogicMods") or filetree.find(
156+
"Paks/LogicMods"
157157
)
158158
if isinstance(has_logicmods, mobase.IFileTree):
159159
continue
@@ -176,9 +176,9 @@ def _parse_pak_files(self):
176176
pak_paths[pak_name] = (
177177
mod_item.absolutePath()
178178
+ "/"
179-
+ cast(
180-
mobase.IFileTree, sub_entry.parent()
181-
).path("/"),
179+
+ cast(mobase.IFileTree, sub_entry.parent()).path(
180+
"/"
181+
),
182182
mod_item.absolutePath() + "/" + pak_mods.path("/"),
183183
)
184184
pak_source[pak_name] = mod_item.name()

0 commit comments

Comments
 (0)