Marco Pesenti Gritti wrote:
> Bernardo Innocenti wrote:
>> Sorry, I sent the patches in reverse order.  Did you get
>> the next one?
> 
> Nope, and I can't find it in the archives... can you resend please?

That's probably because I had sent it to [EMAIL PROTECTED]
Force of habit...


>From 6a0a13fd346b5c77dabb7368d495e880a3417527 Mon Sep 17 00:00:00 2001
From: Bernardo Innocenti <[EMAIL PROTECTED]>
Date: Wed, 13 Jun 2007 20:33:42 -0400
Subject: [PATCH] add set_dcon_freeze()
Organization: One Laptop Per Child

This is part of a masterplan to implement #621 .
---
 hardwaremanager.py |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/hardwaremanager.py b/hardwaremanager.py
index 3eeed82..478d428 100755
--- a/hardwaremanager.py
+++ b/hardwaremanager.py
@@ -40,6 +40,7 @@ _KEYBOARD_BRIGHTNESS_KEY = 
'/sys/class/leds/olpc:keyboard/brightness'
 _DISPLAY_BRIGHTNESS_KEY = '/sys/class/backlight/dcon-bl/brightness'
 _DISPLAY_MODE_KEY = '/sys/devices/platform/dcon/output'
 _DCON_SOURCE_KEY = '/sys/devices/platform/dcon/source'
+_DCON_FREEZE_KEY = '/sys/devices/platform/dcon/freeze'
 _POWER_STATE_KEY = '/sys/power/state'
 
 class HardwareManagerService(dbus.service.Object):
@@ -58,6 +59,19 @@ class HardwareManagerService(dbus.service.Object):
             logging.error('Cannot write DCON source to sysfs.')
 
     @dbus.service.method(HARDWARE_MANAGER_INTERFACE,
+                         in_signature='b', out_signature='')
+    def set_dcon_freeze(self, frozen):
+        try:
+            f = open(_DCON_FREEZE_KEY, 'w')
+            if frozen:
+                f.write('1')
+            else:
+                f.write('0')
+            f.close()
+        except IOError:
+            logging.error('Cannot write DCON freeze to sysfs.')
+
+    @dbus.service.method(HARDWARE_MANAGER_INTERFACE,
                          in_signature='i', out_signature='')
     def set_display_mode(self, mode):
         if mode != COLOR_MODE and mode != BLACK_AND_WHITE_MODE:
-- 
1.5.2





-- 
   // Bernardo Innocenti
 \X/  http://www.codewiz.org/
_______________________________________________
Sugar mailing list
[email protected]
http://lists.laptop.org/listinfo/sugar

Reply via email to