From 854adab6650e7617588e2da821cd91fa97657eaa Mon Sep 17 00:00:00 2001 From: Chris Palmer Date: Sun, 18 Aug 2019 15:21:01 +0100 Subject: [PATCH] Fix for Python 2 --- scripts/openscad.py | 10 ++++++++-- scripts/plateup.py | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/openscad.py b/scripts/openscad.py index 3dded6f..86ac8eb 100644 --- a/scripts/openscad.py +++ b/scripts/openscad.py @@ -24,8 +24,8 @@ from __future__ import print_function import subprocess, sys -def run(*args, silent = False): - cmd = ["openscad"] + list(args) +def _run(args, silent): + cmd = ["openscad"] + args if not silent: for arg in cmd: print(arg, end=" ") @@ -37,3 +37,9 @@ def run(*args, silent = False): print(line[:-1]) if rc: sys.exit(rc) + +def run(*args): + _run(list(args), False) + +def run_silent(*args): + _run(list(args), True); diff --git a/scripts/plateup.py b/scripts/plateup.py index 54a44f6..b07bc71 100644 --- a/scripts/plateup.py +++ b/scripts/plateup.py @@ -67,7 +67,7 @@ def plateup(target, part_type): log_name = 'openscad.log' else: log_name = 'openscad.echo' - openscad.run("-D$bom=1", "-o", log_name, src_file, silent = True) + openscad.run_silent("-D$bom=1", "-o", log_name, src_file) # # Add the files on the BOM to the used list #