1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-24 16:13:07 +02:00

Avoid makeing empty folders for dxfs, stls or png if there are no parts of that type.

This commit is contained in:
Chris Palmer
2025-01-21 14:22:50 +00:00
parent 70fd7fbe14
commit 923c3b5c57
2 changed files with 18 additions and 10 deletions

View File

@@ -37,19 +37,21 @@ def usage():
sys.exit(1)
def render(target, type):
#
# Make the target directory
#
top_dir = set_config(target, usage)
tmp_dir = mktmpdir(top_dir)
target_dir = top_dir + type + 's'
bom_dir = top_dir + 'bom'
if not os.path.isdir(target_dir):
os.makedirs(target_dir)
#
# Find all the parts
#
parts = bom_to_parts(bom_dir, type)
if not parts:
return
#
# Make the target directory
#
tmp_dir = mktmpdir(top_dir)
target_dir = top_dir + type + 's'
if not os.path.isdir(target_dir):
os.makedirs(target_dir)
#
# Read the json bom to get the colours
#