Update python/kicad_interface.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Tom
2026-04-18 14:31:09 +02:00
committed by GitHub
parent dd19828cba
commit 75a0b764d5

View File

@@ -617,7 +617,9 @@ class KiCADInterface:
sch_path = path if path and path != "." else None sch_path = path if path and path != "." else None
schematic = SchematicManager.create_schematic(project_name, path=sch_path, metadata=metadata) schematic = SchematicManager.create_schematic(project_name, path=sch_path, metadata=metadata)
file_path = f"{path}/{project_name}.kicad_sch" base_name = project_name if project_name.endswith(".kicad_sch") else f"{project_name}.kicad_sch"
normalized_path = path or "."
file_path = os.path.join(normalized_path, base_name)
success = SchematicManager.save_schematic(schematic, file_path) success = SchematicManager.save_schematic(schematic, file_path)
return {"success": success, "file_path": file_path} return {"success": success, "file_path": file_path}