show_help()
This commit is contained in:
parent
8e1479f6ba
commit
df5b33c662
1 changed files with 4 additions and 7 deletions
11
bin/srv.py
11
bin/srv.py
|
|
@ -324,16 +324,13 @@ def wttr(location = None):
|
||||||
|
|
||||||
user_agent = request.headers.get('User-Agent', '').lower()
|
user_agent = request.headers.get('User-Agent', '').lower()
|
||||||
|
|
||||||
if any(agent in user_agent for agent in PLAIN_TEXT_AGENTS):
|
html_output = not any(agent in user_agent for agent in PLAIN_TEXT_AGENTS)
|
||||||
html_output = False
|
|
||||||
else:
|
|
||||||
html_output = True
|
|
||||||
|
|
||||||
|
|
||||||
if location == ':help':
|
if location in show_help.pages:
|
||||||
help_ = show_help()
|
help_ = show_help(location, lang)
|
||||||
if html_output:
|
if html_output:
|
||||||
return render_template( 'index.html', body=help_ )
|
return render_template('index.html', body=help_)
|
||||||
else:
|
else:
|
||||||
return help_
|
return help_
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue