Notices


Reply
Thread Tools
Win7Mac's Avatar
Community Council | Posts: 664 | Thanked: 1,648 times | Joined on Apr 2012 @ Hamburg
#231
Originally Posted by thedead1440 View Post
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...
How can I check if the chmod command really went through successfull? - I doubt it did...

Originally Posted by thedead1440 View Post
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...
__________________
Nokia 5110 > 3310 > 6230 > N70 > N9 BLACK 64GB
Hildon Foundation Board member
Maemo Community e.V. co-creator, founder and director since Q4/2016
Current Maemo Community Council member
 
pycage's Avatar
Posts: 3,404 | Thanked: 4,474 times | Joined on Oct 2005 @ Germany
#232
UTF-8 without BOM is a safe bet. Don't use UCS-2 (UTF-16).
__________________
Tidings - RSS and Podcast aggregator for Jolla - https://github.com/pycage/tidings
Cargo Dock - file/cloud manager for Jolla - https://github.com/pycage/cargodock
 

The Following User Says Thank You to pycage For This Useful Post:
Posts: 771 | Thanked: 393 times | Joined on Feb 2012
#233
Originally Posted by ataristic View Post
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]
__________________
5800XMN8808N9
 
Posts: 3 | Thanked: 2 times | Joined on Oct 2012
#234
Originally Posted by soryuuha View Post
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)
 

The Following User Says Thank You to ataristic For This Useful Post:
Posts: 771 | Thanked: 393 times | Joined on Feb 2012
#235
Originally Posted by ataristic View Post
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 :<
__________________
5800XMN8808N9
 
Posts: 397 | Thanked: 185 times | Joined on Oct 2011
#236
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's Avatar
Posts: 1,391 | Thanked: 4,272 times | Joined on Sep 2007 @ Vienna, Austria
#237
Originally Posted by kai_en View Post
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.
 

The Following 2 Users Say Thank You to thp For This Useful Post:
Posts: 646 | Thanked: 1,124 times | Joined on Jul 2010 @ Espoo, Finland
#238
Originally Posted by kai_en View Post
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's Avatar
Community Council | Posts: 664 | Thanked: 1,648 times | Joined on Apr 2012 @ Hamburg
#239
Originally Posted by minimos View Post
@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?
__________________
Nokia 5110 > 3310 > 6230 > N70 > N9 BLACK 64GB
Hildon Foundation Board member
Maemo Community e.V. co-creator, founder and director since Q4/2016
Current Maemo Community Council member
 
Posts: 466 | Thanked: 418 times | Joined on Jan 2010
#240
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
__________________
I have figured out the reason 'smartphones' were invented. They are for reading the internet while pooping. This means the best smartphone ever created is the N9. It is the only one that works so well single-handed.
 

The Following User Says Thank You to slaapliedje For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 07:36.