From 103186cacd8d4534a92e000d0c076ec473d4f1ce Mon Sep 17 00:00:00 2001 From: chrys87 Date: Thu, 7 Jun 2018 18:16:12 +0200 Subject: [PATCH] only update charmap when needed - speedup --- src/fenrirscreenreader/screenDriver/vcsaDriver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fenrirscreenreader/screenDriver/vcsaDriver.py b/src/fenrirscreenreader/screenDriver/vcsaDriver.py index 4aa65d75..a5c823d3 100644 --- a/src/fenrirscreenreader/screenDriver/vcsaDriver.py +++ b/src/fenrirscreenreader/screenDriver/vcsaDriver.py @@ -106,6 +106,7 @@ class driver(screenDriver): tty = open('/sys/devices/virtual/tty/tty0/active','r') currScreen = str(tty.read()[3:-1]) oldScreen = currScreen + self.updateCharMap(currScreen) watchdog = select.epoll() watchdog.register(vcsa[currScreen], select.POLLPRI | select.POLLERR) watchdog.register(tty, select.POLLPRI | select.POLLERR) @@ -127,6 +128,7 @@ class driver(screenDriver): watchdog.register(vcsa[ currScreen ], select.POLLPRI | select.POLLERR) except: pass + self.updateCharMap(currScreen) oldScreen = currScreen try: vcsa[currScreen].seek(0) @@ -157,7 +159,6 @@ class driver(screenDriver): def createScreenEventData(self, screen, content): - self.updateCharMap(screen) eventData = { 'bytes': content, 'lines': int( content[0]),