|
|
2010-02-18
, 23:43
|
|
Posts: 77 |
Thanked: 52 times |
Joined on Sep 2009
@ US
|
#52
|
| The Following User Says Thank You to hartti For This Useful Post: | ||
|
|
2010-02-18
, 23:46
|
|
|
Posts: 3,203 |
Thanked: 1,391 times |
Joined on Nov 2009
@ Worthing, England
|
#53
|
I was expecting that there is a method yyyy in module xxxx, which I could just call and get the version number. Like
version = yyyy.xxxx()
I got qwerty12's trick to work with the following code. To me that still looks like calling a command line command from the python code :-)
import os
a = os.popen("osso-product-info -q OSSO_PRODUCT_RELEASE_VERSION")
version = a.next()
a.close()
Hartti
- a few i have read looked great until i saw the line (FIX: Blah blah not working, needs to be added)
|
|
2010-02-19
, 13:03
|
|
|
Posts: 3,203 |
Thanked: 1,391 times |
Joined on Nov 2009
@ Worthing, England
|
#54
|
|
|
2010-02-19
, 16:55
|
|
Posts: 77 |
Thanked: 52 times |
Joined on Sep 2009
@ US
|
#55
|
| The Following User Says Thank You to hartti For This Useful Post: | ||
|
|
2010-02-19
, 17:19
|
|
Posts: 3,428 |
Thanked: 2,856 times |
Joined on Jul 2008
|
#56
|
#!/usr/bin/python
import commands
enabled = commands.getoutput('find /etc/apt -name *.list -exec grep -v "^#" {} \
; | grep -v "^$"')
disabled = commands.getoutput('find /etc/apt -name *.list -exec grep "^#" {} \;
| grep -Ev "^#\W*$"')
print "Enabled Repositories \n\n" + enabled
print "\n\nDisabled Repositories \n\n" + disabled
| The Following 2 Users Say Thank You to fatalsaint For This Useful Post: | ||
|
|
2010-02-19
, 17:24
|
|
Posts: 3,428 |
Thanked: 2,856 times |
Joined on Jul 2008
|
#57
|
apt-cache policy
| The Following 3 Users Say Thank You to fatalsaint For This Useful Post: | ||
|
|
2010-02-19
, 17:27
|
|
|
Posts: 4,274 |
Thanked: 5,358 times |
Joined on Sep 2007
@ Looking at y'all and sighing
|
#58
|
| The Following 2 Users Say Thank You to qwerty12 For This Useful Post: | ||
|
|
2010-02-19
, 17:29
|
|
Posts: 3,428 |
Thanked: 2,856 times |
Joined on Jul 2008
|
#59
|
| The Following User Says Thank You to fatalsaint For This Useful Post: | ||
|
|
2010-02-19
, 17:31
|
|
|
Posts: 4,274 |
Thanked: 5,358 times |
Joined on Sep 2007
@ Looking at y'all and sighing
|
#60
|
| The Following 2 Users Say Thank You to qwerty12 For This Useful Post: | ||
![]() |
| Tags |
| code, health check, n900, python |
| Thread Tools | |
|
There is
"osso-product-info -q OSSO_PRODUCT_RELEASE_VERSION"
But i havn't tried using it
At least it works
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -