Skip to content

Commit

Permalink
Bump dev dependencies and re-apply black.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikael-capelle committed Feb 13, 2024
1 parent 289ee96 commit f7d02e9
Show file tree
Hide file tree
Showing 9 changed files with 210 additions and 200 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.mypy_cache
__pycache__
.venv
venv
.tox
.vscode
.idea
Expand Down
20 changes: 12 additions & 8 deletions basic_features/basic_save_game_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ class BasicGameSaveGameInfoWidget(mobase.ISaveGameInfoWidget):
def __init__(
self,
parent: QWidget | None,
get_preview: Callable[[Path], QPixmap | QImage | Path | str | None]
| None = lambda p: None,
get_metadata: Callable[[Path, mobase.ISaveGame], Mapping[str, Any] | None]
| None = get_filedate_metadata,
get_preview: (
Callable[[Path], QPixmap | QImage | Path | str | None] | None
) = lambda p: None,
get_metadata: (
Callable[[Path, mobase.ISaveGame], Mapping[str, Any] | None] | None
) = get_filedate_metadata,
max_width: int = 320,
):
"""
Expand Down Expand Up @@ -179,10 +181,12 @@ class BasicGameSaveGameInfo(mobase.SaveGameInfo):

def __init__(
self,
get_preview: Callable[[Path], QPixmap | QImage | Path | str | None]
| None = None,
get_metadata: Callable[[Path, mobase.ISaveGame], Mapping[str, Any] | None]
| None = None,
get_preview: (
Callable[[Path], QPixmap | QImage | Path | str | None] | None
) = None,
get_metadata: (
Callable[[Path, mobase.ISaveGame], Mapping[str, Any] | None] | None
) = None,
max_width: int = 0,
):
"""Args from: `BasicGameSaveGameInfoWidget`."""
Expand Down
18 changes: 10 additions & 8 deletions basic_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ def get(self) -> _T:


class BasicGameOptionsMapping(BasicGameMapping[list[_T]]):

"""
Represents a game mappings for which multiple options are possible. The game
plugin is responsible to choose the right option depending on the context.
Expand Down Expand Up @@ -269,9 +268,11 @@ def __init__(self, game: BasicGame):
"GameValidShortNames",
"validShortNames",
default=lambda g: [],
apply_fn=lambda value: [c.strip() for c in value.split(",")] # type: ignore
if isinstance(value, str)
else value,
apply_fn=lambda value: (
[c.strip() for c in value.split(",")] # type: ignore
if isinstance(value, str)
else value
),
)
self.nexusGameId = BasicGameMapping(
game, "GameNexusId", "nexusGameID", default=lambda g: 0, apply_fn=int
Expand All @@ -296,9 +297,11 @@ def __init__(self, game: BasicGame):
"GameIniFiles",
"iniFiles",
lambda g: [],
apply_fn=lambda value: [c.strip() for c in value.split(",")]
if isinstance(value, str)
else value,
apply_fn=lambda value: (
[c.strip() for c in value.split(",")]
if isinstance(value, str)
else value
),
)
self.savesDirectory = BasicGameMapping(
game,
Expand Down Expand Up @@ -371,7 +374,6 @@ def ids_apply(v: list[int] | list[str] | int | str) -> list[str]:


class BasicGame(mobase.IPluginGame):

"""This class implements some methods from mobase.IPluginGame
to make it easier to create game plugins without having to implement
all the methods of mobase.IPluginGame."""
Expand Down
6 changes: 3 additions & 3 deletions games/game_divinityoriginalsinee.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ def init(self, organizer: mobase.IOrganizer):
self._featureMap[mobase.SaveGameInfo] = BasicGameSaveGameInfo(
lambda s: s.with_suffix(".png")
)
self._featureMap[
mobase.ModDataChecker
] = DivinityOriginalSinEnhancedEditionModDataChecker()
self._featureMap[mobase.ModDataChecker] = (
DivinityOriginalSinEnhancedEditionModDataChecker()
)
return True

def mappings(self) -> list[mobase.Mapping]:
Expand Down
6 changes: 3 additions & 3 deletions games/game_gta-san-andreas-de.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ class GTASanAndreasDefinitiveEditionGame(BasicGame):

def init(self, organizer: mobase.IOrganizer) -> bool:
super().init(organizer)
self._featureMap[
mobase.ModDataChecker
] = GTASanAndreasDefinitiveEditionModDataChecker()
self._featureMap[mobase.ModDataChecker] = (
GTASanAndreasDefinitiveEditionModDataChecker()
)
return True

def executables(self):
Expand Down
6 changes: 3 additions & 3 deletions games/game_gta-vice-city-de.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ class GTAViceCityDefinitiveEditionGame(BasicGame):

def init(self, organizer: mobase.IOrganizer) -> bool:
super().init(organizer)
self._featureMap[
mobase.ModDataChecker
] = GTAViceCitysDefinitiveEditionModDataChecker()
self._featureMap[mobase.ModDataChecker] = (
GTAViceCitysDefinitiveEditionModDataChecker()
)
return True

def executables(self):
Expand Down
8 changes: 4 additions & 4 deletions games/game_subnautica-below-zero.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class SubnauticaBelowZeroGame(game_subnautica.SubnauticaGame):

def init(self, organizer: mobase.IOrganizer) -> bool:
super().init(organizer)
self._featureMap[
mobase.ModDataChecker
] = game_subnautica.SubnauticaModDataChecker(
GlobPatterns(unfold=["BepInExPack_BelowZero"])
self._featureMap[mobase.ModDataChecker] = (
game_subnautica.SubnauticaModDataChecker(
GlobPatterns(unfold=["BepInExPack_BelowZero"])
)
)
return True
Loading

0 comments on commit f7d02e9

Please sign in to comment.