[KiKit present][Fixed] Crash when no boards specified

Fixes #402
This commit is contained in:
Salvador E. Tropea 2023-03-18 19:04:59 -03:00
parent a9ca2f3f11
commit 2d39890482
3 changed files with 6 additions and 4 deletions

View File

@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Makefile: don't skip all preflights on each run, just the ones we generate
as targets. (#405)
- KiKit present: problems when no board was specified. (#402)
## [1.6.1] - 2023-03-16

View File

@ -118,6 +118,10 @@ class PresentBoards(Optionable):
raise KiPlotConfigurationError('Unknown output `{}` selected in board {}'.
format(self.pcb_from_output, self.name))
def fill_empty_values(self, parent):
# The defaults are good enough, but we need to attach to a parent
self._parent = parent
def solve_file(self):
return self.name, self.comment, self.pcb_file, self.front_image, self.back_image, self.gerbers
@ -316,7 +320,7 @@ class KiKit_PresentOptions(BaseOptions):
# List of boards
if isinstance(self.boards, type):
a_board = PresentBoards()
a_board.fill_empty_values()
a_board.fill_empty_values(self)
self.boards = [a_board]
elif isinstance(self.boards, PresentBoards):
self.boards = [self.boards]

View File

@ -8,9 +8,6 @@ outputs:
dir: Present/Auto
options:
description: 'tests/data/silly_project.md'
boards:
mode: local
comment: This is a comment
repository: 'https://github.com/INTI-CMNB/KiBot/'
- name: PcbDraw