test to remove unnedeed stuff

This commit is contained in:
chrys 2017-11-09 02:52:42 +01:00
parent f1557d3765
commit c30e937b5d

View File

@ -12,7 +12,6 @@
import difflib import difflib
import re
import subprocess import subprocess
import glob, os import glob, os
import termios import termios
@ -326,8 +325,8 @@ class driver(screenDriver):
self.env['screen']['newAttribDelta'] = '' self.env['screen']['newAttribDelta'] = ''
# changes on the screen # changes on the screen
oldScreenText = re.sub(' +',' ',self.env['runtime']['screenManager'].getWindowAreaInText(self.env['screen']['oldContentText'])) oldScreenText = self.env['runtime']['screenManager'].getWindowAreaInText(self.env['screen']['oldContentText'])
newScreenText = re.sub(' +',' ',self.env['runtime']['screenManager'].getWindowAreaInText(self.env['screen']['newContentText'])) newScreenText = self.env['runtime']['screenManager'].getWindowAreaInText(self.env['screen']['newContentText'])
typing = False typing = False
if (self.env['screen']['oldContentText'] != self.env['screen']['newContentText']): if (self.env['screen']['oldContentText'] != self.env['screen']['newContentText']):
if self.env['screen']['newContentText'] != '' and self.env['screen']['oldContentText'] == '': if self.env['screen']['newContentText'] != '' and self.env['screen']['oldContentText'] == '':
@ -343,14 +342,10 @@ class driver(screenDriver):
self.env['screen']['newContentText'][cursorLineEnd:] == self.env['screen']['oldContentText'][cursorLineEnd:]: self.env['screen']['newContentText'][cursorLineEnd:] == self.env['screen']['oldContentText'][cursorLineEnd:]:
cursorLineStartOffset = cursorLineStart cursorLineStartOffset = cursorLineStart
cursorLineEndOffset = cursorLineEnd cursorLineEndOffset = cursorLineEnd
#if cursorLineStart < cursorLineStart + self.env['screen']['newCursor']['x'] - 4:
# cursorLineStartOffset = cursorLineStart + self.env['screen']['newCursor']['x'] - 4
if cursorLineEnd > cursorLineStart + self.env['screen']['newCursor']['x'] + 3: if cursorLineEnd > cursorLineStart + self.env['screen']['newCursor']['x'] + 3:
cursorLineEndOffset = cursorLineStart + self.env['screen']['newCursor']['x'] + 3 cursorLineEndOffset = cursorLineStart + self.env['screen']['newCursor']['x'] + 3
oldScreenText = self.env['screen']['oldContentText'][cursorLineStartOffset:cursorLineEndOffset] oldScreenText = self.env['screen']['oldContentText'][cursorLineStartOffset:cursorLineEndOffset]
oldScreenText = re.sub(' +',' ',oldScreenText)
newScreenText = self.env['screen']['newContentText'][cursorLineStartOffset:cursorLineEndOffset] newScreenText = self.env['screen']['newContentText'][cursorLineStartOffset:cursorLineEndOffset]
newScreenText = re.sub(' +',' ',newScreenText)
diff = difflib.ndiff(oldScreenText, newScreenText) diff = difflib.ndiff(oldScreenText, newScreenText)
typing = True typing = True
else: else: