1
0
mirror of https://github.com/chubin/cheat.sh.git synced 2026-06-20 13:16:44 +02:00

Simplify logic

if <condition>:
    return False
return True

is equivalent to

return not <condition>
This commit is contained in:
Per Persson
2018-07-13 21:07:13 +02:00
committed by Per Persson
parent 5d56fca13e
commit 6f36a5a360
+1 -3
View File
@@ -49,9 +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']
if any([x in user_agent for x in plaintext_clients]):
return False
return True
return not any([x in user_agent for x in plaintext_clients])
@app.route('/files/<path:path>')
def send_static(path):