From 90c0e14b73c468059a0a860f0fe354df8ef46b40 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Tue, 25 Aug 2020 13:46:08 -0300 Subject: [PATCH] Added support for PcbDraw v0.6.0. --- kibot/kiplot.py | 4 ++-- kibot/misc.py | 1 + kibot/out_pcbdraw.py | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/kibot/kiplot.py b/kibot/kiplot.py index 386f4869..2864d89e 100644 --- a/kibot/kiplot.py +++ b/kibot/kiplot.py @@ -88,9 +88,9 @@ def check_version(command, version): cmd = [command, '--version'] logger.debug('Running: '+str(cmd)) result = run(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True) - z = re.match(command + r' (\d+\.\d+\.\d+)', result.stdout) + z = re.match(command + r' (\d+\.\d+\.\d+)', result.stdout, re.IGNORECASE) if not z: - z = re.search(r'Version: (\d+\.\d+\.\d+)', result.stdout) + z = re.search(r'Version: (\d+\.\d+\.\d+)', result.stdout, re.IGNORECASE) if not z: logger.error('Unable to determine ' + command + ' version:\n' + result.stdout) diff --git a/kibot/misc.py b/kibot/misc.py index 93f5f1f5..515d7436 100644 --- a/kibot/misc.py +++ b/kibot/misc.py @@ -42,5 +42,6 @@ CMD_IBOM = 'generate_interactive_bom.py' URL_IBOM = 'https://github.com/INTI-CMNB/InteractiveHtmlBom' KICAD2STEP = 'kicad2step' PCBDRAW = 'pcbdraw' +URL_PCBDRAW = 'https://github.com/INTI-CMNB/pcbdraw' EXAMPLE_CFG = 'example.kibot.yaml' AUTO_SCALE = 0 diff --git a/kibot/out_pcbdraw.py b/kibot/out_pcbdraw.py index 628304df..c2114fda 100644 --- a/kibot/out_pcbdraw.py +++ b/kibot/out_pcbdraw.py @@ -8,7 +8,8 @@ import re from shutil import which from tempfile import (NamedTemporaryFile) from subprocess import (check_output, STDOUT, CalledProcessError) -from .misc import (PCBDRAW, PCBDRAW_ERR) +from .misc import PCBDRAW, PCBDRAW_ERR, URL_PCBDRAW +from .kiplot import check_script from .error import KiPlotConfigurationError from .gs import (GS) from .optionable import (BaseOptions, Optionable) @@ -203,6 +204,7 @@ class PcbDrawOptions(BaseOptions): return f.name def run(self, output_dir, board): + check_script(PCBDRAW, URL_PCBDRAW, '0.6.0') # Output file name output = self.expand_filename(output_dir, self.output, 'bottom' if self.bottom else 'top', self.format) # Base command with overwrite @@ -231,8 +233,8 @@ class PcbDrawOptions(BaseOptions): cmd.extend(['-f', self.show_components]) if self.vcuts: cmd.append('-v') - if self.warnings == 'all': - cmd.append('--warn-back') + if self.warnings == 'visible': + cmd.append('--no-warn-back') elif self.warnings == 'none': cmd.append('--silent') if self.dpi: