Skip to content

Commit

Permalink
add win grebv
Browse files Browse the repository at this point in the history
  • Loading branch information
yair-mantis committed Jul 26, 2023
1 parent 7c77311 commit dad076f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions hardware/kicad_gerber_gen.py
Expand Up @@ -139,12 +139,12 @@ def get_filename_without_extension(file_path):
# Rename the .drl file, so it apears first in the list of gerber files
drill_file = pctl.GetPlotDirName() + filename
print("rename " + drill_file + ".drl to " + drill_file + "-00.drl")
#delete previous then rename
if os.path.exists(drill_file + "-00.drl"):
print("file exists, skip rename")
else:
os.remove(drill_file + "-00.drl")
os.rename(drill_file + ".drl", drill_file + "-00-drill.drl")

# gerbv preview
### gerbv preview

# make list of all files in plotdir
plotfiles = []
Expand All @@ -157,6 +157,10 @@ def get_filename_without_extension(file_path):
# pass filelist to gerbv, with spaces between filenames
# run only if gerbv is installed
gerbv_executable = "gerbv"
#if windows run using "C:\bin\gerbv\gerbv.exe"
if platform.system() == "Windows":
gerbv_executable = r"C:\bin\gerbv\gerbv.exe"

if shutil.which(gerbv_executable) is not None:
subprocess.Popen([gerbv_executable] + plotfiles)
else:
Expand Down

0 comments on commit dad076f

Please sign in to comment.