mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-06 04:09:47 +00:00
Improved docs gen handling of OpenSCAD errors.
This commit is contained in:
parent
11aed06813
commit
0f5abbd2ae
1 changed files with 10 additions and 2 deletions
|
@ -202,6 +202,13 @@ class ImageProcessing(object):
|
||||||
print(script)
|
print(script)
|
||||||
print("////////////////////////////////////////////////////")
|
print("////////////////////////////////////////////////////")
|
||||||
print("")
|
print("")
|
||||||
|
with open("FAILED.scad", "w") as f:
|
||||||
|
print("////////////////////////////////////////////////////", file=f)
|
||||||
|
print("// {}: {} for {}".format(libfile, scriptfile, imgfile), file=f)
|
||||||
|
print("////////////////////////////////////////////////////", file=f)
|
||||||
|
print(script, file=f)
|
||||||
|
print("////////////////////////////////////////////////////", file=f)
|
||||||
|
print("", file=f)
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
tmpimgs.append(tmpimgfile)
|
tmpimgs.append(tmpimgfile)
|
||||||
|
|
||||||
|
@ -248,8 +255,9 @@ class ImageProcessing(object):
|
||||||
else:
|
else:
|
||||||
if targimgfile.endswith(".gif"):
|
if targimgfile.endswith(".gif"):
|
||||||
cmpcmd = ["cmp", newimgfile, targimgfile]
|
cmpcmd = ["cmp", newimgfile, targimgfile]
|
||||||
res = subprocess.call(cmpcmd)
|
p = subprocess.Popen(cmpcmd, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True)
|
||||||
issame = res == 0
|
err = p.stdout.read()
|
||||||
|
issame = p.returncode == 0
|
||||||
else:
|
else:
|
||||||
cmpcmd = [COMPARE, "-metric", "MAE", newimgfile, targimgfile, "null:"]
|
cmpcmd = [COMPARE, "-metric", "MAE", newimgfile, targimgfile, "null:"]
|
||||||
p = subprocess.Popen(cmpcmd, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True)
|
p = subprocess.Popen(cmpcmd, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True)
|
||||||
|
|
Loading…
Reference in a new issue