new option: F (no follow line) (fixes #214)

This commit is contained in:
Igor Chubin 2019-01-11 12:48:00 +01:00
parent 8607e8ce0e
commit 6dfd809694
3 changed files with 7 additions and 4 deletions

View file

@ -72,6 +72,8 @@ def parse_query(args):
result['no-caption'] = True result['no-caption'] = True
if 'Q' in q: if 'Q' in q:
result['no-city'] = True result['no-city'] = True
if 'F' in q:
result['no-follow-line'] = True
for key, val in args.items(): for key, val in args.items():
if val == 'True': if val == 'True':

View file

@ -241,10 +241,10 @@ def wttr(location, request):
url=request.url, url=request.url,
) )
if html_output: if query.get('days', '3') != '0' and not query.get('no-follow-line'):
output = add_buttons(output) if html_output:
else: output = add_buttons(output)
if query.get('days', '3') != '0': else:
#output += '\n' + get_message('NEW_FEATURE', lang).encode('utf-8') #output += '\n' + get_message('NEW_FEATURE', lang).encode('utf-8')
output += '\n' + get_message('FOLLOW_ME', lang).encode('utf-8') + '\n' output += '\n' + get_message('FOLLOW_ME', lang).encode('utf-8') + '\n'
return output return output

View file

@ -29,6 +29,7 @@ View options:
0 # only current weather 0 # only current weather
1 # current weather + 1 day 1 # current weather + 1 day
2 # current weather + 2 days 2 # current weather + 2 days
F # do not show the "Follow" line
n # narrow version (only day and night) n # narrow version (only day and night)
q # quiet version (no "Weather report" text) q # quiet version (no "Weather report" text)
Q # superquiet version (no "Weather report", no city name) Q # superquiet version (no "Weather report", no city name)