From f46f9557fd3628031c0da875cc595aa19ccaf99d Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Tue, 18 Oct 2022 12:55:19 -0300 Subject: [PATCH] [PcbDraw] Avoid creating a temporal file for the style - This is exactly the same structure needed by PcbDraw --- kibot/out_pcbdraw.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/kibot/out_pcbdraw.py b/kibot/out_pcbdraw.py index b1d1d7ef..989c6618 100644 --- a/kibot/out_pcbdraw.py +++ b/kibot/out_pcbdraw.py @@ -320,14 +320,11 @@ class PcbDrawOptions(VariantOptions): plotter.render_back = self.bottom plotter.mirror = self.mirror plotter.margin = mm2ki(self.margin) - # TODO: Pass it directly? If no: remove file? - tmp_style = None if self.style: if isinstance(self.style, str): plotter.resolve_style(self.style) else: - tmp_style = self._create_style() - plotter.resolve_style(tmp_style) + plotter.style = self.style plotter.plot_plan = [PlotSubstrate(drill_holes=not self.no_drillholes, outline_width=mm2ki(self.outline_width))] if self.show_solderpaste: plotter.plot_plan.append(PlotPaste()) @@ -346,9 +343,6 @@ class PcbDrawOptions(VariantOptions): except (RuntimeError, SyntaxError, IOError) as e: logger.error('PcbDraw error: '+str(e)) exit(PCBDRAW_ERR) - finally: - if tmp_style: - os.remove(tmp_style) save(image, save_output_name, self.dpi, format=save_output_format) # Do we need to convert the saved file?