From b8ab35db77cde13e1f00888e2c4e263bbb2e07f3 Mon Sep 17 00:00:00 2001 From: Per Persson Date: Fri, 13 Jul 2018 21:13:37 +0200 Subject: [PATCH] Move 'not' I think that this small change makes the code somewhat more readable. Logic: not any([ b1, b2, b3, ... ]) == all([ not b1, not b2, not b3, ... ]) --- bin/srv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/srv.py b/bin/srv.py index 22f1a2e..f1bdfae 100644 --- a/bin/srv.py +++ b/bin/srv.py @@ -49,7 +49,7 @@ def is_html_needed(user_agent): Basing on `user_agent`, return whether it needs HTML or ANSI """ plaintext_clients = ['curl', 'wget', 'fetch', 'httpie', 'lwp-request', 'python-requests'] - return not any([x in user_agent for x in plaintext_clients]) + return all([x not in user_agent for x in plaintext_clients]) @app.route('/files/') def send_static(path):