How to define a Meego / Maemo platform in Python?

I am developing a cross-platform application for Maemo / Meego / Linux platforms using python (PySide). I use a workaround to distinguish between Maemo and Linux platfroms:

try:
    import PySide.QtMaemo5
    PLATFORM = 'maemo'
except ImportError:
    PLATFORM = 'desktop'

Does anyone know how to detect the Meego platform or the best way to detect the Maemo platfrom?

+3
source share
2 answers

For a long time, it was discussed how to determine which particular distribution your software runs on without a very satisfactory answer. There are many hackers to do this, but the most useful one might be to use the Linux standard base tool called lsb_release.

It is included in MeeGo, and you can use it as follows:

$lsb_release -a

:

LSB :: core-3.1-arm: core-3.1-noarch: core-3.2-arm: core-3.2-noarch: core-4.0-arm: core-4.0-noarch: desktop-3.1-arm: desktop -3,1-noarch: -3,2-: -3,2-noarch: 4,0-: -4,0-noarch : MeeGo : MeeGo 1.1.90 (MeeGo) : 1.1.90 Codename: MeeGo

. , "lsb_release -r".

, Maemo Linux, . : https://bugs.maemo.org/show_bug.cgi?id=10756 , , /usr/bin/osso -product-info Maemo.

+1

: , Maemo:

>>> import platform
>>> platform.machine()
'armv71'
>>> platform.node() ## This is Host Name, not a safe method
'Nokia N900'

, , Maemo, ( ) : /etc/issue:

issue = open('/etc/issue').read().strip().lower()
if issue.startswith('maemo'):
  ....
+4

All Articles