diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 diff --git a/src/fenrir/screenDriver/linux.py b/src/fenrir/screenDriver/linux.py index 165d0d2d..bd4a8e28 100644 --- a/src/fenrir/screenDriver/linux.py +++ b/src/fenrir/screenDriver/linux.py @@ -116,6 +116,7 @@ class driver(): self.env['screenData']['newNegativeDelta'] = '' self.env['screenData']['newDelta'] = '' self.env['screenData']['newAttribDelta'] = '' + # changes on the screen oldScreenText = re.sub(' +',' ',self.env['runtime']['screenManager'].getWindowAreaInText(self.env['screenData']['oldContentText'])) newScreenText = re.sub(' +',' ',self.env['runtime']['screenManager'].getWindowAreaInText(self.env['screenData']['newContentText'])) @@ -149,4 +150,8 @@ class driver(): else: self.env['screenData']['newDelta'] = ''.join(x[2:] for x in diffList if x[0] == '+') self.env['screenData']['newNegativeDelta'] = ''.join(x[2:] for x in diffList if x[0] == '-') + + # track highlighted + if self.env['screenData']['oldContentAttrib'] != self.env['screenData']['newContentAttrib']: + pass diff --git a/src/fenrir/utils/screen_utils.py b/src/fenrir/utils/screen_utils.py index bb9504c7..554f7720 100644 --- a/src/fenrir/utils/screen_utils.py +++ b/src/fenrir/utils/screen_utils.py @@ -10,24 +10,24 @@ from collections import Counter def insertNewlines(string, every=64): return '\n'.join(string[i:i+every] for i in range(0, len(string), every)) -def splitAtrrLines(string, every=64): +def splitOnPos(string, every=64): return list(string[i:i+every] for i in range(0, len(string), every)) old = b'eeeemmmeeeeeeeee' new = b'eeeeeueeeeeeeeee' text = 'das ist ein test' -def trackHighlights(oldAttr, newAttr, text): +def trackHighlights(oldAttr, newAttr, text, lenght): result = '' currCursor = None if oldAttr == newAttr: return result, currCursor if len(newAttr) == 0: return result, currCursor - textLines = insertNewlines(text,4) + textLines = insertNewlines(text,lenght) textLines = textLines.split('\n') - old = splitAtrrLines(oldAttr,4) - new = splitAtrrLines(newAttr,4) + old = splitOnPos(oldAttr,lenght) + new = splitOnPos(newAttr,lenght) if len(old) != len(new): return result, currCursor if len(text) != len(new):