Logo Search packages:      
Sourcecode: guidance-power-manager version File versions

def powermanage::PowerManage::_initBrightness (   self  )  [private]

Search HAL for a screen with brightness controls.

Definition at line 292 of file powermanage.py.

00292                              :
        """ Search HAL for a screen with brightness controls."""

        brightnessDevice = self.hal_manager.FindDeviceByCapability("laptop_panel")

        if len(brightnessDevice) >= 1:
            self.hasBrightness = True
            self.brightnessObject = self.bus.get_object("org.freedesktop.Hal", brightnessDevice[0])
            self.brightness_properties = self.brightnessObject.GetAllProperties(
                                                dbus_interface="org.freedesktop.Hal.Device")
            try: 
                self.brightness_levels = self.brightness_properties[u'laptop_panel.num_levels']
            except KeyError,e:
                self.hasBrightness = False
                return 0 # Really don't know what to do here, but don't crash in any case.
            try:
                self.old_b = self.brightness_levels[-1] # Setting cached brightness value to  brightest
            except TypeError,e:
                return 0 # Really don't know what to do here, but don't crash in any case.
                
    def getBrightness(self):


Generated by  Doxygen 1.6.0   Back to index