Jump to content


Photo

Foreca Weather Plugin problem


  • Please log in to reply
71 replies to this topic

Re: Foreca Weather Plugin problem #21 ims

  • PLi® Core member
  • 13,790 posts

+214
Excellent

Posted 10 October 2012 - 18:03

yes
Kdo nic nedělá, nic nezkazí!

Re: Foreca Weather Plugin problem #22 ims

  • PLi® Core member
  • 13,790 posts

+214
Excellent

Posted 10 October 2012 - 18:06

this last commit is nonsence...
locale.getlocale() returns under Pli always (None,None) => is always set language as EN => nat. chars are wrong...
Kdo nic nedělá, nic nezkazí!

Re: Foreca Weather Plugin problem #23 ims

  • PLi® Core member
  • 13,790 posts

+214
Excellent

Posted 10 October 2012 - 18:14

I think, it is same web as was for announced new enigma3 etc ... http://www.dreambox-...ildern-und-mehr
???
Kdo nic nedělá, nic nezkazí!

Re: Foreca Weather Plugin problem #24 JuSt611

  • Member
  • 17 posts

+2
Neutral

Posted 10 October 2012 - 18:32

Well, I tried a lot to harden language determination. But I don't use PLi image, hence I can't checkout myself. And for correct sorting of the weather maps list, I need to use LC_COLLATE. So, any idea for a generally working solution?

Edited by JuSt611, 10 October 2012 - 18:33.


Re: Foreca Weather Plugin problem #25 ims

  • PLi® Core member
  • 13,790 posts

+214
Excellent

Posted 10 October 2012 - 18:33

my yesterday's commit works for you and for Pli too, so why you change it ? Of course, then are for PLi maps sorted as for En ( names with nat. chars are bottom), but it is not problem, imho.

This must works for you and for us too:
LANGUAGE = language.getLanguage()[:2]
try:
    locale.setlocale(locale.LC_COLLATE, language.getLanguage())
except:
    pass

Edited by ims, 10 October 2012 - 18:46.

Kdo nic nedělá, nic nezkazí!

Re: Foreca Weather Plugin problem #26 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 10 October 2012 - 18:46

the real fix should be that LC_ALL is used in e2.
Plugins should not do their own locale settings, because that would override e2's settings.

Re: Foreca Weather Plugin problem #27 ims

  • PLi® Core member
  • 13,790 posts

+214
Excellent

Posted 10 October 2012 - 18:49

but using whole locale ( LC_ALL ... ) spend so much size for all languages, imho. I think, we reduced it for LC_TIME only.
Kdo nic nedělá, nic nezkazí!

Re: Foreca Weather Plugin problem #28 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 10 October 2012 - 19:10

just did a quick check, and indeed setting LC_ALL is refused by python, which corresponds to what the python manpage says:

locale.LC_ALL
Combination of all locale settings. If this flag is used when the locale is changed, setting the locale for all categories is attempted. If that fails for any category, no category is changed at all.


So unfortunately we cannot use LC_ALL.

But, if you really need LC_COLLATE, you need to provide a ~1.5MB LC_COLLATE file in each of the locales...
That's a lot of overhead for an embedded device.

Edited by pieterg, 10 October 2012 - 19:11.


Re: Foreca Weather Plugin problem #29 JuSt611

  • Member
  • 17 posts

+2
Neutral

Posted 11 October 2012 - 05:46

I've just commited the change and hope, that it will work in PLi now. Thanks to all for help. Due to unsopported LC_COLLATE the lists of maps won't be sorted in correct sequence for national characters.

BTW, I've added my planned improvements to changelog in plugin. Anyone here interested in co-operation?

Greetz
JuSt

Re: Foreca Weather Plugin problem #30 Robinson

  • Senior Member
  • 2,621 posts

+30
Good

Posted 4 March 2013 - 10:46

i have just read this thread and see there were problems with FORECA plugin several months ago.
I'm thinking of installing it but before I do, I would like to know if it works OK now.

ET9000, OpenPLi 4.0, 13E, 19E

HD51, OpenPLi 6.2, 75E - 30W


Re: Foreca Weather Plugin problem #31 JuSt611

  • Member
  • 17 posts

+2
Neutral

Posted 4 March 2013 - 14:09

Yes, it works perfectly on my DM8000 OE1.6. I haven't received any more error reports in months, hence seems to work for all supported configurations.

Re: Foreca Weather Plugin problem #32 Robinson

  • Senior Member
  • 2,621 posts

+30
Good

Posted 4 March 2013 - 14:19

OK, I'm gonna give it a try on ET9000 with the latest build. :)

ET9000, OpenPLi 4.0, 13E, 19E

HD51, OpenPLi 6.2, 75E - 30W


Re: Foreca Weather Plugin problem #33 Robinson

  • Senior Member
  • 2,621 posts

+30
Good

Posted 4 March 2013 - 23:07

When I open the plugin, it always starts with London.
How do I choose a different start page?
I cannot find the option in the menu. Neither can I find startpagina.cfg in in /etc/enigma2/Foreca. Am I supposed to create it myself? What is the format of the data inside the file?

ET9000, OpenPLi 4.0, 13E, 19E

HD51, OpenPLi 6.2, 75E - 30W


Re: Foreca Weather Plugin problem #34 blzr

  • PLi® Core member
  • 2,270 posts

+118
Excellent

