def getDriver(self): drv = '' hw = functions.getGraphicsCard() # Is it Nvidia? nvChk = re.search('\\b' + hwCodes[0] + '\\b', hw.lower()) if nvChk: if self.distribution == 'debian': # Get Debian driver for Nvidia self.log.write('Get the appropriate Nvidia driver', 'nvidia.getNvidia', 'info') drv = self.ec.run( "nvidia-detect | grep nvidia- | tr -d ' '")[0] self.log.write('Nvidia driver to install: ' + drv, 'nvidia.getNvidia', 'info') else: # Get Ubuntu driver for Nvidia nvChip = re.search('geforce (\d+)', hw.lower()) if nvChip: for chip in nvUbuntu: if (nvChip.group(1) >= nvUbuntuMin and nvChip.group(1) < chip[0]) or chip[0] == 0: drv = chip[1] self.log.write('Nvidia driver to install: ' + drv, 'nvidia.getNvidia', 'info') break else: self.log.write('No Nvidia card found', 'nvidia.getNvidia', 'debug') return drv
def getNvidia(self): hwList = [] # Get the appropriate driver drv = self.getDriver() if drv != '': self.log.write('Get package status for driver: ' + drv, 'nvidia.getNvidia', 'info') status = functions.getPackageStatus(drv) self.log.write('Package status: ' + status, 'nvidia.getNvidia', 'debug') hw = functions.getGraphicsCard() hwList.append([hw, hwCodes[0], status]) return hwList
def getDriver(self): drv = '' hw = functions.getGraphicsCard() # Is it Nvidia? nvChk = re.search('\\b' + hwCodes[0] + '\\b', hw.lower()) if nvChk: if self.distribution == 'debian': # Get Debian driver for Nvidia self.log.write('Get the appropriate Nvidia driver', 'nvidia.getNvidia', 'info') drv = self.ec.run("nvidia-detect | grep nvidia- | tr -d ' '")[0] self.log.write('Nvidia driver to install: ' + drv, 'nvidia.getNvidia', 'info') else: # Get Ubuntu driver for Nvidia nvChip = re.search('geforce (\d+)', hw.lower()) if nvChip: for chip in nvUbuntu: if (nvChip.group(1) >= nvUbuntuMin and nvChip.group(1) < chip[0]) or chip[0] == 0: drv = chip[1] self.log.write('Nvidia driver to install: ' + drv, 'nvidia.getNvidia', 'info') break else: self.log.write('No Nvidia card found', 'nvidia.getNvidia', 'debug') return drv
def __init__(self, distribution, loggerObject): self.distribution = distribution.lower() self.log = loggerObject self.ec = ExecCmd(self.log) self.hw = functions.getGraphicsCard()