本文整理汇总了Python中jockey.handlers.KernelModuleHandler.module_loaded方法的典型用法代码示例。如果您正苦于以下问题:Python KernelModuleHandler.module_loaded方法的具体用法?Python KernelModuleHandler.module_loaded怎么用?Python KernelModuleHandler.module_loaded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jockey.handlers.KernelModuleHandler
的用法示例。
在下文中一共展示了KernelModuleHandler.module_loaded方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: used
# 需要导入模块: from jockey.handlers import KernelModuleHandler [as 别名]
# 或者: from jockey.handlers.KernelModuleHandler import module_loaded [as 别名]
def used(self):
"""Return if the handler is currently in use."""
return (
KernelModuleHandler.used(self)
and self.enabled()
and not (
KernelModuleHandler.module_loaded("b43")
or KernelModuleHandler.module_loaded("b43legacy")
or KernelModuleHandler.module_loaded("bcm43xx")
)
)
示例2: used
# 需要导入模块: from jockey.handlers import KernelModuleHandler [as 别名]
# 或者: from jockey.handlers.KernelModuleHandler import module_loaded [as 别名]
def used(self):
'''Return if the handler is currently in use.'''
if self.changed() and self.enabled():
return False
# See if "nvidia" is loaded and if the alias corresponds to nvidia_$flavour
return KernelModuleHandler.module_loaded(self._module_alias) and \
self._alternatives.resolve_module_alias(self._module_alias) == self.module and \
(self.package is None or OSLib.inst.package_installed(self.package))
示例3: enables_composite
# 需要导入模块: from jockey.handlers import KernelModuleHandler [as 别名]
# 或者: from jockey.handlers.KernelModuleHandler import module_loaded [as 别名]
def enables_composite(self):
'''Return whether this driver supports the composite extension.'''
# When using an upstream installation, or -new/-legacy etc., we already
# have composite
if KernelModuleHandler.module_loaded('nvidia'):
logging.debug('enables_composite(): already using nvidia driver from nondefault package')
return False
# neither vesa nor nv support composite, so safe to say yes here
return True
示例4: enabled
# 需要导入模块: from jockey.handlers import KernelModuleHandler [as 别名]
# 或者: from jockey.handlers.KernelModuleHandler import module_loaded [as 别名]
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)