improve differ performance
This commit is contained in:
parent
6f3105377a
commit
e77fb313b3
@ -52,7 +52,7 @@ class screenManager():
|
|||||||
# changes on the screen
|
# changes on the screen
|
||||||
if (environment['screenData']['oldContentText'] != environment['screenData']['newContentText']) and \
|
if (environment['screenData']['oldContentText'] != environment['screenData']['newContentText']) and \
|
||||||
(len(environment['screenData']['newContentText']) > 0):
|
(len(environment['screenData']['newContentText']) > 0):
|
||||||
diff = difflib.ndiff(environment['screenData']['oldContentText'], environment['screenData']['newContentText'])
|
diff = difflib.ndiff(" ".join(environment['screenData']['oldContentText'].split()), " ".join(environment['screenData']['newContentText'].split()))
|
||||||
environment['screenData']['delta'] = ''.join(x[2:] for x in diff if x.startswith('+ '))
|
environment['screenData']['delta'] = ''.join(x[2:] for x in diff if x.startswith('+ '))
|
||||||
if ((len(environment['screenData']['delta']) < 3)):
|
if ((len(environment['screenData']['delta']) < 3)):
|
||||||
environment['runtime']['speechDriver'].cancel()
|
environment['runtime']['speechDriver'].cancel()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user