From 176ed18699e35f3bc2745f1ec0862de515068d75 Mon Sep 17 00:00:00 2001 From: Chris Ball Date: Tue, 08 Jul 2008 23:45:32 +0000 Subject: #7434 Add Power control panel section profile code. --- (limited to 'src') diff --git a/src/sugar/profile.py b/src/sugar/profile.py index dc9e1d4..00527af 100644 --- a/src/sugar/profile.py +++ b/src/sugar/profile.py @@ -71,6 +71,8 @@ class Profile(object): self.sound_volume = DEFAULT_VOLUME self.hot_corners_delay = DEFAULT_HOT_CORNERS_DELAY self.warm_edges_delay = DEFAULT_WARM_EDGES_DELAY + self.automatic_pm = False + self.extreme_pm = False self._pubkey = None self._privkey_hash = None @@ -110,6 +112,10 @@ class Profile(object): _set_key(cp, 'Sound', 'Volume', self.sound_volume) + _set_key(cp, 'Power', 'AutomaticPM', self.automatic_pm) + + _set_key(cp, 'Power', 'ExtremePM', self.extreme_pm) + f = open(self._config_path, 'w') cp.write(f) f.close() @@ -140,6 +146,14 @@ class Profile(object): self.backup1 = cp.get('Server', 'Backup1') if cp.has_option('Sound', 'Volume'): self.sound_volume = float(cp.get('Sound', 'Volume')) + if cp.has_option('Power', 'AutomaticPM'): + state = cp.get('Power', 'AutomaticPM') + if state.lower() == "true": + self.automatic_pm = True + if cp.has_option('Power', 'ExtremePM'): + state = cp.get('Power', 'ExtremePM') + if state.lower() == "true": + self.extreme_pm = True del cp -- cgit v0.9.1