4 # Copyright (C) 2010 Stefanos Harhalakis
6 # This file is part of wifieye.
8 # wifieye is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # wifieye is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with wifieye. If not, see <http://www.gnu.org/licenses/>.
21 # $Id: 0.py 2265 2010-02-21 19:16:26Z v13 $
23 __version__ = "$Id: 0.py 2265 2010-02-21 19:16:26Z v13 $"
31 from glib import get_user_config_dir
33 def get_user_config_dir():
34 home=os.environ['HOME']
37 cfg="%s/.config" % (home)
76 def setLongpress(_lp):
87 """ apps is a dictionary of (x,y)=>appname """
97 (0,0): 'rtcom-call-ui',
98 (0,1): 'rtcom-messaging-ui',
100 (1,1): 'osso-addressbook',
107 dir0=get_user_config_dir()
109 if not os.path.exists(dir):
111 if not os.path.isdir(dir):
112 raise Exception('Failed to ensure directory' + dir)
139 'longpress': getLongpress(),
150 """ Convert a v1 config to v2 """
173 dt['data'][i]['indiv']=False
174 dt['data'][i]['size']=(dt['data'][i]['size'], dt['data'][i]['size'])
175 dt['data'][i]['longpress']=True
203 if dt0['version']==1:
206 if dt0['version']==2:
209 if not dt0['data'].has_key(id):
216 setIndiv(dt['indiv'])
217 setLongpress(dt['longpress'])
230 print "config.init() not done"
233 # vim: set ts=8 sts=4 sw=4 noet formatoptions=r ai nocindent: