mirror of
https://github.com/DJSundog/NopSCADlib.git
synced 2024-11-30 02:30:03 -05:00
Merge pull request #60 from nophead/issue_57
Fix for issue #57, now searches multiple directories.
This commit is contained in:
commit
3f209cbdd3
@ -83,9 +83,9 @@ def make_parts(target, part_type, parts = None):
|
|||||||
#
|
#
|
||||||
# Find all the scad files
|
# 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
|
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):
|
if os.path.isdir(dir):
|
||||||
for filename in os.listdir(dir):
|
for filename in os.listdir(dir):
|
||||||
if filename[-5:] == ".scad":
|
if filename[-5:] == ".scad":
|
||||||
|
@ -124,8 +124,8 @@ def views(target, do_assemblies = None):
|
|||||||
# Find all the scad files
|
# Find all the scad files
|
||||||
#
|
#
|
||||||
main_blurb = None
|
main_blurb = None
|
||||||
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))]
|
||||||
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):
|
if os.path.isdir(dir):
|
||||||
for filename in os.listdir(dir):
|
for filename in os.listdir(dir):
|
||||||
if filename.endswith('.scad'):
|
if filename.endswith('.scad'):
|
||||||
|
Loading…
Reference in New Issue
Block a user