|
|
|
|
@ -72,7 +72,13 @@ class CallbackBase:
|
|
|
|
|
for warning in res['warnings']:
|
|
|
|
|
self._display.warning(warning)
|
|
|
|
|
|
|
|
|
|
def _get_diff(self, diff):
|
|
|
|
|
def _get_diff(self, difflist):
|
|
|
|
|
|
|
|
|
|
if not isinstance(difflist, list):
|
|
|
|
|
difflist = [difflist]
|
|
|
|
|
|
|
|
|
|
ret = []
|
|
|
|
|
for diff in difflist:
|
|
|
|
|
try:
|
|
|
|
|
with warnings.catch_warnings():
|
|
|
|
|
warnings.simplefilter('ignore')
|
|
|
|
|
@ -95,11 +101,11 @@ class CallbackBase:
|
|
|
|
|
else:
|
|
|
|
|
after_header = 'after'
|
|
|
|
|
differ = difflib.unified_diff(to_unicode(diff['before']).splitlines(True), to_unicode(diff['after']).splitlines(True), before_header, after_header, '', '', 10)
|
|
|
|
|
for line in list(differ):
|
|
|
|
|
ret.append(line)
|
|
|
|
|
ret.extend(list(differ))
|
|
|
|
|
ret.append('\n')
|
|
|
|
|
return u"".join(ret)
|
|
|
|
|
except UnicodeDecodeError:
|
|
|
|
|
return ">> the files are different, but the diff library cannot compare unicode strings"
|
|
|
|
|
ret.append(">> the files are different, but the diff library cannot compare unicode strings\n\n")
|
|
|
|
|
|
|
|
|
|
def _process_items(self, result):
|
|
|
|
|
|
|
|
|
|
|