Reply
Thread Tools
Posts: 31 | Thanked: 41 times | Joined on Dec 2009 @ United States
#1
Is there a way to determine which version of Maemo a Python app is running on from within Python? I've poked around using a few methods, but I haven't found any way other than determining the version of Python instead of Maemo.

Apologies if this is a stupid question, I'm still very new to Python development.
 
MohammadAG's Avatar
Posts: 2,473 | Thanked: 12,265 times | Joined on Oct 2009 @ Jerusalem, PS/IL
#2
Might not be the easiest/best way but...
Code:
os.popen('dpkg -l mp-fremantle*"').read()
Nokia-N900-02-8:~# dpkg -l mp-fremantle*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii mp-fremantle-g 3.2010.02-8
Version is there.

Oh and don't forget to import os

Last edited by MohammadAG; 2010-04-25 at 22:52.
 

The Following User Says Thank You to MohammadAG For This Useful Post:
Venemo's Avatar
Posts: 1,296 | Thanked: 1,773 times | Joined on Aug 2009 @ Budapest, Hungary
#3
Actually, you could check the output of dpkg -l and check for specific packages.
The mp-fremantle is the first to be uninstalled if you break a dependency, so I wouldn't depend on that alone.
 

The Following User Says Thank You to Venemo For This Useful Post:
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#4
You can check the output of "osso-product-info" - for the OS version just run:
Code:
osso-product-info -q OSSO_PRODUCT_RELEASE_VERSION
 

The Following 3 Users Say Thank You to Rob1n For This Useful Post:
Posts: 31 | Thanked: 41 times | Joined on Dec 2009 @ United States
#5
OSSO_PRODUCT_RELEASE_VERSION doesn't give me results that look too useful, but OSSO_PRODUCT_NAME will work like a charm.

Thanks!
 

The Following User Says Thank You to terminal3 For This Useful Post:
Posts: 31 | Thanked: 41 times | Joined on Dec 2009 @ United States
#6
I could probably have been more specific, I was looking for the major release version of Maemo, not update version. Thanks for your help everyone.
 
Reply


 
Forum Jump


All times are GMT. The time now is 06:35.