From cd85d54edf3d192aa81a7955d5b12e17fa113650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B0=D0=BC=D0=BE=D1=83=D0=BA=D0=B8=D0=BD=20=D0=90?= =?UTF-8?q?=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Fri, 25 Jun 2010 14:43:57 +0400 Subject: [PATCH] Removed methods get_hr_x11_video_drv() and get_hr_video() --- pym/cl_fill_desktop.py | 61 ------------------------------------------ 1 file changed, 61 deletions(-) diff --git a/pym/cl_fill_desktop.py b/pym/cl_fill_desktop.py index 9012bfe..e06bddf 100644 --- a/pym/cl_fill_desktop.py +++ b/pym/cl_fill_desktop.py @@ -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")