sort listdirs for nicer loadmap-output

This commit is contained in:
Laura Klünder 2016-09-04 20:52:43 +02:00
parent fd5f402d95
commit a1809a46a2
2 changed files with 2 additions and 2 deletions

View file

@ -44,7 +44,7 @@ def _read_folder(package, cls, path, check_sister_file=False):
objects = []
if not os.path.isdir(path):
return []
for filename in os.listdir(path):
for filename in sorted(os.listdir(path)):
if not filename.endswith('.json'):
continue

View file

@ -45,7 +45,7 @@ def _write_folder(objects, path, prettify=False, check_only=False, check_sister_
count += _write_object(obj, path, filename, prettify, check_only)
if os.path.isdir(full_path):
for filename in os.listdir(full_path):
for filename in sorted(os.listdir(full_path)):
full_filename = os.path.join(full_path, filename)
if filename in filenames or not filename.endswith('.json') or not os.path.isfile(full_filename):
continue