mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Make the PEP8 happy even though that's unrelated code to the current PR but meh ...
This commit is contained in:
parent
8dd590e6fc
commit
005ccea610
1 changed files with 28 additions and 31 deletions
|
@ -230,7 +230,8 @@ def app_map(app=None, raw=False, user=None):
|
|||
app -- Specific app to map
|
||||
|
||||
"""
|
||||
from yunohost.permission import user_permission_list
|
||||
# TODO / FIXME : Aleks to Josue : not sure why this was included but not used ...
|
||||
# from yunohost.permission import user_permission_list
|
||||
from yunohost.utils.ldap import _get_ldap_interface
|
||||
|
||||
apps = []
|
||||
|
@ -415,9 +416,6 @@ def app_upgrade(app=[], url=None, file=None):
|
|||
from yunohost.hook import hook_add, hook_remove, hook_exec, hook_callback
|
||||
from yunohost.permission import permission_sync_to_user
|
||||
|
||||
# Retrieve interface
|
||||
is_api = msettings.get('interface') == 'api'
|
||||
|
||||
try:
|
||||
app_list()
|
||||
except YunohostError:
|
||||
|
@ -430,15 +428,15 @@ def app_upgrade(app=[], url=None, file=None):
|
|||
if not apps:
|
||||
# FIXME : not sure what's supposed to happen if there is a url and a file but no apps...
|
||||
if not url and not file:
|
||||
apps = [app["id"] for app in app_list(installed=True)["apps"]]
|
||||
apps = [app_["id"] for app_ in app_list(installed=True)["apps"]]
|
||||
elif not isinstance(app, list):
|
||||
apps = [app]
|
||||
|
||||
# Remove possible duplicates
|
||||
apps = [app for i,app in enumerate(apps) if apps not in apps[:i]]
|
||||
apps = [app_ for i, app_ in enumerate(apps) if app_ not in apps[:i]]
|
||||
|
||||
# Abort if any of those app is in fact not installed..
|
||||
for app in [app for app in apps if not _is_installed(app)]:
|
||||
for app in [app_ for app_ in apps if not _is_installed(app_)]:
|
||||
raise YunohostError('app_not_installed', app=app, all_apps=_get_all_installed_apps_id())
|
||||
|
||||
if len(apps) == 0:
|
||||
|
@ -818,7 +816,7 @@ def app_remove(operation_logger, app):
|
|||
# TODO: display fail messages from script
|
||||
try:
|
||||
shutil.rmtree('/tmp/yunohost_remove')
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Apply dirty patch to make php5 apps compatible with php7 (e.g. the remove
|
||||
|
@ -919,6 +917,7 @@ def app_clearaccess(operation_logger, apps):
|
|||
|
||||
return {'allowed_users': result}
|
||||
|
||||
|
||||
def app_debug(app):
|
||||
"""
|
||||
Display debug informations for an app
|
||||
|
@ -1686,8 +1685,7 @@ def _get_app_config_panel(app_id):
|
|||
"panel": [],
|
||||
}
|
||||
|
||||
panels = filter(lambda (key, value): key not in ("name", "version")
|
||||
and isinstance(value, OrderedDict),
|
||||
panels = filter(lambda (key, value): key not in ("name", "version") and isinstance(value, OrderedDict),
|
||||
toml_config_panel.items())
|
||||
|
||||
for key, value in panels:
|
||||
|
@ -1697,8 +1695,7 @@ def _get_app_config_panel(app_id):
|
|||
"sections": [],
|
||||
}
|
||||
|
||||
sections = filter(lambda (k, v): k not in ("name",)
|
||||
and isinstance(v, OrderedDict),
|
||||
sections = filter(lambda (k, v): k not in ("name",) and isinstance(v, OrderedDict),
|
||||
value.items())
|
||||
|
||||
for section_key, section_value in sections:
|
||||
|
@ -1708,8 +1705,7 @@ def _get_app_config_panel(app_id):
|
|||
"options": [],
|
||||
}
|
||||
|
||||
options = filter(lambda (k, v): k not in ("name",)
|
||||
and isinstance(v, OrderedDict),
|
||||
options = filter(lambda (k, v): k not in ("name",) and isinstance(v, OrderedDict),
|
||||
section_value.items())
|
||||
|
||||
for option_key, option_value in options:
|
||||
|
@ -2684,6 +2680,7 @@ def _load_appslist():
|
|||
# ############################### #
|
||||
#
|
||||
|
||||
|
||||
def is_true(arg):
|
||||
"""
|
||||
Convert a string into a boolean
|
||||
|
|
Loading…
Add table
Reference in a new issue