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

Temporary files used during make_all and tests now in tmp dir.

This commit is contained in:
Chris Palmer
2021-02-09 09:52:26 +00:00
parent 182f39876a
commit fc44b43638
5 changed files with 76 additions and 9 deletions

View File

@@ -38,6 +38,7 @@ import shutil
import re
import copy
from colorama import Fore
from tmpdir import *
def is_assembly(s):
return s[-9:] == '_assembly' or s[-11:] == '_assemblies'
@@ -129,6 +130,7 @@ def views(target, do_assemblies = None):
# Make the target directory
#
top_dir = set_config(target, usage)
tmp_dir = mktmpdir(top_dir)
target_dir = top_dir + 'assemblies'
deps_dir = target_dir + "/deps"
bom_dir = top_dir + "bom"
@@ -204,15 +206,15 @@ def views(target, do_assemblies = None):
changed = check_deps(png_name, dname)
changed = times.check_have_time(changed, png_name)
changed = options.have_changed(changed, png_name)
tmp_name = 'tmp.png'
tmp_name = tmp_dir + '/' + real_name + '.png'
if changed:
print(changed)
#
# make a file to use the module
#
png_maker_name = 'png.scad'
png_maker_name = tmp_dir + '/png.scad'
with open(png_maker_name, "w") as f:
f.write("use <%s/%s>\n" % (dir, filename))
f.write("use <%s/%s>\n" % (reltmp(dir, target), filename))
f.write("%s();\n" % module);
t = time.time()
target_def = ['-D$target="%s"' % target] if target else []
@@ -439,6 +441,10 @@ def views(target, do_assemblies = None):
dst.write(line)
i += 1
#
# Remove tmp dir
#
rmtmpdir(tmp_dir)
#
# Spell check
#
do_cmd(('codespell -L od ' + top_dir + 'readme.md').split())