Merge pull request #60 from nophead/issue_57

Fix for issue #57, now searches multiple directories.
This commit is contained in:
Chris 2020-03-02 18:38:36 +00:00 committed by GitHub
commit 3f209cbdd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 sorted(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 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):
if filename.endswith('.scad'):