remove not useful chars
This commit is contained in:
parent
e54cd66a9e
commit
377de2632a
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user