Originally Posted by
biko_73
Thank you for your interest in responding
I didn't understand what the plugin had to do with the weather!!
what related connection
The plugins belong to the skins and activate the pro menus
To display the choices of the screen components
but i will look for tool as your advise on feed
No idea why someone thought it would be a good idea to add weather functions to this tool but they did.
Code:
def keyOk(self):
sel = self["config"].getCurrent()
if sel is not None and sel == self.set_new_skin:
self.openSkinSelector()
elif sel is not None and sel == self.find_woeid:
self.session.openWithCallback(self.search_weather_id_callback, InputBox, title=_("Please enter search string for your location"), text="")
else:
self.keyGreen()
def openSkinSelector(self):
self.session.openWithCallback(self.skinChanged, SkinSelector)
def openSkinSelectorDelayed(self):
self.delaytimer = eTimer()
self.delaytimer.callback.append(self.openSkinSelector)
self.delaytimer.start(200, True)
def search_weather_id_callback(self, res):
if res:
id_dic = get_woeid_from_yahoo(res)
if 'error' in id_dic:
error_txt = id_dic['error']
self.session.open(MessageBox, _("Sorry, there was a problem:") + "\n%s" % error_txt, MessageBox.TYPE_ERROR)
elif 'count' in id_dic:
result_no = int(id_dic['count'])
location_list = []
for i in list(range(0, result_no)):
location_list.append(id_dic[i])
self.session.openWithCallback(self.select_weather_id_callback, WeatherLocationChoiceList, location_list)
def select_weather_id_callback(self, res):
if res and isInteger(res):
print(res)
config.plugins.AtileHD.woeid.value = int(res)