Posted 5 March 2013 - 00:02

How do I choose a different start page?

open the city list with [ok] button, browse to your preferred location and set it as a start page with [blue]
(you can also choose 2 more cities, as favourite 1 and 2 with [green] and [yellow])

Neither can I find startpagina.cfg in in /etc/enigma2/Foreca. Am I supposed to create it myself? What is the format of the data inside the file?

it's startservice.cfg, fav1.cfg and fav2.cfg, they should be created as soon as you choose other than default cities...
//tip: you can add any missing city to City.cfg, provided that it's present on foreca.com;
format is Country/City_Name (and names have to be spelled exactly as on foreca)
True sarcasm doesn't need green font...

Re: Foreca Weather Plugin problem #35 Robinson

  • Senior Member
  • 2,621 posts

+30
Good

Posted 5 March 2013 - 08:18

Thanks blzr. :)

ET9000, OpenPLi 4.0, 13E, 19E

HD51, OpenPLi 6.2, 75E - 30W


Re: Foreca Weather Plugin problem #36 ims

  • PLi® Core member
  • 13,790 posts

+214
Excellent

Posted 20 March 2013 - 18:51

It seems, does not work for me on all boxes. Still "Wait, please...",

[SKIN] Parsing embedded skin <embedded-in-'ForecaPreviewCache'>
[Foreca Ver. 3.0.7] getPage...
[Foreca Ver. 3.0.7] Url: http://www.foreca.cz/United_Kingdom/London?lang=cs&details=20130320&units=metrickmh&tf=24h
[Foreca Ver. 3.0.7] Error: [Failure instance: Traceback: <type 'exceptions.IndexError'>: list index out of range
/usr/lib/python2.7/site-packages/twisted/internet/tcp.py:277:connectionLost
/usr/lib/python2.7/site-packages/twisted/web/client.py:191:connectionLost
/usr/lib/python2.7/site-packages/twisted/internet/defer.py:368:callback
/usr/lib/python2.7/site-packages/twisted/internet/defer.py:464:_startRunCallbacks
--- <exception caught here> ---
/usr/lib/python2.7/site-packages/twisted/internet/defer.py:551:_runCallbacks
/usr/lib/enigma2/python/Plugins/Extensions/Foreca/plugin.py:777:getForecaPage
]
action ->  ForecaActions red
Traceback (most recent call last):
  File "/usr/lib/enigma2/python/Components/ActionMap.py", line 46, in action
  File "/usr/lib/enigma2/python/Plugins/Extensions/Foreca/plugin.py", line 746, in red
	self.url=_("http://www.foreca.com") + "/meteogram.php?loc_id=" + self.loc_id + "&mglang=" + LANGUAGE + "&units=" + config.plugins.foreca.units.value + "&tf=" + config.plugins.foreca.time.value + "/meteogram.png"
AttributeError: 'ForecaPreview' object has no attribute 'loc_id'
(PyObject_CallObject(<bound method HelpableActionMap.action of <Components.ActionMap.HelpableActionMap instance at 0x1921288>>,('ForecaActions', 'red')) failed)
getResolvedKey config.plugins.crashlogautosubmit.sendAnonCrashlog failed !! (Typo??)
getResolvedKey config.plugins.crashlogautosubmit.addNetwork failed !! (Typo??)
getResolvedKey config.plugins.crashlogautosubmit.addWlan failed !! (Typo??)

Edited by ims, 20 March 2013 - 19:38.

Kdo nic nedělá, nic nezkazí!

Re: Foreca Weather Plugin problem #37 JuSt611

  • Member
  • 17 posts

+2
Neutral

Posted 21 March 2013 - 22:48

Foreca site has apparently been modified. Fix will be delayed a little, as I'm too busy ATM, hence can't immediately start working on it.

Re: Foreca Weather Plugin problem #38 blzr

  • PLi® Core member
  • 2,270 posts

+118
Excellent

Posted 23 March 2013 - 23:27

found on another forum,
changing just this line in plugin.py:
def getForecaPage(self,html):
		 #new Ajax.Request('/lv?id=102772400', {
-		fulltext = re.compile(r"new Ajax.Request.+?lv.+?id=(.+?)'", re.DOTALL)
+		fulltext = re.compile(r"id: '(.*?)'", re.DOTALL)
		 id = fulltext.findall(html)
		 if DEBUG: print pluginPrintname, "fulltext=", fulltext, "id=", id
		 self.loc_id = str(id[0])
seems to do the job... (a readymade plugin.py attached)
//but to be honest, I'm not so sure if I should to feel happy to know a weather forecast again. in current circumstances (it's a spring already, rrright? ;))

Attached Files


True sarcasm doesn't need green font...

Re: Foreca Weather Plugin problem #39 ims

  • PLi® Core member
  • 13,790 posts

+214
Excellent

Posted 24 March 2013 - 00:42

Thanks. It seems, it works. I changed it on E2OpenPlugins yet.
Kdo nic nedělá, nic nezkazí!

Re: Foreca Weather Plugin problem #40 ims

  • PLi® Core member
  • 13,790 posts

+214
Excellent

Posted 24 March 2013 - 11:42

@blzr - do work foreca's maps slideshow for you ?

Edited by ims, 24 March 2013 - 11:57.

Kdo nic nedělá, nic nezkazí!


9 user(s) are reading this topic

0 members, 9 guests, 0 anonymous users