Add video card name variable.

develop
Mike Hiretsky 13 years ago
parent f14eacb037
commit 2c100fab3b

@ -24,7 +24,7 @@ from cl_vars_share import varsShare, clLocale
from os.path import exists as pathexists
from os import path
from cl_utils import isMount, genpassword, getAvailableX11Drivers, \
listDirectory,isPkgInstalled
listDirectory,isPkgInstalled,lspci
from utils import ip
from encrypt import getHash
@ -529,19 +529,21 @@ class fillVars(varsShare):
return valBoardName or "unknown"
return ""
def get_hr_video_name(self):
"""Get video name"""
pciVideo = list(sorted(lspci("VGA compatible").items()))
if pciVideo:
pciVideo = pciVideo[0][1]
vendor=pciVideo.get("vendor","").split(" ")[0]
name=pciVideo.get("name","")
if "[" in name and "]" in name:
name = name.partition("[")[2].partition("]")[0]
return "{vendor} {name}".format(vendor=vendor,name=name)
return ""
def get_hr_video(self):
"""Videocard vendor"""
lines=self._runos("lspci")
if not lines:
return ""
reVGA = re.compile("vga",re.I)
foundVGA = False
for line in lines:
if reVGA.search(line):
foundVGA = True
break
if not foundVGA:
return "vesa"
line = self.Get('hr_video_name')
if "nVidia" in line or "GeForce" in line:
return "nvidia"
elif "ATI" in line:

@ -185,6 +185,9 @@ class Data:
# video verdor name
hr_video = {'hide':True}
# videocard name
hr_video_name = {'hide':True}
# Video driver used by xorg
os_x11_video_drv = {'hide':True}

Loading…
Cancel
Save