mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
python3: Add some list() where that sounds relevant
This commit is contained in:
parent
4ddf632e75
commit
2b12b67847
5 changed files with 7 additions and 7 deletions
|
@ -2301,7 +2301,7 @@ def _value_for_locale(values):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Fallback to first value
|
# Fallback to first value
|
||||||
return values.values()[0]
|
return list(values.values())[0]
|
||||||
|
|
||||||
|
|
||||||
def _check_manifest_requirements(manifest, app_instance_name):
|
def _check_manifest_requirements(manifest, app_instance_name):
|
||||||
|
|
|
@ -600,7 +600,7 @@ class BackupManager():
|
||||||
for hook, infos in ret.items()
|
for hook, infos in ret.items()
|
||||||
if any(result["state"] == "failed" for result in infos.values())}
|
if any(result["state"] == "failed" for result in infos.values())}
|
||||||
|
|
||||||
if ret_succeed.keys() != []:
|
if list(ret_succeed.keys()) != []:
|
||||||
self.system_return = ret_succeed
|
self.system_return = ret_succeed
|
||||||
|
|
||||||
# Add files from targets (which they put in the CSV) to the list of
|
# Add files from targets (which they put in the CSV) to the list of
|
||||||
|
|
|
@ -106,7 +106,7 @@ def user_permission_list(short=False, full=False, ignore_system_perms=False, abs
|
||||||
infos["label"] = "%s (%s)" % (main_perm_label, infos["label"])
|
infos["label"] = "%s (%s)" % (main_perm_label, infos["label"])
|
||||||
|
|
||||||
if short:
|
if short:
|
||||||
permissions = permissions.keys()
|
permissions = list(permissions.keys())
|
||||||
|
|
||||||
return {'permissions': permissions}
|
return {'permissions': permissions}
|
||||||
|
|
||||||
|
@ -668,7 +668,7 @@ def _validate_and_sanitize_permission_url(url, app_base_path, app):
|
||||||
For example:
|
For example:
|
||||||
re:/api/[A-Z]*$ -> domain.tld/app/api/[A-Z]*$
|
re:/api/[A-Z]*$ -> domain.tld/app/api/[A-Z]*$
|
||||||
re:domain.tld/app/api/[A-Z]*$ -> domain.tld/app/api/[A-Z]*$
|
re:domain.tld/app/api/[A-Z]*$ -> domain.tld/app/api/[A-Z]*$
|
||||||
|
|
||||||
We can also have less-trivial regexes like:
|
We can also have less-trivial regexes like:
|
||||||
re:^\/api\/.*|\/scripts\/api.js$
|
re:^\/api\/.*|\/scripts\/api.js$
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -490,7 +490,7 @@ def service_regen_conf(names=[], with_diff=False, force=False, dry_run=False,
|
||||||
raise YunohostError('service_unknown', service=name)
|
raise YunohostError('service_unknown', service=name)
|
||||||
|
|
||||||
if names is []:
|
if names is []:
|
||||||
names = services.keys()
|
names = list(services.keys())
|
||||||
|
|
||||||
logger.warning(m18n.n("service_regen_conf_is_deprecated"))
|
logger.warning(m18n.n("service_regen_conf_is_deprecated"))
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ class SetupGroupPermissions():
|
||||||
|
|
||||||
url = "/" if domain and path else None
|
url = "/" if domain and path else None
|
||||||
if permission:
|
if permission:
|
||||||
known_users = user_list()["users"].keys()
|
known_users = list(user_list()["users"].keys())
|
||||||
allowed = [user for user in permission.split(',') if user in known_users]
|
allowed = [user for user in permission.split(',') if user in known_users]
|
||||||
else:
|
else:
|
||||||
allowed = ["all_users"]
|
allowed = ["all_users"]
|
||||||
|
@ -235,7 +235,7 @@ def translate_legacy_rules_in_ssowant_conf_json_persistent():
|
||||||
protected_urls = persistent.get("protected_urls", []) + ["re:" + r for r in persistent.get("protected_regex", [])]
|
protected_urls = persistent.get("protected_urls", []) + ["re:" + r for r in persistent.get("protected_regex", [])]
|
||||||
unprotected_urls = persistent.get("unprotected_urls", []) + ["re:" + r for r in persistent.get("unprotected_regex", [])]
|
unprotected_urls = persistent.get("unprotected_urls", []) + ["re:" + r for r in persistent.get("unprotected_regex", [])]
|
||||||
|
|
||||||
known_users = user_list()["users"].keys()
|
known_users = list(user_list()["users"].keys())
|
||||||
|
|
||||||
for legacy_rule in legacy_rules:
|
for legacy_rule in legacy_rules:
|
||||||
if legacy_rule in persistent:
|
if legacy_rule in persistent:
|
||||||
|
|
Loading…
Add table
Reference in a new issue