Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] bom output fails when global option set_text_variables_before_output: true #649

Closed
soldermate opened this issue Aug 5, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@soldermate
Copy link

Describe the bug
The bom output fails when the set_text_variables_before_output: true is set. The output works fine when the option is removed (left at the default) This traceback is printed when it fails.

'Spreadsheet for the Bill of Materials' (bom_xlsx) [bom]
Traceback (most recent call last):
File "/usr/bin/kibot", line 33, in
sys.exit(load_entry_point('kibot==1.7.0', 'console_scripts', 'kibot')())
File "/usr/lib/python3/dist-packages/kibot/main.py", line 549, in main
generate_outputs(outputs, args.target, args.invert_sel, args.skip_pre, args.cli_order, args.no_priority,
File "/usr/lib/python3/dist-packages/kibot/kiplot.py", line 608, in generate_outputs
_generate_outputs(outputs, targets, invert, skip_pre, cli_order, no_priority, dont_stop)
File "/usr/lib/python3/dist-packages/kibot/kiplot.py", line 598, in _generate_outputs
run_output(out, dont_stop)
File "/usr/lib/python3/dist-packages/kibot/kiplot.py", line 498, in run_output
pre.apply()
File "/usr/lib/python3/dist-packages/kibot/pre_set_text_variables.py", line 157, in apply
new_text = Optionable.expand_filename_both(self, text, make_safe=False)
File "/usr/lib/python3/dist-packages/kibot/optionable.py", line 367, in expand_filename_both
name = Optionable.expand_filename_common(self, name, parent)
File "/usr/lib/python3/dist-packages/kibot/optionable.py", line 329, in expand_filename_common
name = name.replace('%S', _cl(self._find_subpcb()))
File "/usr/lib/python3/dist-packages/kibot/pre_base.py", line 207, in _find_subpcb
if hasattr(self, '_variant') and self._variant and self.variant._sub_pcb:
AttributeError: 'Set_Text_Variables' object has no attribute 'variant'. Did you mean: '_variant'?

To Reproduce
Occurs when the following is present in the configuration file


global:
  set_text_variables_before_output: true

outputs:
- name: 'bom_xlsx'
  comment: "Spreadsheet for the Bill of Materials"
  type: bom
  dir: bom
  options: &bom_options
    xlsx:
      title: 'KiBot variants example'
    columns:
      - Row
      - References
      - Quantity Per PCB

Environment
Issue occurs in bitbucket pipeline and locally using

image: ghcr.io/inti-cmnb/kicad8_auto_full:latest
clone:
  lfs: false

Additional context
Add any other context about the problem here.

@set-soft set-soft added the bug Something isn't working label Aug 5, 2024
@set-soft
Copy link
Member

set-soft commented Aug 5, 2024

Hi @soldermate !
The above patch should solve it. Thanks for reporting!

@set-soft set-soft closed this as completed Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants