Removed methods get_hr_x11_video_drv() and get_hr_video()

master3.3
Самоукин Алексей 14 years ago
parent 3c0c16d2b7
commit cd85d54edf

@ -138,7 +138,6 @@ class fillVars(glob_attr):
if ret in ("on","off"):
return ret
return "off"
def get_hr_laptop(self):
"""Если компьютер ноутбук, то его производитель"""
@ -156,66 +155,6 @@ class fillVars(glob_attr):
return vendor.lower()
return ""
def get_hr_x11_video_drv(self):
"""Get video driver used by xorg"""
xorg_modules_dir = '/usr/lib/xorg/modules/drivers'
xorg_conf = '/etc/X11/xorg.conf'
# Try analize Xorg.{DISPLAY}.log
display = os.environ.get('DISPLAY')
if display and os.path.exists(xorg_modules_dir):
list_avialable_drivers = os.listdir(xorg_modules_dir)
if list_avialable_drivers:
reDriver = re.compile('|'.join(list_avialable_drivers))
display_number = re.search(r':(\d+)\..*', display)
if display_number:
xorg_log_file = '/var/log/Xorg.%s.log' % \
display_number.group(1)
if os.path.exists(xorg_log_file):
matchStrs = [i for i in open(xorg_log_file)
if "drv" in i and reDriver.search(i)]
if matchStrs:
resDriver = re.search(r'([^/]+)_drv.so',
matchStrs[-1])
if resDriver:
return resDriver.group(1)
# analize /etc/X11/xorg.conf
if os.path.exists(xorg_conf):
matchSect = re.search(r'Section "Device".*?EndSection',
open('/etc/X11/xorg.conf').read(),re.S)
if matchSect:
resDriver = re.search(r'Driver\s*"([^"]+)"',
matchSect.group(0),re.S)
if resDriver:
return resDriver.group(1)
return "vesa"
def get_hr_video(self):
"""Производитель видеокарты"""
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"
if "nVidia" in line or "GeForce" in line:
return "nvidia"
elif "ATI" in line:
return "ati"
elif "Intel" in line:
return "intel"
elif "VIA" in line:
return "via"
elif "VMware" in line:
return "vmware"
else:
return "vesa"
def get_ur_jid_host(self):
"""Host Jabber пользователя"""
userJid = self.Get("ur_jid")

Loading…
Cancel
Save