subj
Yweather.py and config tool
Re: Yweather.py and config tool #2
Re: Yweather.py and config tool #3
Re: Yweather.py and config tool #4
Posted 7 December 2013 - 21:06
thank's 2boom
this plugin had the same rule of meteo plugin it's introduce the code of city in the py file
Re: Yweather.py and config tool #5
Re: Yweather.py and config tool #6
Posted 6 April 2015 - 18:07
I've tried to improve this config plugin, in order not no restart enigma2, but until now it's been unsuccessful.
This plugin replaces one line inside file YWeather.py:
weather_city = '779250' to weather_city = entered value
Then it's normal we need to restart enigma to make py file compiled again.....
But I've tried the following change
In YWeather.py file, I've replaced weather city to this line: weather_city = config.plugins.yweather.weather_city.value
And in plugin.py file I've changed this:
def save(self): wcity = '' if self.check(): config.plugins.yweather.weather_city.save() configfile.save() wcitynew = "weather_city = '%s'" % config.plugins.yweather.weather_city.value for line in open("/usr/lib/enigma2/python/Components/Converter/YWeather.py"): if 'weather_city =' in line: wcity = line.strip('\n') self.Console.ePopen('sed -i "s/%s/%s/g" /usr/lib/enigma2/python/Components/Converter/YWeather.py' % (wcity, wcitynew)) self.mbox = self.session.open(MessageBox,(_("configuration is saved")), MessageBox.TYPE_INFO, timeout = 6 ) else: self.setTitle(_("YWeather.py not found"))
to this:
def save(self): if self.check(): config.plugins.yweather.weather_city.save() configfile.save() os.remove('/tmp/yweather.xml') self.mbox = self.session.open(MessageBox,("City saved"), MessageBox.TYPE_INFO, timeout = 3 ) else: self.setTitle("YWeather.py not found")
So, when saving, it first changes configuration value and then deletes /tmp/yweather.xml file,
So I should think that when calling YWeather.py file again on skin, as xml file doesn't exist it has to be created again , and it should read the new value from config.plugins.yweather.weather_city .
It doesn't!.
If I don't restart enigma, and then delete /tmp/yweather.xml file , the info is not refresed.
What Can I do ?
Enigma is getting old....
Re: Yweather.py and config tool #7
Posted 7 April 2015 - 20:49
Solved.
Just in case anybody is interested in, in file YWeather.py replace this line:
self.iConsole.ePopen("wget -P /tmp -T2 'http://xml.weather.yahoo.com/forecastrss?w=%s&u=c' -O /tmp/yweather.xml" % weather_city, self.control_xml)
by this one:
self.iConsole.ePopen("wget -P /tmp -T2 'http://xml.weather.yahoo.com/forecastrss?w=%s&u=c' -O /tmp/yweather.xml" % config.plugins.yweather.weather_city.value, self.control_xml)
and copy this plugin to /usr/lib/enigma2/python/Plugins/Extensions/ on a new folder. YWConfig.zip 4.19KB 69 downloads
Restart enigma and execute plugin.
Edited by jpuigs, 7 April 2015 - 20:49.
Enigma is getting old....
Re: Yweather.py and config tool #8
Re: Yweather.py and config tool #9
Posted 9 April 2015 - 19:44
Well, maybe you have another line.
I've seen scripts using any of them.
self.iConsole.ePopen("wget -P /tmp -T2 'http://weather.yahooapis.com/forecastrss?w=%s&u=c' -O /tmp/yweather.xml" % weather_city, self.control_xml)
replaced by:
self.iConsole.ePopen("wget -P /tmp -T2 'http://weather.yahooapis.com/forecastrss?w=%s&u=c' -O /tmp/yweather.xml" % config.plugins.yweather.weather_city.value, self.control_xml)
Anyway, I give you the script I have. YWeather.py 20.9KB 88 downloads
Enigma is getting old....
Re: Yweather.py and config tool #10
Re: Yweather.py and config tool #11
Posted 15 April 2015 - 19:45
hi
2boom
it is possible to instead picons (0,1,2,3.png) to use the meteocons.ttf like PAX and Metrix skin?
GigaBlue ue Plus
GigaBlue Quad Plus
SAB SKY 4800 mini
www.satfirmware.com De site voor GigaBlue receivers
Re: Yweather.py and config tool #12
Re: Yweather.py and config tool #13
Posted 16 April 2015 - 06:44
Do you want to change the plugin?
Attached Files
GigaBlue ue Plus
GigaBlue Quad Plus
SAB SKY 4800 mini
www.satfirmware.com De site voor GigaBlue receivers
Re: Yweather.py and config tool #14
Posted 16 April 2015 - 06:54
48 * .png pic. = 100 to 150 kb
meteocons font = 24 kb
GigaBlue ue Plus
GigaBlue Quad Plus
SAB SKY 4800 mini
www.satfirmware.com De site voor GigaBlue receivers
Re: Yweather.py and config tool #15
Re: Yweather.py and config tool #16
Re: Yweather.py and config tool #17
Re: Yweather.py and config tool #18
Re: Yweather.py and config tool #19
Re: Yweather.py and config tool #20
8 user(s) are reading this topic
0 members, 8 guests, 0 anonymous users