mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
configpanel: remove unused arg 'config' from _get_raw_settings()
This commit is contained in:
parent
6bcc3dd1c0
commit
ec2ffe6813
3 changed files with 6 additions and 6 deletions
|
@ -75,7 +75,7 @@ from yunohost.app_catalog import ( # noqa
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from pydantic.typing import AbstractSetIntStr, MappingIntStrAny
|
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
|
from yunohost.utils.form import FormModel
|
||||||
|
|
||||||
logger = getLogger("yunohost.app")
|
logger = getLogger("yunohost.app")
|
||||||
|
@ -1809,7 +1809,7 @@ class AppConfigPanel(ConfigPanel):
|
||||||
config_path_tpl = os.path.join(APPS_SETTING_PATH, "{entity}/config_panel.toml")
|
config_path_tpl = os.path.join(APPS_SETTING_PATH, "{entity}/config_panel.toml")
|
||||||
settings_must_be_defined: bool = True
|
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")
|
return self._call_config_script("show")
|
||||||
|
|
||||||
def _apply(
|
def _apply(
|
||||||
|
|
|
@ -215,8 +215,8 @@ class SettingsConfigPanel(ConfigPanel):
|
||||||
|
|
||||||
return raw_config
|
return raw_config
|
||||||
|
|
||||||
def _get_raw_settings(self, config: "ConfigPanelModel") -> "RawSettings":
|
def _get_raw_settings(self) -> "RawSettings":
|
||||||
raw_settings = super()._get_raw_settings(config)
|
raw_settings = super()._get_raw_settings()
|
||||||
|
|
||||||
# Specific logic for those settings who are "virtual" settings
|
# Specific logic for those settings who are "virtual" settings
|
||||||
# and only meant to have a custom setter mapped to tools_rootpw
|
# and only meant to have a custom setter mapped to tools_rootpw
|
||||||
|
|
|
@ -694,7 +694,7 @@ class ConfigPanel:
|
||||||
|
|
||||||
return read_toml(self.config_path)
|
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):
|
if not self.save_path or not os.path.exists(self.save_path):
|
||||||
return {}
|
return {}
|
||||||
# raise YunohostValidationError("config_no_settings")
|
# raise YunohostValidationError("config_no_settings")
|
||||||
|
@ -733,7 +733,7 @@ class ConfigPanel:
|
||||||
def _get_partial_raw_settings_and_mutate_config(
|
def _get_partial_raw_settings_and_mutate_config(
|
||||||
self, config: ConfigPanelModel
|
self, config: ConfigPanelModel
|
||||||
) -> tuple[ConfigPanelModel, "RawSettings"]:
|
) -> tuple[ConfigPanelModel, "RawSettings"]:
|
||||||
raw_settings = self._get_raw_settings(config)
|
raw_settings = self._get_raw_settings()
|
||||||
# Save `raw_settings` for diff at `_apply`
|
# Save `raw_settings` for diff at `_apply`
|
||||||
self.raw_settings = raw_settings
|
self.raw_settings = raw_settings
|
||||||
values = {}
|
values = {}
|
||||||
|
|
Loading…
Add table
Reference in a new issue