Initial UI hacking
[jamaendo] / jamaui / util.py
1 import os
2
3 def string_in_file( filepath, string ):
4     try:
5         f = open( filepath, 'r' )
6         found = f.read().find( string ) != -1
7         f.close()
8     except:
9         found = False
10
11     return found
12
13 def get_platform():
14     if ( os.path.exists('/etc/osso_software_version') or
15          os.path.exists('/proc/component_version') or
16          string_in_file('/etc/issue', 'maemo') ):
17         return 'maemo'
18     else:
19         return 'linux'
20
21 platform = get_platform()