mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Simplify code
This commit is contained in:
parent
7c97045fb6
commit
5494ce5def
2 changed files with 3 additions and 7 deletions
|
@ -488,7 +488,7 @@
|
||||||
"log_user_update": "Update info for user '{}'",
|
"log_user_update": "Update info for user '{}'",
|
||||||
"log_settings_set": "Apply settings",
|
"log_settings_set": "Apply settings",
|
||||||
"log_settings_reset": "Reset setting",
|
"log_settings_reset": "Reset setting",
|
||||||
"log_settings_reset_all": "Reset all setting",
|
"log_settings_reset_all": "Reset all settings",
|
||||||
"mail_alias_remove_failed": "Could not remove e-mail alias '{mail}'",
|
"mail_alias_remove_failed": "Could not remove e-mail alias '{mail}'",
|
||||||
"mail_domain_unknown": "Invalid e-mail address for domain '{domain}'. Please, use a domain administrated by this server.",
|
"mail_domain_unknown": "Invalid e-mail address for domain '{domain}'. Please, use a domain administrated by this server.",
|
||||||
"mail_forward_remove_failed": "Could not remove e-mail forwarding '{mail}'",
|
"mail_forward_remove_failed": "Could not remove e-mail forwarding '{mail}'",
|
||||||
|
|
|
@ -15,10 +15,6 @@ logger = getActionLogger("yunohost.settings")
|
||||||
|
|
||||||
SETTINGS_PATH = "/etc/yunohost/settings.yml"
|
SETTINGS_PATH = "/etc/yunohost/settings.yml"
|
||||||
|
|
||||||
BOOLEANS = {
|
|
||||||
"True": True,
|
|
||||||
"False": False,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def settings_get(key="", full=False, export=False):
|
def settings_get(key="", full=False, export=False):
|
||||||
|
@ -136,8 +132,8 @@ class SettingsConfigPanel(ConfigPanel):
|
||||||
return self.config
|
return self.config
|
||||||
|
|
||||||
# Dirty hack to let settings_get() to work from a python script
|
# Dirty hack to let settings_get() to work from a python script
|
||||||
if isinstance(result, str) and result in BOOLEANS:
|
if isinstance(result, str) and result in ["True", "False"]:
|
||||||
result = BOOLEANS[result]
|
result = bool(result)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue