Jump to content


Photo

Yweather.py and config tool


  • Please log in to reply
22 replies to this topic

#1 2boom

  • Senior Member
  • 100 posts

+17
Neutral

Posted 7 December 2013 - 13:01

subj

Attached Files



Re: Yweather.py and config tool #2 honda-civic

  • Senior Member
  • 307 posts

+22
Neutral

Posted 7 December 2013 - 17:08

hello mr.2boom

All this is good but not showing Info!!???



Re: Yweather.py and config tool #3 2boom

  • Senior Member
  • 100 posts

+17
Neutral

Posted 7 December 2013 - 19:18

honda-civic, this is a configurator converter, no weather-plugin and nothing else



Re: Yweather.py and config tool #4 Amoroso2006

  • Senior Member
  • 62 posts

+1
Neutral

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 2boom

  • Senior Member
  • 100 posts

+17
Neutral

Posted 7 December 2013 - 22:02

Amoroso2006 I use another algorithm :)



Re: Yweather.py and config tool #6 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

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....

 

Spoiler

Re: Yweather.py and config tool #7 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

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. Attached File  YWConfig.zip   4.19KB   69 downloads

 

Restart enigma and execute plugin.


Edited by jpuigs, 7 April 2015 - 20:49.

Enigma is getting old....

 

Spoiler

Re: Yweather.py and config tool #8 örlgrey

  • Member
  • 13 posts

0
Neutral

Posted 9 April 2015 - 18:01

hello jpuigs

I can't find this line in YWeather.py.

Do you have another script-file?



Re: Yweather.py and config tool #9 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

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. Attached File  YWeather.py   20.9KB   88 downloads

 


Enigma is getting old....

 

Spoiler

Re: Yweather.py and config tool #10 örlgrey

  • Member
  • 13 posts

0
Neutral

Posted 9 April 2015 - 20:04

Wow, that's very nice.

Many thanks.



Re: Yweather.py and config tool #11 Sjekkie2

  • Senior Member
  • 82 posts

+5
Neutral

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 2boom

  • Senior Member
  • 100 posts

+17
Neutral

Posted 15 April 2015 - 21:14

all is possible, but I need to match the pictures .png characters in this font



Re: Yweather.py and config tool #13 Sjekkie2

  • Senior Member
  • 82 posts

+5
Neutral

Posted 16 April 2015 - 06:44

Meteocons%2520Regular%2520%2528OpenType%

 

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 Sjekkie2

  • Senior Member
  • 82 posts

+5
Neutral

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 2boom

  • Senior Member
  • 100 posts

+17
Neutral

Posted 16 April 2015 - 15:57

who will deal with the corresponding symbol in the font to the conformity of their status as the weather which is read from the xml file, I just will not do this, do the correspondence table of symbols and images



Re: Yweather.py and config tool #16 dreamboxco

  • Senior Member
  • 321 posts

+4
Neutral

Posted 1 June 2015 - 16:55

if i choose hamburg from germay i cant see the weather from hamburg!

 

 

Attached Files



Re: Yweather.py and config tool #17 Rat

  • Member
  • 4 posts

0
Neutral

Posted 30 June 2015 - 18:13

Where does the YWeather.py go in the main  /usr/lib/enigma2/python/Plugins/Extensions/ YWConfig folder ?

 

still getting YWeather.py not found 

Thanks



Re: Yweather.py and config tool #18 villak

  • Member
  • 5 posts

0
Neutral

Posted 24 September 2015 - 10:41

Good morning , good job , works perfect , just a question, it is possible to download the xml in another language?
Thank you



Re: Yweather.py and config tool #19 2boom

  • Senior Member
  • 100 posts

+17
Neutral

Posted 5 October 2015 - 18:06

no ability service works only in the English

try another converter

Attached Files


Edited by 2boom, 5 October 2015 - 18:10.


Re: Yweather.py and config tool #20 Amoroso2006

  • Senior Member
  • 62 posts

+1
Neutral

Posted 13 April 2016 - 11:21

Yahoo effectively shut down its Weather API

so how to modif this file .py




5 user(s) are reading this topic

0 members, 5 guests, 0 anonymous users