From d502205032ee2896e6f1515face52f90f50ebf72 Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Thu, 21 Nov 2019 18:05:34 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=BE=D0=BF=D1=80=D0=B5=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=82=D0=B5=D0=BA=D1=83=D1=89=D0=B5?= =?UTF-8?q?=D0=B3=D0=BE=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=B2=D0=B8=D0=B4=D0=B5=D0=BE=D0=B4?= =?UTF-8?q?=D1=80=D0=B0=D0=B9=D0=B2=D0=B5=D1=80=D0=B0=20=D1=87=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=B7=20Xorg.0.log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/calculate/lib/utils/common.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pym/calculate/lib/utils/common.py b/pym/calculate/lib/utils/common.py index c8a3430..6c8be3c 100644 --- a/pym/calculate/lib/utils/common.py +++ b/pym/calculate/lib/utils/common.py @@ -323,7 +323,16 @@ def getVideoFromXorgLog(prefix="/", available_drivers=()): filter(lambda x: "drv" in x and reDriver.search(x), readLinesFile(xorg_log_file))))) if matchStrs: - return matchStrs[-1] + reUnload = re.compile('|'.join('UnloadModule: "(%s)"' % x + for x in matchStrs)) + matchUnload = [x.group(1) for x in + (reUnload.search(x) for x in + readLinesFile(xorg_log_file)) if x] + for drv in matchUnload: + if drv in matchStrs: + matchStrs.remove(drv) + if matchStrs: + return matchStrs[-1] return ""