Skip to content

Commit

Permalink
Fix city_add
Browse files Browse the repository at this point in the history
  • Loading branch information
RingOV committed May 26, 2019
1 parent 6ebd037 commit 86548da
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gis-weather.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
#
# gis_weather.py
v = '0.8.2.82'
v = '0.8.2.83'
# Copyright (C) 2013-2018 Alexander Koltsov <ringov@mail.ru>
#
# This program is free software: you can redistribute it and/or modify
Expand Down
10 changes: 5 additions & 5 deletions services/gismeteo.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

data = [
"http://www.gismeteo.com", # url
"https://www.gismeteo.com/weather-alphen-<b>1234</b>/", # example
"https://www.gismeteo.com/weather-alphen-<b>1234</b>", # example
"<b>1234</b>", # code
{
'en': 'English',
Expand Down Expand Up @@ -237,11 +237,11 @@ def convert(icon, icons_name):

def get_city_name(city_id):
weather_lang = gw_vars.get('weather_lang')
if weather_lang == 'ru':
weather_lang = 'ua/ru'
if weather_lang == 'ua/ru':
weather_lang = 'ru'
try:
source = urlopener('https://www.gismeteo.%s/city/weekly/'%weather_lang + str(city_id))
c_name = re.findall('type[A-Z].*\">(.*)<', source)
source = urlopener('https://services.gismeteo.ru/inform-service/inf_chrome/forecast/?lang=%s&city=%s'%(weather_lang, str(city_id)))
c_name = re.findall(' name="(.*?)"', source)
except:
print ('\033[1;31m[!]\033[0m '+_('Failed to get the name of the location'))
return 'None'
Expand Down
3 changes: 2 additions & 1 deletion utils/wind_direct_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ def convert2(d):
if d == '6': direct = _('S')+_('W')
if d == '7': direct = _('W')
if d == '8': direct = _('N')+_('W')
return direct
return direct

0 comments on commit 86548da

Please sign in to comment.