Skip to content

Commit

Permalink
Replace self.filename[:-4] with Path(self.filename).stem
Browse files Browse the repository at this point in the history
  • Loading branch information
Bouni committed Jan 29, 2024
1 parent dfb9778 commit 69a6b9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fabrication.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def generate_excellon(self):

def zip_gerber_excellon(self):
"""Zip Gerber and Excellon files, ready for upload to JLCPCB."""
zipname = f"GERBER-{self.filename[:-4]}.zip"
zipname = f"GERBER-{Path(self.filename).stem}.zip"
with ZipFile(
os.path.join(self.outputdir, zipname),
"w",
Expand All @@ -246,7 +246,7 @@ def zip_gerber_excellon(self):

def generate_cpl(self):
"""Generate placement file (CPL)."""
cplname = f"CPL-{self.filename[:-4]}.csv"
cplname = f"CPL-{Path(self.filename).stem}.csv"
self.corrections = self.parent.library.get_all_correction_data()
aux_orgin = self.board.GetDesignSettings().GetAuxOrigin()
add_without_lcsc = self.parent.settings.get("gerber", {}).get(
Expand Down Expand Up @@ -282,7 +282,7 @@ def generate_cpl(self):

def generate_bom(self):
"""Generate BOM file."""
bomname = f"BOM-{self.filename[:-4]}.csv"
bomname = f"BOM-{Path(self.filename).stem}.csv"
add_without_lcsc = self.parent.settings.get("gerber", {}).get(
"lcsc_bom_cpl", True
)
Expand Down

0 comments on commit 69a6b9f

Please sign in to comment.