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:
+1
-3
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user