Skip to content

Commit 4ca4978

Browse files
[pre-commit.ci] Auto fixes from pre-commit.com hooks.
1 parent 684bbec commit 4ca4978

1 file changed

Lines changed: 40 additions & 30 deletions

File tree

games/game_fantasylifei.py

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
1+
from pathlib import Path
12

23
from PyQt6.QtCore import QDir
4+
35
import mobase
46

5-
from pathlib import Path
6-
from ..basic_features.basic_save_game_info import BasicGameSaveGame
77
from ..basic_features.basic_local_savegames import BasicLocalSavegames
8-
from ..steam_utils import find_steam_path
8+
from ..basic_features.basic_save_game_info import BasicGameSaveGame
99
from ..basic_game import BasicGame
10+
from ..steam_utils import find_steam_path
11+
1012

1113
class FantasyLifeIModDataChecker(mobase.ModDataChecker):
1214
def __init__(self: mobase.ModDataChecker) -> None:
1315
super().__init__()
1416

15-
def dataLooksValid(self: mobase.ModDataChecker, filetree: mobase.IFileTree) -> mobase.ModDataChecker.CheckReturn:
17+
def dataLooksValid(
18+
self: mobase.ModDataChecker, filetree: mobase.IFileTree
19+
) -> mobase.ModDataChecker.CheckReturn:
1620
if filetree.exists("Game", mobase.IFileTree.DIRECTORY):
1721
return mobase.ModDataChecker.INVALID
18-
19-
if filetree.exists("Mods", mobase.IFileTree.DIRECTORY) or filetree.exists("Paks", mobase.IFileTree.DIRECTORY):
22+
23+
if filetree.exists("Mods", mobase.IFileTree.DIRECTORY) or filetree.exists(
24+
"Paks", mobase.IFileTree.DIRECTORY
25+
):
2026
return mobase.ModDataChecker.VALID
21-
27+
2228
return mobase.ModDataChecker.INVALID
2329

2430

25-
class FantasyLifeI(BasicGame,
26-
mobase.IPluginFileMapper,
27-
mobase.IPluginInstallerSimple
28-
):
29-
31+
class FantasyLifeI(BasicGame, mobase.IPluginFileMapper, mobase.IPluginInstallerSimple):
3032
Name = "Fantasy Life I Support Plugin"
3133
Author = "AmeliaCute"
3234
Version = "0.2.1"
@@ -35,11 +37,11 @@ class FantasyLifeI(BasicGame,
3537
GameShortName = "fantasylifei"
3638
GameNexusName = "fantasylifeithegirlwhostealstime"
3739
GameValidShortNames = ["fli"]
38-
40+
3941
GameDataPath = "Game/Content/"
4042
GameBinary = "Game/Binaries/Win64/NFL1-Win64-Shipping.exe"
4143
GameSteamId = 2993780
42-
44+
4345
GameSupportURL = (
4446
r"https://github.com/ModOrganizer2/modorganizer-basic_games/wiki/"
4547
"Game:-Fantasy-Life-I:-The-Girl-Who-Steals-Time"
@@ -55,12 +57,10 @@ def init(self, organizer: mobase.IOrganizer) -> bool:
5557
self._register_feature(FantasyLifeIModDataChecker())
5658
self._register_feature(BasicLocalSavegames(self.savesDirectory()))
5759
return True
58-
60+
5961
def executables(self):
6062
return [
61-
mobase.ExecutableInfo(
62-
"Fantasy Life I", self.GameBinary
63-
),
63+
mobase.ExecutableInfo("Fantasy Life I", self.GameBinary),
6464
]
6565

6666
## SAVE
@@ -71,7 +71,7 @@ def getCloudSaveDirectory() -> str | None:
7171
steamPath = find_steam_path()
7272
if steamPath is None:
7373
return None
74-
74+
7575
userData = steamPath.joinpath("userdata")
7676
for child in userData.iterdir():
7777
name = child.name
@@ -98,7 +98,8 @@ def listSaves(self, folder: QDir) -> list[mobase.ISaveGame]:
9898

9999
## MAPPING
100100

101-
def exeDirectory(self) -> QDir: return QDir(QDir(self.gameDirectory()).filePath("Game/Binaries/Win64"))
101+
def exeDirectory(self) -> QDir:
102+
return QDir(QDir(self.gameDirectory()).filePath("Game/Binaries/Win64"))
102103

103104
def mappings(self) -> list[mobase.Mapping]:
104105
return [
@@ -107,27 +108,36 @@ def mappings(self) -> list[mobase.Mapping]:
107108

108109
## INSTALLER
109110

110-
_PAK_EXTENSIONS = ('.pak', '.ucas', '.utoc')
111+
_PAK_EXTENSIONS = (".pak", ".ucas", ".utoc")
111112

112113
def priority(self) -> int:
113114
return 150
114115

115116
def isArchiveSupported(self, tree: mobase.IFileTree) -> bool:
116117
for entry in tree:
117-
if entry.name().lower().endswith(self._PAK_EXTENSIONS): return True
118-
119-
if tree.exists("Mod.json", mobase.IFileTree.FILE): return True
118+
if entry.name().lower().endswith(self._PAK_EXTENSIONS):
119+
return True
120+
121+
if tree.exists("Mod.json", mobase.IFileTree.FILE):
122+
return True
120123
return False
121124

122-
def install(self, name: mobase.GuessedString, tree: mobase.IFileTree, version: str, nexus_id: int) -> mobase.InstallResult:
125+
def install(
126+
self,
127+
name: mobase.GuessedString,
128+
tree: mobase.IFileTree,
129+
version: str,
130+
nexus_id: int,
131+
) -> mobase.InstallResult:
123132
paks_dir = QDir(".").filePath("Paks/~mods/")
124133
mods_dir = QDir(".").filePath(f"Mods/{name.__str__()}/")
125-
134+
126135
for entry in list(tree):
127136
if entry.name().lower().endswith(self._PAK_EXTENSIONS):
128137
tree.move(entry, paks_dir)
129-
138+
130139
if tree.exists("Mod.json", mobase.IFileTree.FILE):
131-
for entry in list(tree): tree.move(entry, mods_dir)
132-
133-
return mobase.InstallResult.SUCCESS
140+
for entry in list(tree):
141+
tree.move(entry, mods_dir)
142+
143+
return mobase.InstallResult.SUCCESS

0 commit comments

Comments
 (0)