def set_service(widget, label, liststore2, combobox_weather_lang, weather_lang, store):
    global gw_config
    Load_Config()
    i = widget.get_active()
    load_data(i, label, liststore2, combobox_weather_lang, weather_lang, store)
    gw_config['service'] = i
    gw_config['weather_lang'] = weather_lang_list[combobox_weather_lang.get_active()]
    try:
        gw_config['city_id'] = gw_config[data.get_city_list(i)][0].split(';')[0]
    except:
        pass
    gw_config['max_days'] = data.get_max_days(i)
    if gw_config['n'] > gw_config['max_days']:
        gw_config['n'] = gw_config['max_days']
    Save_Config()
Ejemplo n.º 2
0
def set_service(widget, label, liststore2, combobox_weather_lang, weather_lang, store):
    global gw_config
    Load_Config()
    i = data.services_list[widget.get_active()]
    load_data(i, label, liststore2, combobox_weather_lang, weather_lang, store)
    gw_config['service'] = i
    gw_config['weather_lang'] = weather_lang_list[combobox_weather_lang.get_active()]
    try:
        gw_config['city_id'] = gw_config[data.get_city_list(i)][0].split(';')[0]
    except:
        pass
    gw_config['max_days'] = data.get_max_days(i)
    if gw_config['n'] > gw_config['max_days']:
        gw_config['n'] = gw_config['max_days']
    if data.get_need_appid(i):
        grid_appid.show()
    else:
        grid_appid.hide()

    Save_Config()
Ejemplo n.º 3
0
 def set_service(self, widget):
     if state_lock:
         return
     global gw_config_set
     i = widget.get_active()
     gw_config_set['service'] = i
     try:
         city_list = gw_config_set[data.get_city_list(i)]
     except:
         city_list = []
     if city_list:
         gw_config_set['city_id'] = city_list[0].split(';')[0]
     else:
         gw_config_set['city_id'] = 0
     gw_config_set['max_days'] = data.get_max_days(i)
     if gw_config_set['n'] > gw_config_set['max_days']:
         gw_config_set['n'] = gw_config_set['max_days']
     self.spinbutton_n.set_value(gw_config_set['n'])
     self.spinbutton_n.set_range(3, gw_config_set['max_days'])
     Save_Config()
     self.load_available_service_lang(i)
Ejemplo n.º 4
0
 def set_service(self, widget):
     if state_lock:
         return
     global gw_config_set, loading
     loading = True
     i = widget.get_active()
     gw_config_set['service'] = data.services_list[i]
     try:
         city_list = gw_config_set[data.get_city_list(gw_config_set['service'])]
     except:
         city_list = []
     if city_list:
         gw_config_set['city_id'] = city_list[0].split(';')[0]
     else:
         gw_config_set['city_id'] = 0
     gw_config_set['max_days'] = data.get_max_days(gw_config_set['service'])
     if gw_config_set['n'] > gw_config_set['max_days']:
         gw_config_set['n'] = gw_config_set['max_days']
     self.spinbutton_n.set_value(gw_config_set['n'])
     self.spinbutton_n.set_range(3, gw_config_set['max_days'])
     Save_Config()
     self.load_available_service_lang(gw_config_set['service'])
     loading = False