Operations that copies the project now also copies the PRL

This commit is contained in:
Salvador E. Tropea 2023-12-05 08:40:14 -03:00
parent a8c865b921
commit 110053dca1
4 changed files with 16 additions and 4 deletions

View File

@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.6.4] - UNRELEASED
### Added
- General:
- Operations that copies the project now also copies the PRL
- Command line:
- `--help-list-offsets` to list footprint offsets (JLCPCB)
- `--help-list-rotations` to list footprint rotations (JLCPCB)

View File

@ -483,9 +483,17 @@ class GS(object):
return None
pro_copy = new_pcb_name.replace('.kicad_pcb', GS.pro_ext)
if not dry:
logger.debug('Copying project `{}` to `{}`'.format(pro_name, pro_copy))
logger.debug(f'Copying project `{pro_name}` to `{pro_copy}`')
copy2(pro_name, pro_copy)
return pro_copy
# Also copy the PRL
prl_name = pro_name[:-3]+'prl'
prl_copy = None
if os.path.isfile(prl_name):
prl_copy = pro_copy[:-3]+'prl'
if not dry:
logger.debug(f'Copying project local settings `{prl_name}` to `{prl_copy}`')
copy2(prl_name, prl_copy)
return pro_copy, prl_copy
@staticmethod
def copy_project_sch(sch_dir):

View File

@ -930,7 +930,7 @@ class VariantOptions(BaseOptions):
fname = os.path.join(pcb_dir, basename+'.kicad_pcb')
logger.debug('Storing modified PCB to `{}`'.format(fname))
GS.board.Save(fname)
pro_name = GS.copy_project(fname)
pro_name, _ = GS.copy_project(fname)
KiConf.fix_page_layout(pro_name)
return fname, pcb_dir

View File

@ -232,11 +232,13 @@ class Copy_FilesOptions(Base3DOptions):
self.add_sch_files(extra_files, dest_dir)
elif mode_project:
self.add_sch_files(extra_files, dest_dir)
prj_name = GS.copy_project(fname, dry)
prj_name, prl_name = GS.copy_project(fname, dry)
# Extra files that we are generating
extra_files.append(fname)
if prj_name:
extra_files.append(prj_name)
if prl_name:
extra_files.append(prl_name)
if mode_project:
extra_files += self.copy_footprints(f.dest, dry)
extra_files += self.copy_symbols(f.dest, dry)