maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Support thread] Billboard Standby Screen (https://talk.maemo.org/showthread.php?t=84507)

slarti 2013-10-29 20:49

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by Z3tor (Post 1382991)
Script works now, but scandic letters in code give errors. How to set encoding for finnish?

The output should already be encoded correctly with the .encode('utf-8') in the end. Worked for my finnish entries as far as I remember. What is the error exactly?

Win7Mac 2013-10-30 01:22

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by thp (Post 1382753)
Will be part of the next release.

When that happens, probably you could ask for confirmation of restoring libsysuid-screenlock-nokia.css during update process? Or simply not replace the actual one and put that as an option within Billboard?
That would actually be great!

I'm sure this has been asked before, but I'm not aware of a solution:
Is there a chance to dimm standby screen?

Z3tor 2013-10-30 09:32

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by slarti (Post 1383245)
The output should already be encoded correctly with the .encode('utf-8') in the end. Worked for my finnish entries as far as I remember. What is the error exactly?

The print line below gives me error about non ASCII chars, which are in this case the letter "ä". If they are replaced with "a", script runs without error.
Code:

if (datetime.now() + timedelta(days_ahead)) < events_list[0][0]:
        print ('Ei tapahtumia %s päivään' % (days_ahead)).encode('utf-8')

I did $ locale -a to see what locales are installed in my device, and get fi and fi_FI. I tried to modify code with encode('fi_FI.utf-8'), but no luck.

slarti 2013-10-30 13:51

Re: [Support thread] Billboard Standby Screen
 
Locale won't change a thing for whatever weird reason.

Try declaring the encoding by adding

#-*- coding: utf-8 -*-

after #!/usr/bin/python

and get rid of the .encode('utf-8') part everywhere. I think that will do the trick. If it does, let me know and I'll change it in github.

Z3tor 2013-10-30 17:07

Re: [Support thread] Billboard Standby Screen
 
Ok, now it works.... almost. Script works fully in terminal with scandic letters too, but in bb, it only prints output if there is no events in x days. So if event is found it does not get printed in bb, but in terminal it works. Weird :confused:

slarti 2013-10-30 17:36

Re: [Support thread] Billboard Standby Screen
 
Did you remove the .encode('utf-8') part everywhere?

Sorry to do this the difficult way, I don't have my half-broken N9 here.

Z3tor 2013-10-30 17:49

Re: [Support thread] Billboard Standby Screen
 
yes i removed them all. Weird how it fully works in terminal, but only partly in bb.

slarti 2013-10-30 17:56

Re: [Support thread] Billboard Standby Screen
 
I can't remember if there is a limitation to line length in BB. Try printing fewer things in the last line as a test. For example try:

print weekday,title

and see if that works. If it does, add more things and see what screws it up.

coderus 2013-10-30 17:59

Re: [Support thread] Billboard Standby Screen
 
declare text as unicode string:
Code:

u'Ei tapahtumia %s päivään'

Z3tor 2013-10-30 20:45

Re: [Support thread] Billboard Standby Screen
 
Sorted it finally... Actually the line "print weekday, title, ..." needed .encode('utf-8') afterall to output in bb. And then again #-*- coding: utf-8 -*- is needed to print scandic letters.


All times are GMT. The time now is 08:44.

vBulletin® Version 3.8.8