From 186e61903a3d5a689854b783761fb388d97be959 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 6 Dec 2022 22:36:37 +0000 Subject: [PATCH] [CI] Format code with Black --- src/utils/config.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/utils/config.py b/src/utils/config.py index 7e414ac9b..072362f97 100644 --- a/src/utils/config.py +++ b/src/utils/config.py @@ -651,19 +651,23 @@ class ConfigPanel: raw_msg=True, ) value = self.values[option["name"]] - + # Allow to use value instead of current_value in app config script. # e.g. apps may write `echo 'value: "foobar"'` in the config file (which is more intuitive that `echo 'current_value: "foobar"'` # For example hotspot used it... # See https://github.com/YunoHost/yunohost/pull/1546 - if isinstance(value, dict) and "value" in value and "current_value" not in value: + if ( + isinstance(value, dict) + and "value" in value + and "current_value" not in value + ): value["current_value"] = value["value"] - + # In general, the value is just a simple value. # Sometimes it could be a dict used to overwrite the option itself value = value if isinstance(value, dict) else {"current_value": value} option.update(value) - + self.values[option["id"]] = value.get("current_value") return self.values