[Sugar-devel] [PATCH] Control Panel, Power section: check if powerd is available OLPC #11437

Simon Schampijer simon at schampijer.de
Mon Nov 28 04:42:05 EST 2011


On the XO 1.75 '/ofw' is not used anymore on the XO-1.75,
'/proc/device-tree' is used now instead. Check if powerd
is available to determine if the power section is displayed or
not.

Signed-off-by: Simon Schampijer <simon at laptop.org>
---
 src/jarabe/controlpanel/gui.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/jarabe/controlpanel/gui.py b/src/jarabe/controlpanel/gui.py
index 2f55951..46810aa 100644
--- a/src/jarabe/controlpanel/gui.py
+++ b/src/jarabe/controlpanel/gui.py
@@ -30,6 +30,7 @@ from jarabe.controlpanel.toolbar import MainToolbar
 from jarabe.controlpanel.toolbar import SectionToolbar
 from jarabe import config
 
+POWERD_FLAG_DIR = '/etc/powerd/flags'
 
 _logger = logging.getLogger('ControlPanel')
 
@@ -129,7 +130,7 @@ class ControlPanel(gtk.Window):
                                    self.__search_changed_cb)
 
     def _setup_options(self):
-        if not os.path.exists('/ofw'):
+        if not os.access(POWERD_FLAG_DIR, os.W_OK):
             del self._options['power']
 
         try:
-- 
1.7.7.3



More information about the Sugar-devel mailing list