From 066a0960e112306b12bfeeb6106ce749956b4b32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Sun, 11 Aug 2024 14:02:20 +0200 Subject: [PATCH] Fix for linting. --- basic_games/basic_game.py | 2 +- basic_games/games/game_cyberpunk2077.py | 18 +++++++++--------- basic_games/games/game_subnautica.py | 4 ++-- basic_games/games/game_valheim.py | 6 +++--- poetry.lock | 8 ++++---- pyproject.toml | 1 + 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/basic_games/basic_game.py b/basic_games/basic_game.py index d0a566e..74ab84e 100644 --- a/basic_games/basic_game.py +++ b/basic_games/basic_game.py @@ -472,7 +472,7 @@ def isActive(self) -> bool: # Note: self is self._organizer.managedGame() does not work: return self.name() == self._organizer.managedGame().name() - def settings(self) -> list[mobase.PluginSetting]: + def settings(self) -> list[mobase.Setting]: return [] # IPluginGame interface: diff --git a/basic_games/games/game_cyberpunk2077.py b/basic_games/games/game_cyberpunk2077.py index 565e763..e20f05d 100644 --- a/basic_games/games/game_cyberpunk2077.py +++ b/basic_games/games/game_cyberpunk2077.py @@ -393,9 +393,9 @@ def listSaves(self, folder: QDir) -> list[mobase.ISaveGame]: for path in Path(folder.absolutePath()).glob(f"**/*.{ext}") ] - def settings(self) -> list[mobase.PluginSetting]: + def settings(self) -> list[mobase.Setting]: return [ - mobase.PluginSetting( + mobase.Setting( "skipStartScreen", self.tr("Skip start screen"), self.tr( @@ -404,7 +404,7 @@ def settings(self) -> list[mobase.PluginSetting]: ), False, ), - mobase.PluginSetting( + mobase.Setting( "enforce_archive_load_order", self.tr("Enforce archive load order"), self.tr( @@ -413,7 +413,7 @@ def settings(self) -> list[mobase.PluginSetting]: ), False, ), - mobase.PluginSetting( + mobase.Setting( "reverse_archive_load_order", self.tr("Reverse archive load order"), self.tr( @@ -423,13 +423,13 @@ def settings(self) -> list[mobase.PluginSetting]: ), False, ), - mobase.PluginSetting( + mobase.Setting( "enforce_redmod_load_order", self.tr("Enforce RedMod load order"), self.tr("Enforce the current load order on redmod deployment"), True, ), - mobase.PluginSetting( + mobase.Setting( "reverse_redmod_load_order", self.tr("Reverse RedMod load order"), self.tr( @@ -438,13 +438,13 @@ def settings(self) -> list[mobase.PluginSetting]: ), False, ), - mobase.PluginSetting( + mobase.Setting( "auto_deploy_redmod", self.tr("Auto deploy RedMod"), self.tr("Deploy redmod before game launch if necessary"), True, ), - mobase.PluginSetting( + mobase.Setting( "clear_cache_after_game_update", self.tr("Clear cache after game update"), self.tr( @@ -453,7 +453,7 @@ def settings(self) -> list[mobase.PluginSetting]: ), True, ), - mobase.PluginSetting( + mobase.Setting( "configure_RootBuilder", self.tr("Configure RootBuilder"), self.tr( diff --git a/basic_games/games/game_subnautica.py b/basic_games/games/game_subnautica.py index 597af17..f2581a3 100644 --- a/basic_games/games/game_subnautica.py +++ b/basic_games/games/game_subnautica.py @@ -155,9 +155,9 @@ def _settings_change_callback( if plugin_name == self.name() and setting == "use_qmods": self._set_mod_data_checker(use_qmod=bool(new)) - def settings(self) -> list[mobase.PluginSetting]: + def settings(self) -> list[mobase.Setting]: return [ - mobase.PluginSetting( + mobase.Setting( "use_qmods", self.tr("Use QMods"), self.tr( diff --git a/basic_games/games/game_valheim.py b/basic_games/games/game_valheim.py index a165b74..8831079 100644 --- a/basic_games/games/game_valheim.py +++ b/basic_games/games/game_valheim.py @@ -380,17 +380,17 @@ def listSaves(self, folder: QDir) -> list[mobase.ISaveGame]: save_games.extend(ValheimWorldSaveGame(f) for f in path.glob("worlds/*.fwl")) return save_games - def settings(self) -> list[mobase.PluginSetting]: + def settings(self) -> list[mobase.Setting]: settings = super().settings() settings.extend( [ - mobase.PluginSetting( + mobase.Setting( "sync_overwrite", self.tr("Synchronize overwrite"), self.tr("Synchronize overwrite with mods"), True, ), - mobase.PluginSetting( + mobase.Setting( "search_overwrite_file_content", self.tr("Search overwrite file content"), self.tr("Search content of files in overwrite for matching mod"), diff --git a/poetry.lock b/poetry.lock index 061318f..aa170db 100644 --- a/poetry.lock +++ b/poetry.lock @@ -30,13 +30,13 @@ test = ["pytest"] [[package]] name = "mobase-stubs" -version = "2.5.2" +version = "2.6.0.dev1" description = "PEP561 stub files for the mobase Python API." optional = false python-versions = "<4.0,>=3.12" files = [ - {file = "mobase_stubs-2.5.2-py3-none-any.whl", hash = "sha256:6a2c1c95494e7dc0d0f51d4f8f178423c0d9904f823f3c44845315bff304b948"}, - {file = "mobase_stubs-2.5.2.tar.gz", hash = "sha256:70c15579828df3bce01746e51fee07176390cdc386facea2b156ea04b3de055c"}, + {file = "mobase_stubs-2.6.0.dev1-py3-none-any.whl", hash = "sha256:466ea5def13135ce71cef4dbc4f9c3d0ece4e7098dc3fd99d9d3773d1b912360"}, + {file = "mobase_stubs-2.6.0.dev1.tar.gz", hash = "sha256:21042d1dfca439fbee6cd346b82d98e6d0d322d6970f746e2cf2c1969445988a"}, ] [[package]] @@ -252,4 +252,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.12" -content-hash = "bf3a3c93fd61401cf3fd50f4f0181dec6e2bf099537363b191a528af44616ef0" +content-hash = "52c74fb9a8276de98403f513ced8f1bcb13ef5acd075bbf827ede19f7ec99113" diff --git a/pyproject.toml b/pyproject.toml index 30f047f..5c743de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,6 +14,7 @@ psutil = "^5.8.0" vdf = "3.4" lzokay = "1.1.5" pyqt6 = "6.7.1" +mobase-stubs = {version = "^2.6.0.dev1", allow-prereleases = true} [tool.poetry.group.dev.dependencies] mobase-stubs = "^2.5.2"