def enabled(self): # See if nvidia (e.g. nvidia-current) is the current alternative target_alternative = self._alternatives.get_alternative_by_name(self.package) current_alternative = self._alternatives.get_current_alternative() other_target_alternative = self._other_alternatives.get_alternative_by_name(self.package) other_current_alternative = self._other_alternatives.get_current_alternative() logging.debug('NVidia(%s).enabled(): target_alt %s current_alt %s other target alt %s other current alt %s', self.module, target_alternative, current_alternative, other_target_alternative, other_current_alternative) if current_alternative is None: return False if current_alternative != target_alternative or \ other_current_alternative != other_target_alternative: logging.debug('%s is not the alternative in use', self.module) return False #if self.xorg_conf has NoneType, AttributeError will be raised if not self.xorg_conf: logging.debug('%s: xkit object does not exist!', self.module) return False # Make sure that neither the alias nor the actual module are blacklisted if OSLib.inst.module_blacklisted(self._module_alias) or OSLib.inst.module_blacklisted(self.module): logging.debug('%s is blacklisted, so not treating as enabled', self.module) return False kmh_enabled = KernelModuleHandler.enabled(self) logging.debug('KMH enabled: %s', str(kmh_enabled)) return KernelModuleHandler.enabled(self)
def enabled(self): #if self.xorg_conf has NoneType, AttributeError will be raised try: devices = self.xorg_conf.globaldict['Device'] try: driver = self.xorg_conf.getDriver('Device', 0) except (XKit.xorgparser.OptionException, XKit.xorgparser.SectionException): driver = None if len(devices) == 0 or driver != 'nvidia': return False except AttributeError: return False return KernelModuleHandler.enabled(self)
def enabled(self): # See if nvidia (e.g. nvidia-current) is the current alternative target_alternative = self._alternatives.get_alternative_by_name( self.package) current_alternative = self._alternatives.get_current_alternative() other_target_alternative = self._other_alternatives.get_alternative_by_name( self.package) other_current_alternative = self._other_alternatives.get_current_alternative( ) logging.debug( 'NVidia(%s).enabled(): target_alt %s current_alt %s other target alt %s other current alt %s', self.module, target_alternative, current_alternative, other_target_alternative, other_current_alternative) if current_alternative is None: return False if current_alternative != target_alternative or \ other_current_alternative != other_target_alternative: logging.debug('%s is not the alternative in use', self.module) return False #if self.xorg_conf has NoneType, AttributeError will be raised if not self.xorg_conf: logging.debug('%s: xkit object does not exist!', self.module) return False # Make sure that neither the alias nor the actual module are blacklisted if OSLib.inst.module_blacklisted( self._module_alias) or OSLib.inst.module_blacklisted( self.module): logging.debug('%s is blacklisted, so not treating as enabled', self.module) return False kmh_enabled = KernelModuleHandler.enabled(self) logging.debug('KMH enabled: %s', str(kmh_enabled)) return KernelModuleHandler.enabled(self)
def enabled(self): km = KernelModuleHandler.enabled(self) bcm = OSLib.inst.module_blacklisted('bcm43xx') b43 = OSLib.inst.module_blacklisted('b43') b43_legacy = OSLib.inst.module_blacklisted('b43legacy') b43_loaded = KernelModuleHandler.module_loaded('bcm43xx') or \ KernelModuleHandler.module_loaded('b43') or \ KernelModuleHandler.module_loaded('b43legacy') logging.debug( 'BroadcomWLHandler enabled(): kmod %s, bcm43xx: %s, b43: %s, b43legacy: %s' % (km and 'enabled' or 'disabled', bcm and 'blacklisted' or 'enabled', b43 and 'blacklisted' or 'enabled', b43_legacy and 'blacklisted' or 'enabled')) return (km and not b43_loaded) or (km and bcm and b43 and b43_legacy)
def enabled(self): km = KernelModuleHandler.enabled(self) bcm = OSLib.inst.module_blacklisted("bcm43xx") b43 = OSLib.inst.module_blacklisted("b43") b43_legacy = OSLib.inst.module_blacklisted("b43legacy") b43_loaded = ( KernelModuleHandler.module_loaded("bcm43xx") or KernelModuleHandler.module_loaded("b43") or KernelModuleHandler.module_loaded("b43legacy") ) logging.debug( "BroadcomWLHandler enabled(): kmod %s, bcm43xx: %s, b43: %s, b43legacy: %s" % ( km and "enabled" or "disabled", bcm and "blacklisted" or "enabled", b43 and "blacklisted" or "enabled", b43_legacy and "blacklisted" or "enabled", ) ) return (km and not b43_loaded) or (km and bcm and b43 and b43_legacy)
def enabled(self): return KernelModuleHandler.enabled(self)