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)

Win7Mac 2012-10-07 17:47

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by thedead1440 (Post 1277723)
I'm not sure maybe do a chmod 775 like i did instead of just a chmod +x...

Did it (as user), but still nothing...:mad:
How can I check if the chmod command really went through successfull? - I doubt it did...

Quote:

Originally Posted by thedead1440 (Post 1277723)
The 3bytes are what Windows adds on hence its line endings for sure...

OK, I found the settings in notepad++ to have it in UNIX format. What else to set, ANSI? UTF-8 (with/without BOM) / UCS-2 (little/big endian)?
To avoid that next time... :)

pycage 2012-10-07 17:55

Re: [Support thread] Billboard Standby Screen
 
UTF-8 without BOM is a safe bet. Don't use UCS-2 (UTF-16).

soryuuha 2012-10-09 07:25

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by ataristic (Post 1277613)
Just put a \x00 escape code where you want the output to end (anything beyond it will be ignored, including the forced newline), like so:

print "this string ends here\x00(and this is ignored)"

like this?
Code:

#!/usr/bin/python
import datetime
seconds = int(float(open('/proc/uptime').read().split()[0]))
print str(datetime.timedelta\x00(0, seconds))[:-3]


ataristic 2012-10-09 08:36

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by soryuuha (Post 1278279)
like this?
Code:

#!/usr/bin/python
import datetime
seconds = int(float(open('/proc/uptime').read().split()[0]))
print str(datetime.timedelta\x00(0, seconds))[:-3]


The \x00 is an escape code and must be inside a string literal (that is, inside a quoted piece of text). You can also use the chr() function to get a zero byte. Try the following:
Code:

#!/usr/bin/python
import datetime
seconds = int(float(open('/proc/uptime').read().split()[0]))
print str(datetime.timedelta(0, seconds))[:-3]+chr(0)


soryuuha 2012-10-09 09:37

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by ataristic (Post 1278295)
The \x00 is an escape code and must be inside a string literal (that is, inside a quoted piece of text). You can also use the chr() function to get a zero byte. Try the following:
Code:

#!/usr/bin/python
import datetime
seconds = int(float(open('/proc/uptime').read().split()[0]))
print str(datetime.timedelta(0, seconds))[:-3]+chr(0)


this works..thanks! pardon for my knowledge on python :<

kai_en 2012-10-09 13:57

Re: [Support thread] Billboard Standby Screen
 
I wonder if it's possible that Billboard read from Accuweather? I know it already reads from MeeCast but I had been using Accuweather all along due to its more accurate weather data where I'm staying

thp 2012-10-10 07:17

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by kai_en (Post 1278393)
I wonder if it's possible that Billboard read from Accuweather? I know it already reads from MeeCast but I had been using Accuweather all along due to its more accurate weather data where I'm staying

Probably not - Accuweather is closed source and AFAIK there's no APIs to read the weather data from it (I'm not going to build a fully-blown weather data client into Billboard). You might be able to use a script to retrieve the weather from a known-good site and then integrate that into Billboard.

minimos 2012-10-10 12:03

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by kai_en (Post 1278393)
I wonder if it's possible that Billboard read from Accuweather? I know it already reads from MeeCast but I had been using Accuweather all along due to its more accurate weather data where I'm staying

What about helping MeeCast to work also for the place where you live? (if that's possible in your case)

Win7Mac 2012-10-13 13:36

Re: [Support thread] Billboard Standby Screen
 
Quote:

Originally Posted by minimos (Post 1272928)
@thp: would it be possible to have tags for changing some text to e.g. italic/bold, and for color, e.g. something like:
{i}{full-date}{/i}
{red}{events}{/red}
or would it hit some limitation in LPM mode?

Now that would really come in handy as the more info/lines there are, the less clear they become.

What really drives me crazy is I still can't get the uptime to display via the python script.
I tried thedead1440's uptime.py and set up a new script with notepad++ (on Win7) with settings as UNIX, UTF-8 without BOM but still no success.
I'm unsure if the chmod-command was successful or not - is there a way to check?
Anything else that may inhibit proper display of the script?
Probably a general problem with python on my phone?

slaapliedje 2012-10-13 15:44

Re: [Support thread] Billboard Standby Screen
 
For the record, if you're running the script with 'python uptime.py' you don't need to chmod it. Stating 'python uptime.py' just feeds it directly into the python interpreter.

That first line of the script tells it to use the python interpreter, so that you CAN just use it as an executable.

For the record, I got it to work.

All I did was create the script on the phone itself with 'nano uptime.py' as the normal user. Then under Billboard settings, I put in

Code:

Uptime: {script:python /home/user/uptime.py}
The uptime.py is the exact same as ataristic posted.

slaapliedje


All times are GMT. The time now is 10:17.

vBulletin® Version 3.8.8