Jump to content


Photo

Foreca Weather Plugin problem


  • Please log in to reply
71 replies to this topic

#1 alsat1

  • Senior Member
  • 221 posts

+1
Neutral

Posted 9 October 2012 - 06:52

Hi.Today installed fresh pli 3.0 on my dm800se and like always downloaded my favorite plugin Foreca but cant use it.Tried both versions from feed.
Here on screenshot You can see:

And how can I fix it?regards.

Attached Files



Re: Foreca Weather Plugin problem #2 ims

  • PLi® Core member
  • 13,790 posts

+214
Excellent

Posted 9 October 2012 - 10:14

it seems as some about corrupt .../Foreca/locale ? See on box, how it look in .../Foreca/locale

Edited by ims, 9 October 2012 - 10:15.

Kdo nic nedělá, nic nezkazí!

Re: Foreca Weather Plugin problem #3 alsat1

  • Senior Member
  • 221 posts

+1
Neutral

Posted 9 October 2012 - 12:32

it seems as some about corrupt .../Foreca/locale ? See on box, how it look in .../Foreca/locale

Attached Files


Edited by alsat1, 9 October 2012 - 12:33.


Re: Foreca Weather Plugin problem #4 ims

  • PLi® Core member
  • 13,790 posts

+214
Excellent

Posted 9 October 2012 - 12:52

try If it works after change language f.eg. to En. ( Btw ... .mo file are in subdirs... )
Kdo nic nedělá, nic nezkazí!

Re: Foreca Weather Plugin problem #5 blzr

  • PLi® Core member
  • 2,270 posts

+118
Excellent

Posted 9 October 2012 - 15:01

Foreca plugin has stopped to work regardless of setting up language...
I just commented two lines added with yesterday's commit
https://github.com/E...f09f4071533b46f
...
# import locale
...
# Get diacritics to handle
FILTERin = []
FILTERout = []
FILTERidx = 0
LANGUAGE = language.getLanguage()[:2]
#locale.setlocale(locale.LC_ALL, language.getLanguage())
if fileExists(USR_PATH + "/Filter.cfg"):
	file = open(USR_PATH + "/Filter.cfg","r")
	for line in file:
		regel = str(line)
		if regel[:2] == LANGUAGE:
			if regel[4] == "Y":
				FILTERidx += 1
				FILTERin.append(regel[7:15].strip())
				FILTERout.append(regel[17:].strip())
file.close
and everything seems to be back to normal...
//no idea what actually was the purpose of introducing above changes, but it was a direct 'culprit' of today's problems ;)...

Attached Files


True sarcasm doesn't need green font...

Re: Foreca Weather Plugin problem #6 alsat1

  • Senior Member
  • 221 posts

+1
Neutral

Posted 9 October 2012 - 15:45

try If it works after change language f.eg. to En. ( Btw ... .mo file are in subdirs... )


Nothing change after change lang.to english-the same problem like on screenshot.
@blzr-I cant download Your file-its showing I dont have permission to view this file.

Re: Foreca Weather Plugin problem #7 blzr

  • PLi® Core member
  • 2,270 posts

+118
Excellent

Posted 9 October 2012 - 15:59

it was just link to the commit which probably /?/ broke down the plugin...
you can try if it works for you with attached plugin.py
(replace the original one and restart e2)
//although I don't know if it's the 'proper' way to fix things up ;)

Attached Files


Edited by blzr, 9 October 2012 - 16:00.

True sarcasm doesn't need green font...

Re: Foreca Weather Plugin problem #8 ims

  • PLi® Core member
  • 13,790 posts

+214
Excellent

Posted 9 October 2012 - 16:31

or change line to:
locale.setlocale(locale.LC_ALL, '')

Kdo nic nedělá, nic nezkazí!

Re: Foreca Weather Plugin problem #9 ims

  • PLi® Core member
  • 13,790 posts

+214
Excellent

Posted 9 October 2012 - 16:46

There could be used too:
loc = locale.getlocale()
locale.setlocale(locale.LC_ALL, loc)
and it works.
But loc is (None, None) ?!?. Tried
locale.setlocale(locale.LC_ALL, 'cs_CZ')
and same problem, but it is legal using of this (dont know, if under py2.7)...

Edited by ims, 9 October 2012 - 17:20.

Kdo nic nedělá, nic nezkazí!

Re: Foreca Weather Plugin problem #10 ims

  • PLi® Core member
  • 13,790 posts

+214
Excellent

Posted 9 October 2012 - 17:20

BTW - i think, we are using only LC_TIME only... not LC_COLLATE (for used strxfrm() ) or LC_ALL
Kdo nic nedělá, nic nezkazí!

Re: Foreca Weather Plugin problem #11 alsat1

  • Senior Member
  • 221 posts

