From 697dd8b9c2289b089c1093018e351a822a6f2195 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 14 Nov 2021 16:52:57 +0000 Subject: [PATCH] [CI] Format code with Black --- data/hooks/diagnosis/24-mail.py | 5 ++++- src/yunohost/log.py | 10 +++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/data/hooks/diagnosis/24-mail.py b/data/hooks/diagnosis/24-mail.py index 7b7f5f502..99a4aef28 100644 --- a/data/hooks/diagnosis/24-mail.py +++ b/data/hooks/diagnosis/24-mail.py @@ -210,7 +210,10 @@ class MailDiagnoser(Diagnoser): # Do the DNS Query status, answers = dig(query, "A") - if status != "ok" or (answers and set(answers) <= set(blacklist["non_blacklisted_return_code"])): + if status != "ok" or ( + answers + and set(answers) <= set(blacklist["non_blacklisted_return_code"]) + ): continue # Try to get the reason diff --git a/src/yunohost/log.py b/src/yunohost/log.py index 347fe2e65..0e534f9f8 100644 --- a/src/yunohost/log.py +++ b/src/yunohost/log.py @@ -749,8 +749,12 @@ class OperationLogger(object): # 72971 DEBUG 29739 + ynh_exit_properly # which are lines from backup-before-upgrade or restore-after-failed-upgrade ... filters = [re.compile(f_) for f_ in BORING_LOG_LINES] - filters.append(re.compile(r'\d+ \+ ')) - lines = [line for line in lines if not any(filter_.search(line) for filter_ in filters)] + filters.append(re.compile(r"\d+ \+ ")) + lines = [ + line + for line in lines + if not any(filter_.search(line) for filter_ in filters) + ] lines_to_display = [] @@ -758,7 +762,7 @@ class OperationLogger(object): rev_lines = list(reversed(lines)) for i, line in enumerate(rev_lines): if line.endswith("+ ynh_exit_properly"): - lines_to_display = reversed(rev_lines[i:i + 20]) + lines_to_display = reversed(rev_lines[i : i + 20]) break # If didnt find anything, just get the last 20 lines