Moved deps directories to separate stl deps from views deps.

This commit is contained in:
Chris Palmer 2021-02-09 09:18:30 +00:00
parent 055e90cbb3
commit 182f39876a
4 changed files with 14 additions and 6 deletions

View File

@ -34,7 +34,7 @@ def read_deps(dname):
for line in lines:
if line.startswith('\t'):
dep = line[1 : -1].rstrip(' \\').replace('\\ ', ' ')
if not os.path.basename(dep) in ['stl.scad', 'dxf.scad', 'svf.scad', 'png.scad', 'target.scad'] and not '/stls/' in dep and not '/dxfs/' in dep:
if not os.path.basename(dep) in ['stl.scad', 'dxf.scad', 'svf.scad', 'png.scad', 'target.scad']:
deps.append(dep)
return deps

View File

@ -29,6 +29,7 @@ import time
import times
from deps import *
import json
import shutil
def bom_to_parts(bom_dir, part_type, assembly = None):
#
@ -62,12 +63,16 @@ def make_parts(target, part_type, parts = None):
#
top_dir = set_config(target, lambda: usage(part_type))
target_dir = top_dir + part_type + 's'
deps_dir = top_dir + "deps"
deps_dir = target_dir + "/deps"
bom_dir = top_dir + "bom"
if not os.path.isdir(target_dir):
os.makedirs(target_dir)
if not os.path.isdir(deps_dir):
os.makedirs(deps_dir)
if os.path.isdir(top_dir + '/deps'): #old location
shutil.rmtree(top_dir + '/deps')
times.read_times(target_dir)
#
# Decide which files to make

View File

@ -26,7 +26,7 @@ import sys
import c14n_stl
from set_config import *
from deps import *
from shutil import copyfile
import shutil
import re
source_dirs = { "stl" : "platters", "dxf" : "panels" }
@ -54,9 +54,12 @@ def plateup(target, part_type, usage = None):
#
# Make the deps dir
#
deps_dir = dir + "/deps"
deps_dir = parts_dir + "/deps"
if not os.path.isdir(deps_dir):
os.makedirs(deps_dir)
if os.path.isdir(dir + '/deps'): #old deps
shutil.rmtree(dir + '/deps')
#
# Decide which files to make
#
@ -100,7 +103,7 @@ def plateup(target, part_type, usage = None):
dst = target_dir + '/' + file
if mtime(src) > mtime(dst):
print("Copying %s to %s" % (src, dst))
copyfile(src, dst)
shutil.copyfile(src, dst)
copied.append(file)
#
# Remove any cruft

View File

@ -130,7 +130,7 @@ def views(target, do_assemblies = None):
#
top_dir = set_config(target, usage)
target_dir = top_dir + 'assemblies'
deps_dir = top_dir + "deps"
deps_dir = target_dir + "/deps"
bom_dir = top_dir + "bom"
if not os.path.isdir(target_dir):
os.makedirs(target_dir)