+1
Neutral

Posted 9 October 2012 - 17:31

But mayby pli team will fix it and add to daily update of image?So then we can wait or did I should make a fix by my own with Your sugestion mates?regards.

Re: Foreca Weather Plugin problem #12 ims

  • PLi® Core member
  • 13,790 posts

+214
Excellent

Posted 9 October 2012 - 17:36

done...
temp. changed to:

try:
    locale.setlocale(locale.LC_ALL, language.getLanguage())
except:
    locale.setlocale(locale.LC_ALL, locale.getlocale())

Kdo nic nedělá, nic nezkazí!

Re: Foreca Weather Plugin problem #13 alsat1

  • Senior Member
  • 221 posts

+1
Neutral

Posted 9 October 2012 - 18:07

can you please attach fixed file plygin.py so all users can do it quickly.Thanks.

Re: Foreca Weather Plugin problem #14 alsat1

  • Senior Member
  • 221 posts

+1
Neutral

Posted 9 October 2012 - 19:31

done...
temp. changed to:

try:
	locale.setlocale(locale.LC_ALL, language.getLanguage())
except:
	locale.setlocale(locale.LC_ALL, locale.getlocale())


done it ,its working,thanks.

Re: Foreca Weather Plugin problem #15 blzr

  • PLi® Core member
  • 2,270 posts

+118
Excellent

Posted 10 October 2012 - 17:10

@ims, thanks for your fix, unfortunately it seems that your work was futile ;)
your commit (was) vanished today with no trace (I had no idea there's such possibility in git /?/ )
and now we have the new version '3.0.4 Language determination improved' with such improvements:
FILTERidx = 0
-LANGUAGE = language.getLanguage()[:2]
-locale.setlocale(locale.LC_ALL, language.getLanguage())
+try:
+	LANGUAGE = language.getActiveLanguage()[:2]
+	locale.setlocale(locale.LC_COLLATE, language.getLanguage())
+	print pluginPrintname, "Language (determined by getLanguage):", LANGUAGE
+except:
+	lang = locale.getlocale()
+	if lang[0] is None:
+		LANGUAGE = "en"
+		print pluginPrintname, "Language undeterminable; set to default:", LANGUAGE	
+	else:
+		LANGUAGE = lang[0][:2]
+		locale.setlocale(locale.LC_COLLATE, lang)
+		print pluginPrintname, "Language (determined by getlocale):", lang
+
tested it out of curiosity, and it breaks (or maybe better 'will break from tommorow' ;)) displaying of national characters in Foreca on OpenPLi image...
now the question is:
is it 'not-so-great' coding above?
or rather the fault lies with 'our' side?
True sarcasm doesn't need green font...

Re: Foreca Weather Plugin problem #16 ims

  • PLi® Core member
  • 13,790 posts

+214
Excellent

Posted 10 October 2012 - 17:43

I dont understand, why it was changed ? Yes, this corrupt nat chars...

In PLi is not used LC_COLLATE, we using LC_TIME only...

lines
LANGUAGE = language.getLanguage()[:2]
try:
locale.setlocale(locale.LC_ALL, language.getLanguage())
except:
locale.setlocale(locale.LC_ALL, locale.getlocale())

was enough for it...
Kdo nic nedělá, nic nezkazí!

Re: Foreca Weather Plugin problem #17 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 10 October 2012 - 17:49

what's the reason this plugin tries to modify locales?
Shouldn't the e2 language selection be responsible for that?

Re: Foreca Weather Plugin problem #18 ims

  • PLi® Core member
  • 13,790 posts

+214
Excellent

Posted 10 October 2012 - 17:51

next file for private backup .... :-(
Kdo nic nedělá, nic nezkazí!

Re: Foreca Weather Plugin problem #19 ims

  • PLi® Core member
  • 13,790 posts

+214
Excellent

Posted 10 October 2012 - 17:54

what's the reason this plugin tries to modify locales?
Shouldn't the e2 language selection be responsible for that?


He begun using strxfrm() and for it must be LC_COLLATE or LC_ALL (with LC_COLLATE suopport). But we using LC_TIME, imho only.
Yesterday I changed it for works under PLi and today was changes again and against PLi...

All what we need is line:
LANGUAGE = language.getLanguage()[:2]

Edited by ims, 10 October 2012 - 17:58.

Kdo nic nedělá, nic nezkazí!

Re: Foreca Weather Plugin problem #20 littlesat

  • PLi® Core member
  • 57,184 posts

+699
Excellent

Posted 10 October 2012 - 17:59

Wierd.... I think we should change it to work with PLi (and) with others... and changeing locals in a plugin that is doing weather is not done I suggest....

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W



4 user(s) are reading this topic

0 members, 4 guests, 0 anonymous users