From ec2ffe6813b22117a8ae9751ec8befd9b1f8836a Mon Sep 17 00:00:00 2001 From: axolotle Date: Thu, 9 Nov 2023 14:52:58 +0100 Subject: [PATCH] configpanel: remove unused arg 'config' from `_get_raw_settings()` --- src/app.py | 4 ++-- src/settings.py | 4 ++-- src/utils/configpanel.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app.py b/src/app.py index 1116feb73..482e880e4 100644 --- a/src/app.py +++ b/src/app.py @@ -75,7 +75,7 @@ from yunohost.app_catalog import ( # noqa if TYPE_CHECKING: from pydantic.typing import AbstractSetIntStr, MappingIntStrAny - from yunohost.utils.configpanel import ConfigPanelModel, RawSettings + from yunohost.utils.configpanel import RawSettings from yunohost.utils.form import FormModel logger = getLogger("yunohost.app") @@ -1809,7 +1809,7 @@ class AppConfigPanel(ConfigPanel): config_path_tpl = os.path.join(APPS_SETTING_PATH, "{entity}/config_panel.toml") settings_must_be_defined: bool = True - def _get_raw_settings(self, config: "ConfigPanelModel") -> "RawSettings": + def _get_raw_settings(self) -> "RawSettings": return self._call_config_script("show") def _apply( diff --git a/src/settings.py b/src/settings.py index 77c2de5d8..a8ec0998e 100644 --- a/src/settings.py +++ b/src/settings.py @@ -215,8 +215,8 @@ class SettingsConfigPanel(ConfigPanel): return raw_config - def _get_raw_settings(self, config: "ConfigPanelModel") -> "RawSettings": - raw_settings = super()._get_raw_settings(config) + def _get_raw_settings(self) -> "RawSettings": + raw_settings = super()._get_raw_settings() # Specific logic for those settings who are "virtual" settings # and only meant to have a custom setter mapped to tools_rootpw diff --git a/src/utils/configpanel.py b/src/utils/configpanel.py index 073792b41..e7dd09352 100644 --- a/src/utils/configpanel.py +++ b/src/utils/configpanel.py @@ -694,7 +694,7 @@ class ConfigPanel: return read_toml(self.config_path) - def _get_raw_settings(self, config: ConfigPanelModel) -> "RawSettings": + def _get_raw_settings(self) -> "RawSettings": if not self.save_path or not os.path.exists(self.save_path): return {} # raise YunohostValidationError("config_no_settings") @@ -733,7 +733,7 @@ class ConfigPanel: def _get_partial_raw_settings_and_mutate_config( self, config: ConfigPanelModel ) -> tuple[ConfigPanelModel, "RawSettings"]: - raw_settings = self._get_raw_settings(config) + raw_settings = self._get_raw_settings() # Save `raw_settings` for diff at `_apply` self.raw_settings = raw_settings values = {}