From f502fb468f601175de80ccde5ff354a18a93b117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Fri, 25 Apr 2025 08:23:10 +0200 Subject: [PATCH] Add pre-commit hook (#179) * Update dev dependencies. * Add pre-commit hook. --- .pre-commit-config.yaml | 25 ++ LICENSE | 2 +- basic_features/basic_local_savegames.py | 3 +- basic_features/basic_mod_data_checker.py | 2 +- basic_features/basic_save_game_info.py | 3 +- basic_game.py | 3 +- games/game_arkhamcity.py | 173 ++++++------- games/game_blackandwhite2.py | 3 +- games/game_bladeandsorcery.py | 3 +- games/game_control.py | 3 +- games/game_cyberpunk2077.py | 7 +- games/game_daggerfallunity.py | 112 ++++----- games/game_dao.py | 62 ++--- games/game_darkestdungeon.py | 3 +- games/game_darkmessiahofmightandmagic.py | 3 +- games/game_divinityoriginalsinee.py | 3 +- games/game_dungeonsiege1.py | 3 +- games/game_dungeonsiege2.py | 3 +- games/game_f123.py | 26 +- games/game_gta-3-de.py | 3 +- games/game_gta-san-andreas-de.py | 3 +- games/game_gta-vice-city-de.py | 3 +- games/game_kerbalspaceprogram.py | 3 +- games/game_kingdomcomedeliverance.py | 3 +- games/game_masterduel.py | 177 ++++++------- games/game_metalgearsolid2mc.py | 34 +-- games/game_metalgearsolid3mc.py | 30 +-- games/game_mountandblade2.py | 3 +- games/game_nfshs.py | 3 +- games/game_nomanssky.py | 3 +- games/game_sims4.py | 306 +++++++++++------------ games/game_stalkeranomaly.py | 3 +- games/game_stardewvalley.py | 3 +- games/game_starsector.py | 3 +- games/game_starwars-empire-at-war-foc.py | 3 +- games/game_starwars-empire-at-war.py | 3 +- games/game_subnautica.py | 3 +- games/game_tdu.py | 3 +- games/game_tdu2.py | 3 +- games/game_thps3.py | 3 +- games/game_thps4.py | 3 +- games/game_thug.py | 3 +- games/game_thug2.py | 3 +- games/game_tmuf.py | 3 +- games/game_trainsimulator.py | 3 +- games/game_valheim.py | 5 +- games/game_vampirebloodlines.py | 3 +- games/game_witcher1.py | 3 +- games/game_witcher2.py | 3 +- games/game_witcher3.py | 3 +- poetry.lock | 166 ++++++------ pyproject.toml | 8 +- 52 files changed, 666 insertions(+), 580 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..047c78c --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-toml + - id: check-merge-conflict + - id: mixed-line-ending + args: [--fix=lf] + - id: check-case-conflict + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.11.7 # must match pyproject.toml + hooks: + - id: ruff + args: [--extend-select, I, --fix] + - id: ruff-format + +ci: + autofix_commit_msg: "[pre-commit.ci] Auto fixes from pre-commit.com hooks." + autofix_prs: true + autoupdate_commit_msg: "[pre-commit.ci] Pre-commit autoupdate." + autoupdate_schedule: quarterly + submodules: false diff --git a/LICENSE b/LICENSE index 283c0b6..45ca39c 100644 --- a/LICENSE +++ b/LICENSE @@ -4,4 +4,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/basic_features/basic_local_savegames.py b/basic_features/basic_local_savegames.py index 6d794ae..cfdaa29 100644 --- a/basic_features/basic_local_savegames.py +++ b/basic_features/basic_local_savegames.py @@ -1,6 +1,7 @@ -import mobase from PyQt6.QtCore import QDir +import mobase + class BasicLocalSavegames(mobase.LocalSavegames): def __init__(self, game_save_dir: QDir): diff --git a/basic_features/basic_mod_data_checker.py b/basic_features/basic_mod_data_checker.py index 408deac..f6d5864 100644 --- a/basic_features/basic_mod_data_checker.py +++ b/basic_features/basic_mod_data_checker.py @@ -78,7 +78,7 @@ class GlobPatterns: unfold: list[str] | None = None valid: list[str] | None = None delete: list[str] | None = None - move: dict[str, str] = field(default_factory=dict) + move: dict[str, str] = field(default_factory=dict[str, str]) def merge( self, other: GlobPatterns, mode: Literal["merge", "replace"] = "replace" diff --git a/basic_features/basic_save_game_info.py b/basic_features/basic_save_game_info.py index 7ba3094..436e724 100644 --- a/basic_features/basic_save_game_info.py +++ b/basic_features/basic_save_game_info.py @@ -6,11 +6,12 @@ from datetime import datetime from pathlib import Path from typing import Any, Callable, Self, Sequence -import mobase from PyQt6.QtCore import QDateTime, QLocale, Qt from PyQt6.QtGui import QImage, QPixmap from PyQt6.QtWidgets import QFormLayout, QLabel, QSizePolicy, QVBoxLayout, QWidget +import mobase + def format_date(date_time: QDateTime | datetime | str, format_str: str | None = None): """Default format for date and time in the `BasicGameSaveGameInfoWidget`. diff --git a/basic_game.py b/basic_game.py index 128cad5..09fca10 100644 --- a/basic_game.py +++ b/basic_game.py @@ -5,11 +5,12 @@ import sys from pathlib import Path from typing import Callable, Generic, TypeVar -import mobase from PyQt6.QtCore import QDir, QFileInfo, QStandardPaths from PyQt6.QtGui import QIcon from PyQt6.QtWidgets import QMessageBox +import mobase + from .basic_features.basic_save_game_info import ( BasicGameSaveGame, BasicGameSaveGameInfo, diff --git a/games/game_arkhamcity.py b/games/game_arkhamcity.py index acc2d28..915f26a 100644 --- a/games/game_arkhamcity.py +++ b/games/game_arkhamcity.py @@ -1,86 +1,87 @@ -import mobase -from PyQt6.QtCore import QDir, QFileInfo - -from ..basic_features import BasicLocalSavegames -from ..basic_game import BasicGame -from ..steam_utils import find_steam_path - - -# Lifted from https://github.com/ModOrganizer2/modorganizer-basic_games/blob/71dbb8c557d43cba9d290674a332e7ecd1650261/games/game_darkestdungeon.py -class ArkhamCityModDataChecker(mobase.ModDataChecker): - def __init__(self): - super().__init__() - self.validDirNames = [ - "config", - "cookedpcconsole", - "localization", - "movies", - "moviesstereo", - "splash", - ] - - def dataLooksValid( - self, filetree: mobase.IFileTree - ) -> mobase.ModDataChecker.CheckReturn: - for entry in filetree: - if not entry.isDir(): - continue - if entry.name().casefold() in self.validDirNames: - return mobase.ModDataChecker.VALID - return mobase.ModDataChecker.INVALID - - -class ArkhamCityGame(BasicGame): - Name = "Batman: Arkham City Plugin" - Author = "Paynamia" - Version = "0.5.3" - - GameName = "Batman: Arkham City" - GameShortName = "batmanarkhamcity" - GameNexusId = 372 - GameSteamId = 200260 - GameGogId = 1260066469 - GameEpicId = "Egret" - GameBinary = "Binaries/Win32/BatmanAC.exe" - GameLauncher = "Binaries/Win32/BmLauncher.exe" - GameDataPath = "BmGame" - GameDocumentsDirectory = ( - "%DOCUMENTS%/WB Games/Batman Arkham City GOTY/BmGame/Config" - ) - GameIniFiles = ["UserEngine.ini", "UserGame.ini", "UserInput.ini"] - GameSaveExtension = "sgd" - - # This will only detect saves from the earliest-created Steam profile on the user's PC. - def savesDirectory(self) -> QDir: - docSaves = QDir(self.documentsDirectory().cleanPath("../../SaveData")) - if self.is_steam(): - if (steamDir := find_steam_path()) is None: - return docSaves - for child in steamDir.joinpath("userdata").iterdir(): - if not child.is_dir() or child.name == "0": - continue - steamSaves = child.joinpath("200260", "remote") - if steamSaves.is_dir(): - return QDir(str(steamSaves)) - else: - return docSaves - else: - return docSaves - - def init(self, organizer: mobase.IOrganizer) -> bool: - super().init(organizer) - self._register_feature(ArkhamCityModDataChecker()) - self._register_feature(BasicLocalSavegames(self.savesDirectory())) - return True - - def executables(self): - return [ - mobase.ExecutableInfo( - "Batman: Arkham City", - QFileInfo(self.gameDirectory(), "Binaries/Win32/BatmanAC.exe"), - ), - mobase.ExecutableInfo( - "Arkham City Launcher", - QFileInfo(self.gameDirectory(), "Binaries/Win32/BmLauncher.exe"), - ), - ] +from PyQt6.QtCore import QDir, QFileInfo + +import mobase + +from ..basic_features import BasicLocalSavegames +from ..basic_game import BasicGame +from ..steam_utils import find_steam_path + + +# Lifted from https://github.com/ModOrganizer2/modorganizer-basic_games/blob/71dbb8c557d43cba9d290674a332e7ecd1650261/games/game_darkestdungeon.py +class ArkhamCityModDataChecker(mobase.ModDataChecker): + def __init__(self): + super().__init__() + self.validDirNames = [ + "config", + "cookedpcconsole", + "localization", + "movies", + "moviesstereo", + "splash", + ] + + def dataLooksValid( + self, filetree: mobase.IFileTree + ) -> mobase.ModDataChecker.CheckReturn: + for entry in filetree: + if not entry.isDir(): + continue + if entry.name().casefold() in self.validDirNames: + return mobase.ModDataChecker.VALID + return mobase.ModDataChecker.INVALID + + +class ArkhamCityGame(BasicGame): + Name = "Batman: Arkham City Plugin" + Author = "Paynamia" + Version = "0.5.3" + + GameName = "Batman: Arkham City" + GameShortName = "batmanarkhamcity" + GameNexusId = 372 + GameSteamId = 200260 + GameGogId = 1260066469 + GameEpicId = "Egret" + GameBinary = "Binaries/Win32/BatmanAC.exe" + GameLauncher = "Binaries/Win32/BmLauncher.exe" + GameDataPath = "BmGame" + GameDocumentsDirectory = ( + "%DOCUMENTS%/WB Games/Batman Arkham City GOTY/BmGame/Config" + ) + GameIniFiles = ["UserEngine.ini", "UserGame.ini", "UserInput.ini"] + GameSaveExtension = "sgd" + + # This will only detect saves from the earliest-created Steam profile on the user's PC. + def savesDirectory(self) -> QDir: + docSaves = QDir(self.documentsDirectory().cleanPath("../../SaveData")) + if self.is_steam(): + if (steamDir := find_steam_path()) is None: + return docSaves + for child in steamDir.joinpath("userdata").iterdir(): + if not child.is_dir() or child.name == "0": + continue + steamSaves = child.joinpath("200260", "remote") + if steamSaves.is_dir(): + return QDir(str(steamSaves)) + else: + return docSaves + else: + return docSaves + + def init(self, organizer: mobase.IOrganizer) -> bool: + super().init(organizer) + self._register_feature(ArkhamCityModDataChecker()) + self._register_feature(BasicLocalSavegames(self.savesDirectory())) + return True + + def executables(self): + return [ + mobase.ExecutableInfo( + "Batman: Arkham City", + QFileInfo(self.gameDirectory(), "Binaries/Win32/BatmanAC.exe"), + ), + mobase.ExecutableInfo( + "Arkham City Launcher", + QFileInfo(self.gameDirectory(), "Binaries/Win32/BmLauncher.exe"), + ), + ] diff --git a/games/game_blackandwhite2.py b/games/game_blackandwhite2.py index 0cc955e..f787a5e 100644 --- a/games/game_blackandwhite2.py +++ b/games/game_blackandwhite2.py @@ -6,9 +6,10 @@ from collections.abc import Mapping from pathlib import Path from typing import BinaryIO -import mobase from PyQt6.QtCore import QDateTime, QDir, QFile, QFileInfo +import mobase + from ..basic_features import BasicLocalSavegames from ..basic_features.basic_save_game_info import ( BasicGameSaveGame, diff --git a/games/game_bladeandsorcery.py b/games/game_bladeandsorcery.py index 3656205..bc689eb 100644 --- a/games/game_bladeandsorcery.py +++ b/games/game_bladeandsorcery.py @@ -2,9 +2,10 @@ import json from collections.abc import Mapping from pathlib import Path -import mobase from PyQt6.QtCore import QDateTime, QDir +import mobase + from ..basic_features.basic_save_game_info import ( BasicGameSaveGame, BasicGameSaveGameInfo, diff --git a/games/game_control.py b/games/game_control.py index 8fa0c06..2662410 100644 --- a/games/game_control.py +++ b/games/game_control.py @@ -1,8 +1,9 @@ from __future__ import annotations -import mobase from PyQt6.QtCore import QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_cyberpunk2077.py b/games/game_cyberpunk2077.py index 1765ca9..4e9a29b 100644 --- a/games/game_cyberpunk2077.py +++ b/games/game_cyberpunk2077.py @@ -10,7 +10,6 @@ from dataclasses import dataclass from pathlib import Path from typing import Any, Literal, TypeVar -import mobase from PyQt6.QtCore import QDateTime, QDir, Qt, qCritical, qInfo, qWarning from PyQt6.QtWidgets import ( QCheckBox, @@ -20,6 +19,8 @@ from PyQt6.QtWidgets import ( QWidget, ) +import mobase + from ..basic_features import BasicLocalSavegames, BasicModDataChecker, GlobPatterns from ..basic_features.basic_save_game_info import ( BasicGameSaveGame, @@ -74,7 +75,7 @@ def parse_cyberpunk_save_metadata(save_path: Path, save: mobase.ISaveGame): "Street Cred": int(meta_data["streetCred"]), "Life Path": meta_data["lifePath"], "Difficulty": meta_data["difficulty"], - "Gender": f'{meta_data["bodyGender"]} / {meta_data["brainGender"]}', + "Gender": f"{meta_data['bodyGender']} / {meta_data['brainGender']}", "Game version": meta_data["buildPatch"], } except (FileNotFoundError, json.JSONDecodeError): @@ -487,7 +488,7 @@ class Cyberpunk2077Game(BasicGame): _, ) = self._modlist_files.update_modlist("redmod") modlist_param = f'-modlist="{modlist_path}"' if modlist else "" - args = f"{args[:m.start()]}{modlist_param}{args[m.end():]}" + args = f"{args[: m.start()]}{modlist_param}{args[m.end() :]}" qInfo(f"Manual modlist deployment: replacing {m[0]}, new args = {args}") self._check_redmod_result( self._organizer.waitForApplication( diff --git a/games/game_daggerfallunity.py b/games/game_daggerfallunity.py index a51242d..6c170f1 100644 --- a/games/game_daggerfallunity.py +++ b/games/game_daggerfallunity.py @@ -1,56 +1,56 @@ -import mobase - -from ..basic_game import BasicGame - - -class DaggerfallUnityModDataChecker(mobase.ModDataChecker): - def __init__(self): - super().__init__() - self.validDirNames = [ - "biogs", - "docs", - "factions", - "fonts", - "mods", - "questpacks", - "quests", - "sound", - "soundfonts", - "spellicons", - "tables", - "text", - "textures", - "worlddata", - "aa", - ] - - def dataLooksValid( - self, filetree: mobase.IFileTree - ) -> mobase.ModDataChecker.CheckReturn: - for entry in filetree: - if not entry.isDir(): - continue - if entry.name().casefold() in self.validDirNames: - return mobase.ModDataChecker.VALID - return mobase.ModDataChecker.INVALID - - -class DaggerfallUnityGame(BasicGame): - def init(self, organizer: mobase.IOrganizer) -> bool: - super().init(organizer) - self._register_feature(DaggerfallUnityModDataChecker()) - return True - - Name = "Daggerfall Unity Support Plugin" - Author = "HomerSimpleton" - Version = "1.0.0" - - GameName = "Daggerfall Unity" - GameShortName = "daggerfallunity" - GameBinary = "DaggerfallUnity.exe" - GameLauncher = "DaggerfallUnity.exe" - GameDataPath = "%GAME_PATH%/DaggerfallUnity_Data/StreamingAssets" - GameSupportURL = ( - r"https://github.com/ModOrganizer2/modorganizer-basic_games/wiki/" - "Game:-Daggerfall-Unity" - ) +import mobase + +from ..basic_game import BasicGame + + +class DaggerfallUnityModDataChecker(mobase.ModDataChecker): + def __init__(self): + super().__init__() + self.validDirNames = [ + "biogs", + "docs", + "factions", + "fonts", + "mods", + "questpacks", + "quests", + "sound", + "soundfonts", + "spellicons", + "tables", + "text", + "textures", + "worlddata", + "aa", + ] + + def dataLooksValid( + self, filetree: mobase.IFileTree + ) -> mobase.ModDataChecker.CheckReturn: + for entry in filetree: + if not entry.isDir(): + continue + if entry.name().casefold() in self.validDirNames: + return mobase.ModDataChecker.VALID + return mobase.ModDataChecker.INVALID + + +class DaggerfallUnityGame(BasicGame): + def init(self, organizer: mobase.IOrganizer) -> bool: + super().init(organizer) + self._register_feature(DaggerfallUnityModDataChecker()) + return True + + Name = "Daggerfall Unity Support Plugin" + Author = "HomerSimpleton" + Version = "1.0.0" + + GameName = "Daggerfall Unity" + GameShortName = "daggerfallunity" + GameBinary = "DaggerfallUnity.exe" + GameLauncher = "DaggerfallUnity.exe" + GameDataPath = "%GAME_PATH%/DaggerfallUnity_Data/StreamingAssets" + GameSupportURL = ( + r"https://github.com/ModOrganizer2/modorganizer-basic_games/wiki/" + "Game:-Daggerfall-Unity" + ) diff --git a/games/game_dao.py b/games/game_dao.py index 531b173..bc3f87e 100644 --- a/games/game_dao.py +++ b/games/game_dao.py @@ -1,31 +1,31 @@ -import mobase - -from ..basic_features import BasicGameSaveGameInfo -from ..basic_game import BasicGame - - -class DAOriginsGame(BasicGame): - Name = "Dragon Age Origins Support Plugin" - Author = "Patchier" - Version = "1.1.1" - - GameName = "Dragon Age: Origins" - GameShortName = "dragonage" - GameBinary = r"bin_ship\DAOrigins.exe" - GameDataPath = r"%DOCUMENTS%\BioWare\Dragon Age\packages\core\override" - GameSavesDirectory = r"%DOCUMENTS%\BioWare\Dragon Age\Characters" - GameSaveExtension = "das" - GameSteamId = [17450, 47810] - GameGogId = 1949616134 - GameEaDesktopId = [70377, 70843] - GameSupportURL = ( - r"https://github.com/ModOrganizer2/modorganizer-basic_games/wiki/" - "Game:-Dragon-Age:-Origins" - ) - - def init(self, organizer: mobase.IOrganizer): - super().init(organizer) - self._register_feature( - BasicGameSaveGameInfo(lambda s: s.parent.joinpath("screen.dds")) - ) - return True +import mobase + +from ..basic_features import BasicGameSaveGameInfo +from ..basic_game import BasicGame + + +class DAOriginsGame(BasicGame): + Name = "Dragon Age Origins Support Plugin" + Author = "Patchier" + Version = "1.1.1" + + GameName = "Dragon Age: Origins" + GameShortName = "dragonage" + GameBinary = r"bin_ship\DAOrigins.exe" + GameDataPath = r"%DOCUMENTS%\BioWare\Dragon Age\packages\core\override" + GameSavesDirectory = r"%DOCUMENTS%\BioWare\Dragon Age\Characters" + GameSaveExtension = "das" + GameSteamId = [17450, 47810] + GameGogId = 1949616134 + GameEaDesktopId = [70377, 70843] + GameSupportURL = ( + r"https://github.com/ModOrganizer2/modorganizer-basic_games/wiki/" + "Game:-Dragon-Age:-Origins" + ) + + def init(self, organizer: mobase.IOrganizer): + super().init(organizer) + self._register_feature( + BasicGameSaveGameInfo(lambda s: s.parent.joinpath("screen.dds")) + ) + return True diff --git a/games/game_darkestdungeon.py b/games/game_darkestdungeon.py index 7e04148..31c1bf8 100644 --- a/games/game_darkestdungeon.py +++ b/games/game_darkestdungeon.py @@ -1,9 +1,10 @@ import json from pathlib import Path -import mobase from PyQt6.QtCore import QDir, QFileInfo, QStandardPaths +import mobase + from ..basic_game import BasicGame, BasicGameSaveGame from ..steam_utils import find_steam_path diff --git a/games/game_darkmessiahofmightandmagic.py b/games/game_darkmessiahofmightandmagic.py index 3941d82..ed3fbcd 100644 --- a/games/game_darkmessiahofmightandmagic.py +++ b/games/game_darkmessiahofmightandmagic.py @@ -1,9 +1,10 @@ import struct from pathlib import Path -import mobase from PyQt6.QtGui import QImage +import mobase + from ..basic_features import BasicGameSaveGameInfo from ..basic_game import BasicGame diff --git a/games/game_divinityoriginalsinee.py b/games/game_divinityoriginalsinee.py index 1c03e55..fd3836f 100644 --- a/games/game_divinityoriginalsinee.py +++ b/games/game_divinityoriginalsinee.py @@ -69,8 +69,7 @@ class DivinityOriginalSinEnhancedEditionGame(BasicGame, mobase.IPluginFileMapper GameDataPath = "Data" GameSaveExtension = "lsv" GameDocumentsDirectory = ( - "%USERPROFILE%/Documents/Larian Studios/" - "Divinity Original Sin Enhanced Edition" + "%USERPROFILE%/Documents/Larian Studios/Divinity Original Sin Enhanced Edition" ) GameSavesDirectory = ( "%USERPROFILE%/Documents/Larian Studios/" diff --git a/games/game_dungeonsiege1.py b/games/game_dungeonsiege1.py index 723be45..4eb983d 100644 --- a/games/game_dungeonsiege1.py +++ b/games/game_dungeonsiege1.py @@ -1,6 +1,7 @@ -import mobase from PyQt6.QtCore import QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_dungeonsiege2.py b/games/game_dungeonsiege2.py index b076fd5..4a8f1de 100644 --- a/games/game_dungeonsiege2.py +++ b/games/game_dungeonsiege2.py @@ -1,6 +1,7 @@ -import mobase from PyQt6.QtCore import QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_f123.py b/games/game_f123.py index 6c80bf6..e740a40 100644 --- a/games/game_f123.py +++ b/games/game_f123.py @@ -1,13 +1,13 @@ -from ..basic_game import BasicGame - - -class F123Game(BasicGame): - Name = "F1 23 Support Plugin" - Author = "ju5tA1ex" - Version = "1.0.0" - - GameName = "F1 23" - GameShortName = "F1 23" - GameSteamId = 2108330 - GameBinary = "F1_23.exe" - GameDataPath = "" +from ..basic_game import BasicGame + + +class F123Game(BasicGame): + Name = "F1 23 Support Plugin" + Author = "ju5tA1ex" + Version = "1.0.0" + + GameName = "F1 23" + GameShortName = "F1 23" + GameSteamId = 2108330 + GameBinary = "F1_23.exe" + GameDataPath = "" diff --git a/games/game_gta-3-de.py b/games/game_gta-3-de.py index 8c38b0b..c9fc338 100644 --- a/games/game_gta-3-de.py +++ b/games/game_gta-3-de.py @@ -1,9 +1,10 @@ import os from pathlib import Path -import mobase from PyQt6.QtCore import QDir, QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_gta-san-andreas-de.py b/games/game_gta-san-andreas-de.py index 41cdb3d..200a562 100644 --- a/games/game_gta-san-andreas-de.py +++ b/games/game_gta-san-andreas-de.py @@ -1,9 +1,10 @@ import os from pathlib import Path -import mobase from PyQt6.QtCore import QDir, QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_gta-vice-city-de.py b/games/game_gta-vice-city-de.py index ca90368..fa068e6 100644 --- a/games/game_gta-vice-city-de.py +++ b/games/game_gta-vice-city-de.py @@ -1,9 +1,10 @@ import os from pathlib import Path -import mobase from PyQt6.QtCore import QDir, QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_kerbalspaceprogram.py b/games/game_kerbalspaceprogram.py index 71dbdcc..fec834f 100644 --- a/games/game_kerbalspaceprogram.py +++ b/games/game_kerbalspaceprogram.py @@ -1,8 +1,9 @@ from pathlib import Path -import mobase from PyQt6.QtCore import QDir +import mobase + from ..basic_features import BasicGameSaveGameInfo from ..basic_features.basic_save_game_info import BasicGameSaveGame from ..basic_game import BasicGame diff --git a/games/game_kingdomcomedeliverance.py b/games/game_kingdomcomedeliverance.py index 503ff5d..0bc5fe1 100644 --- a/games/game_kingdomcomedeliverance.py +++ b/games/game_kingdomcomedeliverance.py @@ -1,8 +1,9 @@ import os -import mobase from PyQt6.QtCore import QDir +import mobase + from ..basic_game import BasicGame diff --git a/games/game_masterduel.py b/games/game_masterduel.py index ff9147b..8c23512 100644 --- a/games/game_masterduel.py +++ b/games/game_masterduel.py @@ -1,88 +1,89 @@ -from pathlib import Path -from typing import List, Optional - -import mobase -from PyQt6.QtCore import QDir, QFileInfo - -from ..basic_game import BasicGame - - -class MasterDuelGame(BasicGame, mobase.IPluginFileMapper): - Name = "Yu-Gi-Oh! Master Duel Support Plugin" - Author = "The Conceptionist & uwx" - Version = "1.0.2" - Description = ( - "Adds support for basic Yu-Gi-Oh! Master Duel mods.\n" - 'Eligible folders for mods are "0000" and "AssetBundle".' - ) - - GameName = "Yu-Gi-Oh! Master Duel" - GameShortName = "masterduel" - GameNexusName = "yugiohmasterduel" - GameNexusId = 4272 - GameSteamId = 1449850 - GameBinary = "masterduel.exe" - - def __init__(self): - BasicGame.__init__(self) - mobase.IPluginFileMapper.__init__(self) - - def executables(self): - return [ - mobase.ExecutableInfo( - "Yu-Gi-Oh! Master Duel", - QFileInfo(self.gameDirectory().absoluteFilePath(self.binaryName())), - ).withArgument("-popupwindow"), - ] - - # dataDirectory returns the specific LocalData folder because - # this is where most mods will go to - def dataDirectory(self) -> QDir: - return QDir(self.userDataDir()) - - _userDataDirCached: Optional[str] = None - - # Gets the LocalData/xxxxxxxxx directory. This directory has a different, - # unique, 8-character hex name for each user. - def userDataDir(self) -> str: - if self._userDataDirCached is not None: - return self._userDataDirCached - - dir = self.gameDirectory() - dir.cd("LocalData") - - subdirs = dir.entryList(filters=QDir.Filter.Dirs | QDir.Filter.NoDotAndDotDot) - dir.cd(subdirs[0]) - - self._userDataDirCached = dir.absolutePath() - return self._userDataDirCached - - def mappings(self) -> List[mobase.Mapping]: - modsPath = Path(self._organizer.modsPath()) - unityMods = self.getUnityDataMods() - - mappings: List[mobase.Mapping] = [] - - for modName in unityMods: - m = mobase.Mapping() - m.createTarget = False - m.isDirectory = True - m.source = modsPath.joinpath(modName, "AssetBundle").as_posix() - m.destination = self.gameDirectory().filePath( - Path("masterduel_Data", "StreamingAssets", "AssetBundle").as_posix() - ) - mappings.append(m) - - return mappings - - def getUnityDataMods(self) -> list[str]: - modsPath = Path(self._organizer.modsPath()) - allMods = self._organizer.modList().allModsByProfilePriority() - - unityMods: list[str] = [] - for modName in allMods: - if self._organizer.modList().state(modName) & mobase.ModState.ACTIVE != 0: - if modsPath.joinpath(modName, "AssetBundle").exists(): - unityMods.append(modName) - - return unityMods +from pathlib import Path +from typing import List, Optional + +from PyQt6.QtCore import QDir, QFileInfo + +import mobase + +from ..basic_game import BasicGame + + +class MasterDuelGame(BasicGame, mobase.IPluginFileMapper): + Name = "Yu-Gi-Oh! Master Duel Support Plugin" + Author = "The Conceptionist & uwx" + Version = "1.0.2" + Description = ( + "Adds support for basic Yu-Gi-Oh! Master Duel mods.\n" + 'Eligible folders for mods are "0000" and "AssetBundle".' + ) + + GameName = "Yu-Gi-Oh! Master Duel" + GameShortName = "masterduel" + GameNexusName = "yugiohmasterduel" + GameNexusId = 4272 + GameSteamId = 1449850 + GameBinary = "masterduel.exe" + + def __init__(self): + BasicGame.__init__(self) + mobase.IPluginFileMapper.__init__(self) + + def executables(self): + return [ + mobase.ExecutableInfo( + "Yu-Gi-Oh! Master Duel", + QFileInfo(self.gameDirectory().absoluteFilePath(self.binaryName())), + ).withArgument("-popupwindow"), + ] + + # dataDirectory returns the specific LocalData folder because + # this is where most mods will go to + def dataDirectory(self) -> QDir: + return QDir(self.userDataDir()) + + _userDataDirCached: Optional[str] = None + + # Gets the LocalData/xxxxxxxxx directory. This directory has a different, + # unique, 8-character hex name for each user. + def userDataDir(self) -> str: + if self._userDataDirCached is not None: + return self._userDataDirCached + + dir = self.gameDirectory() + dir.cd("LocalData") + + subdirs = dir.entryList(filters=QDir.Filter.Dirs | QDir.Filter.NoDotAndDotDot) + dir.cd(subdirs[0]) + + self._userDataDirCached = dir.absolutePath() + return self._userDataDirCached + + def mappings(self) -> List[mobase.Mapping]: + modsPath = Path(self._organizer.modsPath()) + unityMods = self.getUnityDataMods() + + mappings: List[mobase.Mapping] = [] + + for modName in unityMods: + m = mobase.Mapping() + m.createTarget = False + m.isDirectory = True + m.source = modsPath.joinpath(modName, "AssetBundle").as_posix() + m.destination = self.gameDirectory().filePath( + Path("masterduel_Data", "StreamingAssets", "AssetBundle").as_posix() + ) + mappings.append(m) + + return mappings + + def getUnityDataMods(self) -> list[str]: + modsPath = Path(self._organizer.modsPath()) + allMods = self._organizer.modList().allModsByProfilePriority() + + unityMods: list[str] = [] + for modName in allMods: + if self._organizer.modList().state(modName) & mobase.ModState.ACTIVE != 0: + if modsPath.joinpath(modName, "AssetBundle").exists(): + unityMods.append(modName) + + return unityMods diff --git a/games/game_metalgearsolid2mc.py b/games/game_metalgearsolid2mc.py index 6ea655c..30804b8 100644 --- a/games/game_metalgearsolid2mc.py +++ b/games/game_metalgearsolid2mc.py @@ -1,17 +1,17 @@ -from ..basic_game import BasicGame - - -class MetalGearSolid2MCGame(BasicGame): - Name = ( - "METAL GEAR SOLID 2: Sons of Liberty - Master Collection Version Support Plugin" - ) - Author = "AkiraJkr" - Version = "1.0.0" - - GameName = "METAL GEAR SOLID 2: Sons of Liberty - Master Collection Version" - GameShortName = "metalgearsolid2mc" - GameNexusName = "metalgearsolid2mc" - GameSteamId = 2131640 - GameBinary = "METAL GEAR SOLID2.exe" - GameDataPath = "" - GameLauncher = "launcher.exe" +from ..basic_game import BasicGame + + +class MetalGearSolid2MCGame(BasicGame): + Name = ( + "METAL GEAR SOLID 2: Sons of Liberty - Master Collection Version Support Plugin" + ) + Author = "AkiraJkr" + Version = "1.0.0" + + GameName = "METAL GEAR SOLID 2: Sons of Liberty - Master Collection Version" + GameShortName = "metalgearsolid2mc" + GameNexusName = "metalgearsolid2mc" + GameSteamId = 2131640 + GameBinary = "METAL GEAR SOLID2.exe" + GameDataPath = "" + GameLauncher = "launcher.exe" diff --git a/games/game_metalgearsolid3mc.py b/games/game_metalgearsolid3mc.py index e9af9ce..10f669c 100644 --- a/games/game_metalgearsolid3mc.py +++ b/games/game_metalgearsolid3mc.py @@ -1,15 +1,15 @@ -from ..basic_game import BasicGame - - -class MetalGearSolid3MCGame(BasicGame): - Name = "METAL GEAR SOLID 3: Snake Eater - Master Collection Version Support Plugin" - Author = "AkiraJkr" - Version = "1.0.0" - - GameName = "METAL GEAR SOLID 3: Snake Eater - Master Collection Version" - GameShortName = "metalgearsolid3mc" - GameNexusName = "metalgearsolid3mc" - GameSteamId = 2131650 - GameBinary = "METAL GEAR SOLID3.exe" - GameDataPath = "" - GameLauncher = "launcher.exe" +from ..basic_game import BasicGame + + +class MetalGearSolid3MCGame(BasicGame): + Name = "METAL GEAR SOLID 3: Snake Eater - Master Collection Version Support Plugin" + Author = "AkiraJkr" + Version = "1.0.0" + + GameName = "METAL GEAR SOLID 3: Snake Eater - Master Collection Version" + GameShortName = "metalgearsolid3mc" + GameNexusName = "metalgearsolid3mc" + GameSteamId = 2131650 + GameBinary = "METAL GEAR SOLID3.exe" + GameDataPath = "" + GameLauncher = "launcher.exe" diff --git a/games/game_mountandblade2.py b/games/game_mountandblade2.py index bdbf9bf..e655795 100644 --- a/games/game_mountandblade2.py +++ b/games/game_mountandblade2.py @@ -1,6 +1,7 @@ -import mobase from PyQt6.QtCore import QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_nfshs.py b/games/game_nfshs.py index 8d07901..ef24234 100644 --- a/games/game_nfshs.py +++ b/games/game_nfshs.py @@ -1,8 +1,9 @@ # -*- encoding: utf-8 -*- -import mobase from PyQt6.QtCore import QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_nomanssky.py b/games/game_nomanssky.py index f9a9626..4600859 100644 --- a/games/game_nomanssky.py +++ b/games/game_nomanssky.py @@ -1,6 +1,7 @@ -import mobase from PyQt6.QtCore import QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_sims4.py b/games/game_sims4.py index 668a3f7..e5e7fa2 100644 --- a/games/game_sims4.py +++ b/games/game_sims4.py @@ -1,153 +1,153 @@ -from collections.abc import Callable -from enum import IntEnum -from re import match -from typing import Any, List, Set, cast - -from mobase import ( - FileTreeEntry, - IFileTree, - IOrganizer, - ModDataChecker, - ModDataContent, - ReleaseType, - VersionInfo, -) - -from ..basic_game import BasicGame - - -class Content(IntEnum): - PACKAGE = 0 - SCRIPT = 1 - - -class ValidationResult(IntEnum): - INVALID = 0 - VALID = 1 - FIXABLE = 2 - - -class TS4Game(BasicGame): - Name = "The Sims 4 Support Plugin" - Author = "R3z Shark, xieve" - GameName = "The Sims 4" - GameShortName = "thesims4" - GameBinary = "Game/Bin/TS4_x64.exe" - GameDataPath = "%DOCUMENTS%/Electronic Arts/The Sims 4/Mods" - GameSteamId = 1222670 - GameOriginManifestIds = ["OFB-EAST:109552677"] - GameOriginWatcherExecutables = ("TS4_x64.exe",) - - def version(self): - return VersionInfo(1, 0, 0, ReleaseType.FINAL) - - def documentsDirectory(self): - return self.dataDirectory() - - def init(self, organizer: IOrganizer): - if super().init(organizer): - self._register_feature(TS4ModDataChecker()) - self._register_feature(TS4ModDataContent()) - return True - return False - - -class TS4ModDataChecker(ModDataChecker): - # .package files are allowed at a maximum depth of 5 subfolders, script files can be at most one level deep - # The first capturing group lazily captures any parent folders exceeding that depth, see below - _fixableOrValid = r"(?i)^(.*?)((?:[^\\]+\\){0,5}[^\\]*\.package|(?:[^\\]+\\)?[^\\]*\.ts4script|(?:[^\\]+\\)scripts\\.*\.py)$" - - def dataLooksValid(self, filetree: IFileTree) -> ModDataChecker.CheckReturn: - return cast( - ModDataChecker.CheckReturn, - self._fixOrValidateTree(filetree, validateMode=True), - ) - - def fix(self, filetree: IFileTree) -> IFileTree | None: - return cast(IFileTree, self._fixOrValidateTree(filetree)) - - def _fixOrValidateTree( - self, - tree: IFileTree, - validateMode: bool = False, - ) -> IFileTree | ModDataChecker.CheckReturn: - validationResult = ValidationResult.INVALID - checkReturn = ModDataChecker.INVALID - walkReturn = IFileTree.CONTINUE - - def setValidationResult( - newResult: ValidationResult = ValidationResult.INVALID, - actionCallback: Callable[[], Any] = lambda: None, - ): - nonlocal validationResult - nonlocal checkReturn - nonlocal walkReturn - if validateMode: - validationResult = max(validationResult, newResult) - match validationResult: - case ValidationResult.INVALID: - pass - case ValidationResult.VALID: - checkReturn = ModDataChecker.VALID - case ValidationResult.FIXABLE: - checkReturn = ModDataChecker.FIXABLE - walkReturn = IFileTree.STOP - else: - actionCallback() - - def fixOrValidateEntry( - parentPath: str, entry: FileTreeEntry - ) -> IFileTree.WalkReturn: - path = f"{parentPath}{entry.name()}" - fixableOrValid = match(self._fixableOrValid, path) - if fixableOrValid: - match fixableOrValid.groups(): - case ["", _]: - setValidationResult(ValidationResult.VALID) - case [_, innerPath]: - # Move files that are nested too deeply up, preserving the inner folder structure - # E.g. a/b/c.ts4script will be moved to b/c.ts4script - setValidationResult( - ValidationResult.FIXABLE, - lambda: tree.move(entry, innerPath), - ) - case _: - pass - return walkReturn - - tree.walk(fixOrValidateEntry) - - if validateMode: - return checkReturn - else: - return tree - - -class TS4ModDataContent(ModDataContent): - def getAllContents(self: ModDataContent) -> List[ModDataContent.Content]: - return [ - ModDataContent.Content( - Content.PACKAGE, "Package", ":/MO/gui/content/plugin" - ), - ModDataContent.Content(Content.SCRIPT, "Script", ":/MO/gui/content/script"), - ] - - def getContentsFor(self: ModDataContent, filetree: IFileTree) -> List[int]: - contents: Set[int] = set() - - def getContentForEntry(path: str, entry: FileTreeEntry): - nonlocal contents - match entry.suffix(): - case "package": - contents.add(Content.PACKAGE) - case "ts4script" | "py": - contents.add(Content.SCRIPT) - case _: - pass - if len(contents) == 2: - return IFileTree.STOP - else: - return IFileTree.CONTINUE - - filetree.walk(getContentForEntry) - return list(contents) +from collections.abc import Callable +from enum import IntEnum +from re import match +from typing import Any, List, Set, cast + +from mobase import ( + FileTreeEntry, + IFileTree, + IOrganizer, + ModDataChecker, + ModDataContent, + ReleaseType, + VersionInfo, +) + +from ..basic_game import BasicGame + + +class Content(IntEnum): + PACKAGE = 0 + SCRIPT = 1 + + +class ValidationResult(IntEnum): + INVALID = 0 + VALID = 1 + FIXABLE = 2 + + +class TS4Game(BasicGame): + Name = "The Sims 4 Support Plugin" + Author = "R3z Shark, xieve" + GameName = "The Sims 4" + GameShortName = "thesims4" + GameBinary = "Game/Bin/TS4_x64.exe" + GameDataPath = "%DOCUMENTS%/Electronic Arts/The Sims 4/Mods" + GameSteamId = 1222670 + GameOriginManifestIds = ["OFB-EAST:109552677"] + GameOriginWatcherExecutables = ("TS4_x64.exe",) + + def version(self): + return VersionInfo(1, 0, 0, ReleaseType.FINAL) + + def documentsDirectory(self): + return self.dataDirectory() + + def init(self, organizer: IOrganizer): + if super().init(organizer): + self._register_feature(TS4ModDataChecker()) + self._register_feature(TS4ModDataContent()) + return True + return False + + +class TS4ModDataChecker(ModDataChecker): + # .package files are allowed at a maximum depth of 5 subfolders, script files can be at most one level deep + # The first capturing group lazily captures any parent folders exceeding that depth, see below + _fixableOrValid = r"(?i)^(.*?)((?:[^\\]+\\){0,5}[^\\]*\.package|(?:[^\\]+\\)?[^\\]*\.ts4script|(?:[^\\]+\\)scripts\\.*\.py)$" + + def dataLooksValid(self, filetree: IFileTree) -> ModDataChecker.CheckReturn: + return cast( + ModDataChecker.CheckReturn, + self._fixOrValidateTree(filetree, validateMode=True), + ) + + def fix(self, filetree: IFileTree) -> IFileTree | None: + return cast(IFileTree, self._fixOrValidateTree(filetree)) + + def _fixOrValidateTree( + self, + tree: IFileTree, + validateMode: bool = False, + ) -> IFileTree | ModDataChecker.CheckReturn: + validationResult = ValidationResult.INVALID + checkReturn = ModDataChecker.INVALID + walkReturn = IFileTree.CONTINUE + + def setValidationResult( + newResult: ValidationResult = ValidationResult.INVALID, + actionCallback: Callable[[], Any] = lambda: None, + ): + nonlocal validationResult + nonlocal checkReturn + nonlocal walkReturn + if validateMode: + validationResult = max(validationResult, newResult) + match validationResult: + case ValidationResult.INVALID: + pass + case ValidationResult.VALID: + checkReturn = ModDataChecker.VALID + case ValidationResult.FIXABLE: + checkReturn = ModDataChecker.FIXABLE + walkReturn = IFileTree.STOP + else: + actionCallback() + + def fixOrValidateEntry( + parentPath: str, entry: FileTreeEntry + ) -> IFileTree.WalkReturn: + path = f"{parentPath}{entry.name()}" + fixableOrValid = match(self._fixableOrValid, path) + if fixableOrValid: + match fixableOrValid.groups(): + case ["", _]: + setValidationResult(ValidationResult.VALID) + case [_, innerPath]: + # Move files that are nested too deeply up, preserving the inner folder structure + # E.g. a/b/c.ts4script will be moved to b/c.ts4script + setValidationResult( + ValidationResult.FIXABLE, + lambda: tree.move(entry, innerPath), + ) + case _: + pass + return walkReturn + + tree.walk(fixOrValidateEntry) + + if validateMode: + return checkReturn + else: + return tree + + +class TS4ModDataContent(ModDataContent): + def getAllContents(self: ModDataContent) -> List[ModDataContent.Content]: + return [ + ModDataContent.Content( + Content.PACKAGE, "Package", ":/MO/gui/content/plugin" + ), + ModDataContent.Content(Content.SCRIPT, "Script", ":/MO/gui/content/script"), + ] + + def getContentsFor(self: ModDataContent, filetree: IFileTree) -> List[int]: + contents: Set[int] = set() + + def getContentForEntry(path: str, entry: FileTreeEntry): + nonlocal contents + match entry.suffix(): + case "package": + contents.add(Content.PACKAGE) + case "ts4script" | "py": + contents.add(Content.SCRIPT) + case _: + pass + if len(contents) == 2: + return IFileTree.STOP + else: + return IFileTree.CONTINUE + + filetree.walk(getContentForEntry) + return list(contents) diff --git a/games/game_stalkeranomaly.py b/games/game_stalkeranomaly.py index 25d60fd..bb40575 100644 --- a/games/game_stalkeranomaly.py +++ b/games/game_stalkeranomaly.py @@ -1,10 +1,11 @@ from enum import IntEnum from pathlib import Path -import mobase from PyQt6.QtCore import QDir, QFileInfo, Qt from PyQt6.QtWidgets import QLabel, QVBoxLayout, QWidget +import mobase + from ..basic_features.basic_save_game_info import ( BasicGameSaveGame, BasicGameSaveGameInfo, diff --git a/games/game_stardewvalley.py b/games/game_stardewvalley.py index fe19582..6397b40 100644 --- a/games/game_stardewvalley.py +++ b/games/game_stardewvalley.py @@ -1,6 +1,7 @@ -import mobase from PyQt6.QtCore import QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_starsector.py b/games/game_starsector.py index 567ce0c..2dc27d9 100644 --- a/games/game_starsector.py +++ b/games/game_starsector.py @@ -1,8 +1,9 @@ from pathlib import Path -import mobase from PyQt6.QtCore import QDir +import mobase + from ..basic_game import BasicGame, BasicGameSaveGame diff --git a/games/game_starwars-empire-at-war-foc.py b/games/game_starwars-empire-at-war-foc.py index 2fc1fa9..188c288 100644 --- a/games/game_starwars-empire-at-war-foc.py +++ b/games/game_starwars-empire-at-war-foc.py @@ -1,6 +1,7 @@ -import mobase from PyQt6.QtCore import QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_starwars-empire-at-war.py b/games/game_starwars-empire-at-war.py index 4fb916a..171ecfc 100644 --- a/games/game_starwars-empire-at-war.py +++ b/games/game_starwars-empire-at-war.py @@ -1,6 +1,7 @@ -import mobase from PyQt6.QtCore import QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_subnautica.py b/games/game_subnautica.py index 5823602..0c33876 100644 --- a/games/game_subnautica.py +++ b/games/game_subnautica.py @@ -6,9 +6,10 @@ from collections.abc import Iterable from enum import Enum from pathlib import Path -import mobase from PyQt6.QtCore import QDir, qWarning +import mobase + from ..basic_features import BasicModDataChecker, GlobPatterns from ..basic_features.basic_save_game_info import ( BasicGameSaveGame, diff --git a/games/game_tdu.py b/games/game_tdu.py index 53deaea..5624ff8 100644 --- a/games/game_tdu.py +++ b/games/game_tdu.py @@ -1,8 +1,9 @@ # -*- encoding: utf-8 -*- -import mobase from PyQt6.QtCore import QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_tdu2.py b/games/game_tdu2.py index fdffd43..f7fd94f 100644 --- a/games/game_tdu2.py +++ b/games/game_tdu2.py @@ -1,8 +1,9 @@ # -*- encoding: utf-8 -*- -import mobase from PyQt6.QtCore import QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_thps3.py b/games/game_thps3.py index b9dbc69..52ea07c 100644 --- a/games/game_thps3.py +++ b/games/game_thps3.py @@ -1,8 +1,9 @@ # -*- encoding: utf-8 -*- -import mobase from PyQt6.QtCore import QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_thps4.py b/games/game_thps4.py index 406bb62..7a7ca0b 100644 --- a/games/game_thps4.py +++ b/games/game_thps4.py @@ -1,8 +1,9 @@ # -*- encoding: utf-8 -*- -import mobase from PyQt6.QtCore import QDir, QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_thug.py b/games/game_thug.py index 17f046f..6a0976f 100644 --- a/games/game_thug.py +++ b/games/game_thug.py @@ -1,8 +1,9 @@ # -*- encoding: utf-8 -*- -import mobase from PyQt6.QtCore import QDir, QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_thug2.py b/games/game_thug2.py index 187d30f..389e204 100644 --- a/games/game_thug2.py +++ b/games/game_thug2.py @@ -2,9 +2,10 @@ import os -import mobase from PyQt6.QtCore import QDir, QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_tmuf.py b/games/game_tmuf.py index 394a367..648da6d 100644 --- a/games/game_tmuf.py +++ b/games/game_tmuf.py @@ -2,9 +2,10 @@ from __future__ import annotations -import mobase from PyQt6.QtCore import QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_trainsimulator.py b/games/game_trainsimulator.py index 08d5e34..dc1d44e 100644 --- a/games/game_trainsimulator.py +++ b/games/game_trainsimulator.py @@ -1,6 +1,7 @@ -import mobase from PyQt6.QtCore import QFileInfo +import mobase + from ..basic_game import BasicGame diff --git a/games/game_valheim.py b/games/game_valheim.py index c2cbc69..7af4fc3 100644 --- a/games/game_valheim.py +++ b/games/game_valheim.py @@ -8,9 +8,10 @@ from dataclasses import dataclass, field from pathlib import Path from typing import Any, Optional, TextIO -import mobase from PyQt6.QtCore import QDir +import mobase + from ..basic_features import BasicLocalSavegames, BasicModDataChecker, GlobPatterns from ..basic_features.basic_save_game_info import BasicGameSaveGame from ..basic_game import BasicGame @@ -29,7 +30,7 @@ class PartialMatch: partial_match_regex: re.Pattern[str] = re.compile(r"[A-Z]?[a-z]+") """Matches words, for e.g. 'Camel' and 'Case' in 'CamelCase'.""" - exclude: set[str] = field(default_factory=set) + exclude: set[str] = field(default_factory=set[str]) min_length: int = 3 def partial_match(self, str_with_parts: str, search_string: str) -> Collection[str]: diff --git a/games/game_vampirebloodlines.py b/games/game_vampirebloodlines.py index 2a2a30f..556406f 100644 --- a/games/game_vampirebloodlines.py +++ b/games/game_vampirebloodlines.py @@ -1,9 +1,10 @@ from pathlib import Path from typing import List -import mobase from PyQt6.QtCore import QDir +import mobase + from ..basic_features import BasicLocalSavegames from ..basic_game import BasicGame, BasicGameSaveGame diff --git a/games/game_witcher1.py b/games/game_witcher1.py index 4fe1a8c..4d76b58 100644 --- a/games/game_witcher1.py +++ b/games/game_witcher1.py @@ -1,9 +1,10 @@ from pathlib import Path from typing import BinaryIO, List -import mobase from PyQt6.QtCore import QDir, QFileInfo +import mobase + from ..basic_game import BasicGame, BasicGameSaveGame diff --git a/games/game_witcher2.py b/games/game_witcher2.py index 1268ee9..d38bb6b 100644 --- a/games/game_witcher2.py +++ b/games/game_witcher2.py @@ -1,9 +1,10 @@ from pathlib import Path from typing import List -import mobase from PyQt6.QtCore import QDir +import mobase + from ..basic_features import BasicGameSaveGameInfo from ..basic_features.basic_save_game_info import BasicGameSaveGame from ..basic_game import BasicGame diff --git a/games/game_witcher3.py b/games/game_witcher3.py index 1bc5e8e..ff64df2 100644 --- a/games/game_witcher3.py +++ b/games/game_witcher3.py @@ -1,9 +1,10 @@ from pathlib import Path from typing import List -import mobase from PyQt6.QtCore import QDir +import mobase + from ..basic_features import BasicGameSaveGameInfo from ..basic_features.basic_save_game_info import BasicGameSaveGame from ..basic_game import BasicGame diff --git a/poetry.lock b/poetry.lock index 386aa5d..fa62e2c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.0.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.2 and should not be changed by hand. [[package]] name = "lzokay" @@ -67,22 +67,22 @@ files = [ [[package]] name = "poethepoet" -version = "0.23.0" +version = "0.34.0" description = "A task runner that works well with poetry." optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" groups = ["dev"] files = [ - {file = "poethepoet-0.23.0-py3-none-any.whl", hash = "sha256:d573ff31d7678e62b6f9bc9a1291ae2009ac14e0eead0a450598f9f05abb27a3"}, - {file = "poethepoet-0.23.0.tar.gz", hash = "sha256:62a0a6a518df5985c191aee0c1fcd2bb6a0a04eb102997786fcdf118e4147d22"}, + {file = "poethepoet-0.34.0-py3-none-any.whl", hash = "sha256:c472d6f0fdb341b48d346f4ccd49779840c15b30dfd6bc6347a80d6274b5e34e"}, + {file = "poethepoet-0.34.0.tar.gz", hash = "sha256:86203acce555bbfe45cb6ccac61ba8b16a5784264484195874da457ddabf5850"}, ] [package.dependencies] pastel = ">=0.2.1,<0.3.0" -tomli = ">=1.2.2" +pyyaml = ">=6.0.2,<7.0" [package.extras] -poetry-plugin = ["poetry (>=1.0,<2.0)"] +poetry-plugin = ["poetry (>=1.2.0,<3.0.0) ; python_version < \"4.0\""] [[package]] name = "psutil" @@ -111,7 +111,7 @@ files = [ ] [package.extras] -test = ["enum34", "ipaddress", "mock", "pywin32", "wmi"] +test = ["enum34 ; python_version <= \"3.4\"", "ipaddress ; python_version < \"3.0\"", "mock ; python_version < \"3.0\"", "pywin32 ; sys_platform == \"win32\"", "wmi ; sys_platform == \"win32\""] [[package]] name = "pyqt6" @@ -185,14 +185,14 @@ files = [ [[package]] name = "pyright" -version = "1.1.394" +version = "1.1.400" description = "Command line wrapper for pyright" optional = false python-versions = ">=3.7" groups = ["dev"] files = [ - {file = "pyright-1.1.394-py3-none-any.whl", hash = "sha256:5f74cce0a795a295fb768759bbeeec62561215dea657edcaab48a932b031ddbb"}, - {file = "pyright-1.1.394.tar.gz", hash = "sha256:56f2a3ab88c5214a451eb71d8f2792b7700434f841ea219119ade7f42ca93608"}, + {file = "pyright-1.1.400-py3-none-any.whl", hash = "sha256:c80d04f98b5a4358ad3a35e241dbf2a408eee33a40779df365644f8054d2517e"}, + {file = "pyright-1.1.400.tar.gz", hash = "sha256:b8a3ba40481aa47ba08ffb3228e821d22f7d391f83609211335858bf05686bdb"}, ] [package.dependencies] @@ -204,73 +204,95 @@ all = ["nodejs-wheel-binaries", "twine (>=3.4.1)"] dev = ["twine (>=3.4.1)"] nodejs = ["nodejs-wheel-binaries"] +[[package]] +name = "pyyaml" +version = "6.0.2" +description = "YAML parser and emitter for Python" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086"}, + {file = "PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8824b5a04a04a047e72eea5cec3bc266db09e35de6bdfe34c9436ac5ee27d237"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7c36280e6fb8385e520936c3cb3b8042851904eba0e58d277dca80a5cfed590b"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed"}, + {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:936d68689298c36b53b29f23c6dbb74de12b4ac12ca6cfe0e047bedceea56180"}, + {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:23502f431948090f597378482b4812b0caae32c22213aecf3b55325e049a6c68"}, + {file = "PyYAML-6.0.2-cp310-cp310-win32.whl", hash = "sha256:2e99c6826ffa974fe6e27cdb5ed0021786b03fc98e5ee3c5bfe1fd5015f42b99"}, + {file = "PyYAML-6.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:a4d3091415f010369ae4ed1fc6b79def9416358877534caf6a0fdd2146c87a3e"}, + {file = "PyYAML-6.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cc1c1159b3d456576af7a3e4d1ba7e6924cb39de8f67111c735f6fc832082774"}, + {file = "PyYAML-6.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1e2120ef853f59c7419231f3bf4e7021f1b936f6ebd222406c3b60212205d2ee"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d225db5a45f21e78dd9358e58a98702a0302f2659a3c6cd320564b75b86f47c"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ac9328ec4831237bec75defaf839f7d4564be1e6b25ac710bd1a96321cc8317"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85"}, + {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4"}, + {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:797b4f722ffa07cc8d62053e4cff1486fa6dc094105d13fea7b1de7d8bf71c9e"}, + {file = "PyYAML-6.0.2-cp311-cp311-win32.whl", hash = "sha256:11d8f3dd2b9c1207dcaf2ee0bbbfd5991f571186ec9cc78427ba5bd32afae4b5"}, + {file = "PyYAML-6.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:e10ce637b18caea04431ce14fabcf5c64a1c61ec9c56b071a4b7ca131ca52d44"}, + {file = "PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab"}, + {file = "PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476"}, + {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48"}, + {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b"}, + {file = "PyYAML-6.0.2-cp312-cp312-win32.whl", hash = "sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4"}, + {file = "PyYAML-6.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8"}, + {file = "PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba"}, + {file = "PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5"}, + {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc"}, + {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652"}, + {file = "PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183"}, + {file = "PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563"}, + {file = "PyYAML-6.0.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:24471b829b3bf607e04e88d79542a9d48bb037c2267d7927a874e6c205ca7e9a"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7fded462629cfa4b685c5416b949ebad6cec74af5e2d42905d41e257e0869f5"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d84a1718ee396f54f3a086ea0a66d8e552b2ab2017ef8b420e92edbc841c352d"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9056c1ecd25795207ad294bcf39f2db3d845767be0ea6e6a34d856f006006083"}, + {file = "PyYAML-6.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:82d09873e40955485746739bcb8b4586983670466c23382c19cffecbf1fd8706"}, + {file = "PyYAML-6.0.2-cp38-cp38-win32.whl", hash = "sha256:43fa96a3ca0d6b1812e01ced1044a003533c47f6ee8aca31724f78e93ccc089a"}, + {file = "PyYAML-6.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:01179a4a8559ab5de078078f37e5c1a30d76bb88519906844fd7bdea1b7729ff"}, + {file = "PyYAML-6.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:688ba32a1cffef67fd2e9398a2efebaea461578b0923624778664cc1c914db5d"}, + {file = "PyYAML-6.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8786accb172bd8afb8be14490a16625cbc387036876ab6ba70912730faf8e1f"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8e03406cac8513435335dbab54c0d385e4a49e4945d2909a581c83647ca0290"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19"}, + {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0b69e4ce7a131fe56b7e4d770c67429700908fc0752af059838b1cfb41960e4e"}, + {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a9f8c2e67970f13b16084e04f134610fd1d374bf477b17ec1599185cf611d725"}, + {file = "PyYAML-6.0.2-cp39-cp39-win32.whl", hash = "sha256:6395c297d42274772abc367baaa79683958044e5d3835486c16da75d2a694631"}, + {file = "PyYAML-6.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:39693e1f8320ae4f43943590b49779ffb98acb81f788220ea932a6b6c51004d8"}, + {file = "pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e"}, +] + [[package]] name = "ruff" -version = "0.2.2" +version = "0.11.7" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" groups = ["dev"] files = [ - {file = "ruff-0.2.2-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:0a9efb032855ffb3c21f6405751d5e147b0c6b631e3ca3f6b20f917572b97eb6"}, - {file = "ruff-0.2.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:d450b7fbff85913f866a5384d8912710936e2b96da74541c82c1b458472ddb39"}, - {file = "ruff-0.2.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ecd46e3106850a5c26aee114e562c329f9a1fbe9e4821b008c4404f64ff9ce73"}, - {file = "ruff-0.2.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e22676a5b875bd72acd3d11d5fa9075d3a5f53b877fe7b4793e4673499318ba"}, - {file = "ruff-0.2.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1695700d1e25a99d28f7a1636d85bafcc5030bba9d0578c0781ba1790dbcf51c"}, - {file = "ruff-0.2.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:b0c232af3d0bd8f521806223723456ffebf8e323bd1e4e82b0befb20ba18388e"}, - {file = "ruff-0.2.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f63d96494eeec2fc70d909393bcd76c69f35334cdbd9e20d089fb3f0640216ca"}, - {file = "ruff-0.2.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6a61ea0ff048e06de273b2e45bd72629f470f5da8f71daf09fe481278b175001"}, - {file = "ruff-0.2.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5e1439c8f407e4f356470e54cdecdca1bd5439a0673792dbe34a2b0a551a2fe3"}, - {file = "ruff-0.2.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:940de32dc8853eba0f67f7198b3e79bc6ba95c2edbfdfac2144c8235114d6726"}, - {file = "ruff-0.2.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0c126da55c38dd917621552ab430213bdb3273bb10ddb67bc4b761989210eb6e"}, - {file = "ruff-0.2.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:3b65494f7e4bed2e74110dac1f0d17dc8e1f42faaa784e7c58a98e335ec83d7e"}, - {file = "ruff-0.2.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1ec49be4fe6ddac0503833f3ed8930528e26d1e60ad35c2446da372d16651ce9"}, - {file = "ruff-0.2.2-py3-none-win32.whl", hash = "sha256:d920499b576f6c68295bc04e7b17b6544d9d05f196bb3aac4358792ef6f34325"}, - {file = "ruff-0.2.2-py3-none-win_amd64.whl", hash = "sha256:cc9a91ae137d687f43a44c900e5d95e9617cb37d4c989e462980ba27039d239d"}, - {file = "ruff-0.2.2-py3-none-win_arm64.whl", hash = "sha256:c9d15fc41e6054bfc7200478720570078f0b41c9ae4f010bcc16bd6f4d1aacdd"}, - {file = "ruff-0.2.2.tar.gz", hash = "sha256:e62ed7f36b3068a30ba39193a14274cd706bc486fad521276458022f7bccb31d"}, -] - -[[package]] -name = "tomli" -version = "2.2.1" -description = "A lil' TOML parser" -optional = false -python-versions = ">=3.8" -groups = ["dev"] -files = [ - {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, - {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, - {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a"}, - {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee"}, - {file = "tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e"}, - {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4"}, - {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106"}, - {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8"}, - {file = "tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff"}, - {file = "tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b"}, - {file = "tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea"}, - {file = "tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8"}, - {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192"}, - {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222"}, - {file = "tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77"}, - {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6"}, - {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd"}, - {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e"}, - {file = "tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98"}, - {file = "tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4"}, - {file = "tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7"}, - {file = "tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c"}, - {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13"}, - {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281"}, - {file = "tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272"}, - {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140"}, - {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2"}, - {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744"}, - {file = "tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec"}, - {file = "tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69"}, - {file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"}, - {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, + {file = "ruff-0.11.7-py3-none-linux_armv6l.whl", hash = "sha256:d29e909d9a8d02f928d72ab7837b5cbc450a5bdf578ab9ebee3263d0a525091c"}, + {file = "ruff-0.11.7-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:dd1fb86b168ae349fb01dd497d83537b2c5541fe0626e70c786427dd8363aaee"}, + {file = "ruff-0.11.7-py3-none-macosx_11_0_arm64.whl", hash = "sha256:d3d7d2e140a6fbbc09033bce65bd7ea29d6a0adeb90b8430262fbacd58c38ada"}, + {file = "ruff-0.11.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4809df77de390a1c2077d9b7945d82f44b95d19ceccf0c287c56e4dc9b91ca64"}, + {file = "ruff-0.11.7-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f3a0c2e169e6b545f8e2dba185eabbd9db4f08880032e75aa0e285a6d3f48201"}, + {file = "ruff-0.11.7-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:49b888200a320dd96a68e86736cf531d6afba03e4f6cf098401406a257fcf3d6"}, + {file = "ruff-0.11.7-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:2b19cdb9cf7dae00d5ee2e7c013540cdc3b31c4f281f1dacb5a799d610e90db4"}, + {file = "ruff-0.11.7-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:64e0ee994c9e326b43539d133a36a455dbaab477bc84fe7bfbd528abe2f05c1e"}, + {file = "ruff-0.11.7-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bad82052311479a5865f52c76ecee5d468a58ba44fb23ee15079f17dd4c8fd63"}, + {file = "ruff-0.11.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7940665e74e7b65d427b82bffc1e46710ec7f30d58b4b2d5016e3f0321436502"}, + {file = "ruff-0.11.7-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:169027e31c52c0e36c44ae9a9c7db35e505fee0b39f8d9fca7274a6305295a92"}, + {file = "ruff-0.11.7-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:305b93f9798aee582e91e34437810439acb28b5fc1fee6b8205c78c806845a94"}, + {file = "ruff-0.11.7-py3-none-musllinux_1_2_i686.whl", hash = "sha256:a681db041ef55550c371f9cd52a3cf17a0da4c75d6bd691092dfc38170ebc4b6"}, + {file = "ruff-0.11.7-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:07f1496ad00a4a139f4de220b0c97da6d4c85e0e4aa9b2624167b7d4d44fd6b6"}, + {file = "ruff-0.11.7-py3-none-win32.whl", hash = "sha256:f25dfb853ad217e6e5f1924ae8a5b3f6709051a13e9dad18690de6c8ff299e26"}, + {file = "ruff-0.11.7-py3-none-win_amd64.whl", hash = "sha256:0a931d85959ceb77e92aea4bbedfded0a31534ce191252721128f77e5ae1f98a"}, + {file = "ruff-0.11.7-py3-none-win_arm64.whl", hash = "sha256:778c1e5d6f9e91034142dfd06110534ca13220bfaad5c3735f6cb844654f6177"}, + {file = "ruff-0.11.7.tar.gz", hash = "sha256:655089ad3224070736dc32844fde783454f8558e71f501cb207485fe4eee23d4"}, ] [[package]] @@ -312,4 +334,4 @@ files = [ [metadata] lock-version = "2.1" python-versions = ">=3.12,<4.0" -content-hash = "ca7548bcf14bff97022fad3dbec826194116c3003cb984b73859d8f6d75af8ae" +content-hash = "77f80ef6ef2075043826e77efc80fdacc537705142b39493709d7391481ab784" diff --git a/pyproject.toml b/pyproject.toml index f7678a9..3ec5c87 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,10 +22,10 @@ pyqt6 = "6.7.0" [tool.poetry.group.dev.dependencies] mobase-stubs = "^2.5.2" pyqt6 = "^6.7.0" -pyright = "^1.1.365" -ruff = "^0.2.1" +pyright = "^1.1.400" +ruff = "^0.11.7" types-psutil = "^5.9.5.20240516" -poethepoet = "^0.23.0" +poethepoet = "^0.34.0" [build-system] requires = ["poetry-core (>=2.0)"] @@ -48,7 +48,7 @@ target-version = "py310" extend-select = ["B", "Q", "I"] [tool.ruff.lint.isort] -known-first-party = ["tas"] +known-first-party = ["mobase"] [tool.pyright] exclude = ["lib", "**/.*", "venv"]