Skip to content

Commit 536f2ef

Browse files
committed
[Added][Worksheet] Support for relative paths
Making them relative to the project file. When missing we use the PCB/SCH path Closes #879
1 parent 633ea60 commit 536f2ef

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3131
- Export_3D: `center` option to `origin` (#871)
3232
- Compress/Copy Files: Now `dest` also expands %X patterns (can be disabled)
3333
(#873)
34+
- Worksheet: Support for paths relative to the project (#879)
3435

3536
### Fixed
3637
- User.N layer numbering. I.e. pcb_print issues with their numbering (#808)

docs/source/Changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Added
5555
- Export_3D: ``center`` option to ``origin`` (#871)
5656
- Compress/Copy Files: Now ``dest`` also expands %X patterns (can be
5757
disabled) (#873)
58+
- Worksheet: Support for paths relative to the project (#879)
5859

5960
Fixed
6061
~~~~~

kibot/kicad/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ def fix_page_layout_k6_key(key, data, dest_dir, forced, no_copy_embedded, is_pcb
665665
logger.debug("** Not patching the SCH worksheet because we don't have a SCH")
666666
return pl
667667
else:
668-
fname = fix_windows(KiConf.expand_env(pl))
668+
fname = fix_windows(KiConf.expand_env(pl, ref_dir=GS.pro_dir or (GS.pcb_dir if is_pcb else GS.sch_dir)))
669669
if os.path.isfile(fname):
670670
dest = os.path.join(dest_dir, key+'.kicad_wks')
671671
logger.debug(f'Copying {fname} -> {dest}')

0 commit comments

Comments
 (0)