From df5b33c6625555578fd90bf2e9e127dfc241cd22 Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Wed, 3 Oct 2018 19:47:48 +0200 Subject: [PATCH] show_help() --- bin/srv.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/bin/srv.py b/bin/srv.py index a76e524..62a08f7 100644 --- a/bin/srv.py +++ b/bin/srv.py @@ -324,16 +324,13 @@ def wttr(location = None): user_agent = request.headers.get('User-Agent', '').lower() - if any(agent in user_agent for agent in PLAIN_TEXT_AGENTS): - html_output = False - else: - html_output = True + html_output = not any(agent in user_agent for agent in PLAIN_TEXT_AGENTS) - if location == ':help': - help_ = show_help() + if location in show_help.pages: + help_ = show_help(location, lang) if html_output: - return render_template( 'index.html', body=help_ ) + return render_template('index.html', body=help_) else: return help_