From 76bd42cdeb74557e0e4f28c838c6f365bf736f36 Mon Sep 17 00:00:00 2001 From: RingOV Date: Thu, 4 Jul 2019 22:40:18 +0300 Subject: [PATCH] fix --- gis-weather.py | 7 ++----- services/gismeteo.py | 4 ++++ services/openweathermap.py | 29 +---------------------------- services/yr.py | 10 ---------- 4 files changed, 7 insertions(+), 43 deletions(-) diff --git a/gis-weather.py b/gis-weather.py index 70460ab..e45a7af 100644 --- a/gis-weather.py +++ b/gis-weather.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # # gis_weather.py -v = '0.8.3.15' +v = '0.8.3.16' # Copyright (C) 2013-2019 Alexander Koltsov # # This program is free software: you can redistribute it and/or modify @@ -1620,15 +1620,12 @@ def menu_response(self, widget, event, value=None): weather_menu = True Save_Config() if event == 'goto_site': - print(URL) - if URL: + if URL != '?': webbrowser.open(URL) if event == 'goto_site_hourly': - print(URL_HOURLY) if URL_HOURLY != '?': webbrowser.open(URL_HOURLY) if event == 'goto_site_day': - print(URL_DAILY) if URL_DAILY != '?': webbrowser.open(URL_DAILY+str(value)) if event == 'start_new_instance': diff --git a/services/gismeteo.py b/services/gismeteo.py index 662f4d1..d3f5703 100644 --- a/services/gismeteo.py +++ b/services/gismeteo.py @@ -274,6 +274,10 @@ def get_weather(): icons_name = gw_vars.get('icons_name') URL_ALL = 'https://services.gismeteo.ru/inform-service/inf_chrome/forecast/?lang=%s&city=%s'%(weather_lang, str(city_id)) + + URL = 'https://www.gismeteo.%s/city/weekly/'%weather_lang + str(city_id) + URL_HOURLY = 'https://www.gismeteo.%s/city/hourly/%s'%(weather_lang, str(city_id)) + # URL_DAILY = 'https://www.gismeteo.%s/city/weekly/%s/#wweekly'%(weather_lang, str(city_id)) print ('\033[34m>\033[0m '+_('Getting weather for')+' '+str(n)+' '+_('days')) diff --git a/services/openweathermap.py b/services/openweathermap.py index 6d514f5..2889071 100644 --- a/services/openweathermap.py +++ b/services/openweathermap.py @@ -8,33 +8,6 @@ import json from datetime import datetime -# data = [ -# "http://openweathermap.org/find?q=", # url -# "http://openweathermap.org/city/1234", # example -# "1234 %s API key (APPID)"%_('How to get'), # code -# { -# 'en': 'English', -# 'ru': 'Russian', -# 'it': 'Italian', -# 'es': 'Spanish', -# 'uk': 'Ukrainian', -# 'de': 'German', -# 'pt': 'Portuguese', -# 'ro': 'Romanian', -# 'pl': 'Polish', -# 'fi': 'Finnish', -# 'nl': 'Dutch', -# 'fr': 'French', -# 'bg': 'Bulgarian', -# 'sv': 'Swedish', -# 'zh_tw': 'ChineseTraditional', -# 'zh': 'ChineseSimplified', -# 'tr': 'Turkish', -# 'hr': 'Croatian', -# 'ca': 'Catalan' -# }, # dict_weather_lang -# ('en', 'ru', 'it', 'es', 'uk', 'de', 'pt', 'ro', 'pl', 'fi', 'nl', 'fr', 'bg', 'sv', 'zh_tw', 'zh', 'tr', 'hr', 'ca') # weather_lang_list -# ] data = { 'url': "http://openweathermap.org/find?q=", # url 'example': "http://openweathermap.org/city/1234", # example @@ -138,7 +111,7 @@ def get_weather(): show_block_today = gw_vars.get('show_block_today') show_block_add_info = gw_vars.get('show_block_add_info') weather_lang = gw_vars.get('weather_lang') - URL = '' + URL = 'https://openweathermap.org/city/%s'%str(city_id) URL_CURRENT = 'http://api.openweathermap.org/data/2.5/weather?id=%s&lang=%s&units=metric&appid=%s'%(str(city_id), weather_lang, APPID) URL_SEVERAL_DAYS = 'http://api.openweathermap.org/data/2.5/forecast?id=%s&lang=%s&units=metric&appid=%s'%(str(city_id), weather_lang, APPID) diff --git a/services/yr.py b/services/yr.py index bfbd6d9..f3f3267 100644 --- a/services/yr.py +++ b/services/yr.py @@ -7,16 +7,6 @@ import time import os -# data = [ -# "http://www.yr.no", # url -# "www.yr.no/sted/South_Africa/North-West/Sun_City", # example -# "South_Africa/North-West/Sun_City", # code -# { -# 'en': 'English' -# }, # dict_weather_lang -# ('en', '') # weather_lang_list -# ] - data = { 'url': "http://www.yr.no", # url 'example': "www.yr.no/sted/South_Africa/North-West/Sun_City", # example