Handle HAL and DBus restarts Definition at line 122 of file powermanage.py. 00122 : """ Handle HAL and DBus restarts """ try: self.hal_manager.FindDeviceByCapability("") except dbus.DBusException, e: if str(e) == 'org.freedesktop.DBus.Error.Disconnected: Connection is closed' \ or str(e) == 'org.freedesktop.DBus.Error.Disconnected: Connection was disconnected before a reply was received': # DBus doesn't support on-the-fly restart print "connection with DBus lost, please restart the display manager" return if os.system("ps aux|grep [h]ald-runner") == 0: print "connection with HAL lost, trying to reconnect" self._initHAL() self._initBrightness() self._initBattery() self._initAc() self._initLid() self._checkSuspend() self._checkCpuCapabilities() else: print "HAL is not running" def isLaptop(self):
|