mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
🎨 Format Python code with Black
This commit is contained in:
parent
dd8db1883a
commit
0bd69e5622
1 changed files with 14 additions and 2 deletions
16
src/app.py
16
src/app.py
|
@ -2993,7 +2993,16 @@ def _make_environment_for_app_script(
|
||||||
if manifest["packaging_format"] >= 2 or force_include_app_settings:
|
if manifest["packaging_format"] >= 2 or force_include_app_settings:
|
||||||
env_dict["app"] = app
|
env_dict["app"] = app
|
||||||
data_to_redact = []
|
data_to_redact = []
|
||||||
prefixes_or_suffixes_to_redact = ["pwd", "pass", "passwd", "password", "passphrase", "secret", "key", "token"]
|
prefixes_or_suffixes_to_redact = [
|
||||||
|
"pwd",
|
||||||
|
"pass",
|
||||||
|
"passwd",
|
||||||
|
"password",
|
||||||
|
"passphrase",
|
||||||
|
"secret",
|
||||||
|
"key",
|
||||||
|
"token",
|
||||||
|
]
|
||||||
|
|
||||||
for setting_name, setting_value in _get_app_settings(app).items():
|
for setting_name, setting_value in _get_app_settings(app).items():
|
||||||
# Ignore special internal settings like checksum__
|
# Ignore special internal settings like checksum__
|
||||||
|
@ -3006,7 +3015,10 @@ def _make_environment_for_app_script(
|
||||||
|
|
||||||
# Check if we should redact this setting value
|
# Check if we should redact this setting value
|
||||||
# (the check on the setting length exists to prevent stupid stuff like redacting empty string or something which is actually just 0/1, true/false, ...
|
# (the check on the setting length exists to prevent stupid stuff like redacting empty string or something which is actually just 0/1, true/false, ...
|
||||||
if len(setting_value) > 6 and any(setting_name.startswith(p) or setting_name.endswith(p) for p in prefixes_or_suffixes_to_redact):
|
if len(setting_value) > 6 and any(
|
||||||
|
setting_name.startswith(p) or setting_name.endswith(p)
|
||||||
|
for p in prefixes_or_suffixes_to_redact
|
||||||
|
):
|
||||||
data_to_redact.append(setting_value)
|
data_to_redact.append(setting_value)
|
||||||
|
|
||||||
# Special weird case for backward compatibility...
|
# Special weird case for backward compatibility...
|
||||||
|
|
Loading…
Add table
Reference in a new issue