remove not useful chars

This commit is contained in:
chrys87 2016-07-20 13:16:32 +02:00 committed by GitHub
parent e54cd66a9e
commit 377de2632a

View File

@ -4,6 +4,7 @@
import difflib
import textwrap
import time
import re
#import fenrir.utils.debug
class screen():
@ -71,8 +72,8 @@ class screen():
if environment['screenData']['newContentText'][:lastLine] == environment['screenData']['oldContentText'][:lastLine]:
diffStart = lastLine + 1
diff = difflib.ndiff(" ".join(environment['screenData']['oldContentText'][diffStart:].split(' ')),\
" ".join(environment['screenData']['newContentText'][diffStart:].split(' ')))
diff = difflib.ndiff(re.sub('[ \t]+', ' ', environment['screenData']['oldContentText'][diffStart:]),\
re.sub('[ \t]+', ' ', environment['screenData']['newContentText'][diffStart:]))
environment['screenData']['newDelta'] = ''.join(x[2:] for x in diff if x.startswith('+ '))
return environment