5 import simplejson as json
9 self.configfile = path.expanduser('~/.gotovienna/config.json')
11 if path.exists(self.configfile):
12 with open(self.configfile, 'r') as f:
14 self.conf = json.load(f)
16 print "Corrupt config"
19 with open(self.configfile, 'w') as f:
20 json.dump(self.conf, f)
22 def getGpsEnabled(self):
23 if self.conf.has_key('gps_enabled'):
24 return self.conf['gps_enabled']
27 def setGpsEnabled(self, value):
28 self.conf['gps_enabled'] = value
31 def getLastStationsUpdate(self):
32 if self.conf.has_key('last_stations_update'):
33 return self.conf['last_stations_update']
36 def setLastStationsUpdate(self, date):
37 self.conf['last_stations_update'] = date