From ac9f61c7b1f808c2e93c977831a9a54a7d0552b5 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sun, 30 Oct 2016 05:21:27 +0100 Subject: [PATCH] [mod] more pythonic code --- src/yunohost/certificate.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/yunohost/certificate.py b/src/yunohost/certificate.py index 932bf1855..5f8c7ff2c 100644 --- a/src/yunohost/certificate.py +++ b/src/yunohost/certificate.py @@ -639,17 +639,22 @@ def _domain_is_accessible_through_HTTP(ip, domain): def _summary_code_to_string(code): - if (code <= -30): + if code <= -30: return "CRITICAL" - elif (code <= -20): - return "WARNING" - elif (code <= -10): - return "Attention" - elif (code <= 0): - return "Unknown?" - elif (code <= 10): - return "Good" - elif (code <= 20): + + if code <= -20: + return "WARNING" + + if code <= -10: + return "Attention" + + if code <= 0: + return "Unknown?" + + if code <= 10: + return "Good" + + if code <= 20: return "Great!" return "Unknown?"