fix diff output of dumpmap --check-only
This commit is contained in:
parent
0ea7409fe4
commit
3c4ba4c84c
1 changed files with 3 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
import difflib
|
import difflib
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
@ -51,7 +52,7 @@ def _write_folder(objects, path, prettify=False, check_only=False, check_sister_
|
||||||
|
|
||||||
count += 1
|
count += 1
|
||||||
if check_only:
|
if check_only:
|
||||||
printlines(difflib.unified_diff(
|
sys.stdout.writelines(difflib.unified_diff(
|
||||||
list(open(full_filename)),
|
list(open(full_filename)),
|
||||||
[],
|
[],
|
||||||
fromfiledate=timezone.make_aware(
|
fromfiledate=timezone.make_aware(
|
||||||
|
@ -94,7 +95,7 @@ def _write_object(obj, path, filename, prettify=False, check_only=False):
|
||||||
print('- Created: '+os.path.join(path, filename))
|
print('- Created: '+os.path.join(path, filename))
|
||||||
|
|
||||||
if check_only:
|
if check_only:
|
||||||
printlines(difflib.unified_diff(
|
sys.stdout.write(difflib.unified_diff(
|
||||||
[] if old_data is None else [(line+'\n') for line in old_data_encoded.split('\n')],
|
[] if old_data is None else [(line+'\n') for line in old_data_encoded.split('\n')],
|
||||||
[(line+'\n') for line in new_data_encoded.split('\n')],
|
[(line+'\n') for line in new_data_encoded.split('\n')],
|
||||||
fromfiledate=timezone.make_aware(
|
fromfiledate=timezone.make_aware(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue