From 8117ffb85fa4c7ab8a6e3be7dc346b228224f35d Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sun, 20 Aug 2017 22:52:51 +0200 Subject: [PATCH] [mod] pep8 on app.py --- src/yunohost/app.py | 7 +++---- src/yunohost/backup.py | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/yunohost/app.py b/src/yunohost/app.py index bb81efeeb..025de2e19 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -1544,7 +1544,7 @@ def _fetch_app_from_git(app): else: raise MoulinetteError(errno.EINVAL, m18n.n('app_unknown')) - if not 'git' in app_info: + if 'git' not in app_info: raise MoulinetteError(errno.EINVAL, m18n.n('app_unsupported_remote_type')) url = app_info['git']['url'] @@ -1852,9 +1852,9 @@ def _parse_args_from_manifest(manifest, action, args={}, auth=None): # is an available url and normalize the path. domain_args = [arg["name"] for arg in action_args - if arg.get("type","string") == "domain"] + if arg.get("type", "string") == "domain"] path_args = [arg["name"] for arg in action_args - if arg.get("type","string") == "path"] + if arg.get("type", "string") == "path"] if len(domain_args) == 1 and len(path_args) == 1: @@ -1871,7 +1871,6 @@ def _parse_args_from_manifest(manifest, action, args={}, auth=None): # standard path format to deal with no matter what the user inputted) args_dict[path_args[0]] = path - return args_dict diff --git a/src/yunohost/backup.py b/src/yunohost/backup.py index 548e4aa6b..d794a2fca 100644 --- a/src/yunohost/backup.py +++ b/src/yunohost/backup.py @@ -1456,8 +1456,7 @@ class BackupMethod(object): points_to_umount = [line.split(" ")[2] for line in mount_lines - if len(line) >= 3 - and line.split(" ")[2].startswith(directory)] + if len(line) >= 3 and line.split(" ")[2].startswith(directory)] ret = 0 for point in reversed(points_to_umount): ret = subprocess.call(["umount", point]) @@ -1945,7 +1944,7 @@ def backup_create(name=None, description=None, methods=[], ########################################################################### # Historical, deprecated options - if ignore_hooks != False: + if ignore_hooks is not False: logger.warning("--ignore-hooks is deprecated and will be removed in the" "future. Please use --ignore-system instead.") ignore_system = ignore_hooks @@ -2073,7 +2072,7 @@ def backup_restore(auth, name, ########################################################################### # Historical, deprecated options - if ignore_hooks != False: + if ignore_hooks is not False: logger.warning("--ignore-hooks is deprecated and will be removed in the" "future. Please use --ignore-system instead.") ignore_system = ignore_hooks