From a8a42e42da7391eb6f480c045af224432895437e Mon Sep 17 00:00:00 2001 From: chrys87 Date: Thu, 24 May 2018 16:16:29 +0200 Subject: [PATCH] Update ptyDriver.py --- src/fenrirscreenreader/screenDriver/ptyDriver.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/fenrirscreenreader/screenDriver/ptyDriver.py b/src/fenrirscreenreader/screenDriver/ptyDriver.py index 62792739..d28c1672 100644 --- a/src/fenrirscreenreader/screenDriver/ptyDriver.py +++ b/src/fenrirscreenreader/screenDriver/ptyDriver.py @@ -37,13 +37,17 @@ class Terminal: allAttributes = [] text = '\n'.join(self.screen.display) start = time.time() - #buffer self.screen.buffer + buffer self.screen.buffer #buffer = [[[1,1],[1,2]], [[2,1],[2,2]], [[3,1],[3,2]]] #[buffer[x][y] for x in xrange(0,2) for y in xrange(0,1)] - for y in range(self.screen.lines): - line = self.screen.buffer[y] - attributes = [list(char[1:]) + [False, 'default', 'default'] for char in (line[x] for x in range(self.screen.columns))] - allAttributes.append(attributes) + #columns = 2 + #rows = 3 + #[buffer[x][0] + [False, 'default', 'default'] for line in (buffer[x] for x in range(columns))] + allAttributes = [[attribute[1:] + [False, 'default', 'default'] for attribute in line] for line in buffer] + #for y in range(self.screen.lines): + # line = self.screen.buffer[y] + # attributes = [list(char[1:]) + [False, 'default', 'default'] for char in (line[x] for x in range(self.screen.columns))] + # allAttributes.append(attributes) print(time.time() -start) self.screen.dirty.clear() return {"cursor": (cursor.x, cursor.y),