本文整理汇总了Python中jockey.handlers.KernelModuleHandler类的典型用法代码示例。如果您正苦于以下问题:Python KernelModuleHandler类的具体用法?Python KernelModuleHandler怎么用?Python KernelModuleHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KernelModuleHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: enabled
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)
示例2: __init__
def __init__(self, ui):
KernelModuleHandler.__init__(self, ui, 'wl',
name=_('Broadcom 802.11 STA driver'),
description=_('Broadcom 802.11 Linux STA Driver for WiFi cards.'),
rationale=_('Broadcom 802.11 Linux STA Driver for WiFi, a linux'
' device driver for use with Broadcom\'s BCM4311-, BCM4312-,'
' BCM4321-, and BCM4322-based hardware.\n\n'))
示例3: __init__
def __init__(self, ui):
KernelModuleHandler.__init__(self, ui, 'vmxnet',
name=_('VMWare Client Tools'),
description=_('Install VMWare client drivers and tools'),
rationale=_('Install the VMWare client drivers'
'for your VMWare based {0} installation.\n\n'
'This should help you use {0} in your VM.').format(OSLib.inst.os_vendor))
示例4: disable
def disable(self):
'''Prevent the OS from using it even if the hardware is available.
'''
OSLib.inst.queue_packages_for_removal( { 'nvidia-xconfig',
'nvidia-settings' } )
KernelModuleHandler.disable(self)
return False
示例5: __init__
def __init__(self, ui):
KernelModuleHandler.__init__(self, ui, 'fglrx',
name=_('AMD proprietary Catalyst graphics driver'),
description=_('3D-accelerated proprietary graphics driver for '
'AMD (ATI) cards.'),
rationale=_('This driver is required to fully utilise the 3D '
'potential of some AMD (ATI) graphics cards, as well as provide '
'2D acceleration of newer cards.'))
示例6: __init__
def __init__(self, ui):
KernelModuleHandler.__init__(self, ui, 'vmxnet',
name=_('VMWare Client Tools'),
description=_('Install VMWare client drivers and tools'),
rationale=_('Install the VMWare client drivers and tools'
'for your VMWare based Ubuntu installation.\n\n'
'This should help you use Ubuntu in your VM.'))
self.package = 'open-vm-dkms'
self._free = True
示例7: __init__
def __init__(self, ui):
KernelModuleHandler.__init__(self, ui, 'easycap',
name=_('Staging kernel modules'),
description=_('WARNING: Experimental drivers.'),
rationale=_('Staging can provide this module: easycap\n\n'
'You probably only want to enable this if '
'your hardware does not work at all.\n\n'
'These are drivers which are not yet in the '
'stable kernel tree, but due to be merged soon.'))
示例8: __init__
def __init__(self, ui):
KernelModuleHandler.__init__(self, ui, 'wl',
name=_('Broadcom 802.11 STA driver'),
description=_('Proprietary drivers for Broadcom 802.11 WiFi cards.'),
rationale=_('Broadcom 802.11 Linux STA Driver for WiFi, a linux'
' device driver for use with Broadcom\'s BCM4311-, BCM4312-,'
' BCM4321-, and BCM4322-based hardware.\n\n'
'You probably only want to enable this if '
'your wifi does not work well (or at all).'))
示例9: __init__
def __init__(self, ui):
KernelModuleHandler.__init__(self, ui, 'nvidia',
name=_('NVIDIA accelerated graphics driver'),
description=_('3D-accelerated proprietary graphics driver for '
'NVIDIA cards.'),
rationale=_('This driver is required to fully utilise '
'the 3D potential of NVIDIA based graphics cards.\n\n'
'If the default open source Nouveau driver is not be able '
'to power some 3D games, you can try this driver instead.'))
self._recommended = None
示例10: enable
def enable(self):
KernelModuleHandler.enable(self)
# rebinding does not work, we have to unload/reload
mods = []
proc_modules = open(OSLib.inst.proc_modules)
for line in open(OSLib.inst.proc_modules):
if 'dvb_usb' in line:
mods.append(line.split()[0])
logging.debug('reloading modules: %s' % ' '.join(mods))
subprocess.call([OSLib.inst.modprobe_path, '-r'] + mods)
subprocess.call([OSLib.inst.modprobe_path, '-a'] + mods)
示例11: used
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")
)
)
示例12: __init__
def __init__(self, ui):
KernelModuleHandler.__init__(
self,
ui,
"STAGING_MODULE",
name=_("Staging kernel modules"),
description=_("WARNING: Experimental drivers."),
rationale=_(
"Staging can provide this module: STAGING_MODULE\n\n"
"You probably only want to enable this if "
"your hardware does not work at all.\n\n"
"These are drivers which are not yet in the "
"stable kernel tree, but due to be merged soon."
),
)
示例13: used
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))
示例14: enables_composite
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
示例15: __init__
def __init__(self, ui):
KernelModuleHandler.__init__(
self,
ui,
"ath_pci",
name=_('Alternate Atheros "madwifi" driver'),
description=_('Alternate "madwifi" driver for Atheros wireless LAN cards.'),
rationale=_(
"Only activate this driver if you have problems "
"with your wireless LAN connection.\n\n"
'The free "ath5k" driver should work with most '
"Atheros cards nowadays, but on some computers this "
"alternate (but proprietary) driver still works better, "
"or at all."
),
)
self._free = False
# do not announce this if ath5k works
self.announce = not self.module_loaded("ath5k")
self.blacklist_file = os.path.join(os.path.dirname(OSLib.inst.module_blacklist_file), "blacklist-ath_pci.conf")