Made library search order deterministic by sorting the result of os.listdir()

This commit is contained in:
Chris Palmer 2020-03-01 17:53:20 +00:00
parent c41b1fa115
commit 343351155c
2 changed files with 2 additions and 2 deletions

View File

@ -83,7 +83,7 @@ def make_parts(target, part_type, parts = None):
#
# Find all the scad files
#
lib_dirs = [path + '/' + lib + '/printed' for path in os.environ['OPENSCADPATH'].split(os.pathsep) for lib in os.listdir(path)]
lib_dirs = [path + '/' + lib + '/printed' for path in os.environ['OPENSCADPATH'].split(os.pathsep) for lib in sorted(os.listdir(path))]
module_suffix = '_dxf' if part_type == 'svg' else '_' + part_type
for dir in [source_dir, source_dir + '/printed'] + lib_dirs:
if os.path.isdir(dir):

View File

@ -124,7 +124,7 @@ def views(target, do_assemblies = None):
# Find all the scad files
#
main_blurb = None
lib_dirs = [path + '/' + lib + '/printed' for path in os.environ['OPENSCADPATH'].split(os.pathsep) for lib in os.listdir(path)]
lib_dirs = [path + '/' + lib + '/printed' for path in os.environ['OPENSCADPATH'].split(os.pathsep) for lib in sorted(os.listdir(path))]
for dir in [source_dir, source_dir + '/printed'] + lib_dirs:
if os.path.isdir(dir):
for filename in os.listdir(dir):