Removed temporal projects created during `render_3d`

- See #110
This commit is contained in:
Salvador E. Tropea 2021-11-18 13:52:04 -03:00
parent 2a09151a18
commit 4537a1e061
1 changed files with 4 additions and 1 deletions

View File

@ -4,6 +4,7 @@
# License: GPL-3.0
# Project: KiBot (formerly KiPlot)
import os
from glob import glob
from shutil import rmtree
from .misc import CMD_PCBNEW_3D, URL_PCBNEW_3D, RENDER_3D_ERR
from .gs import (GS)
@ -118,7 +119,9 @@ class Render3DOptions(Base3DOptions):
ret = exec_with_retry(cmd)
# Remove the temporal PCB
if board_name != GS.pcb_file:
os.remove(board_name)
# KiCad likes to create project files ...
for f in glob(board_name.replace('.kicad_pcb', '.*')):
os.remove(f)
# Remove the downloaded 3D models
if self._tmp_dir:
rmtree(self._tmp_dir)