Fix for issue #57, now searches multiple directories.

This commit is contained in:
Chris Palmer 2020-03-01 10:55:52 +00:00
parent 1a197ac823
commit c41b1fa115
2 changed files with 4 additions and 4 deletions

View File

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

View File

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