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