From 144a83d73dd229e6a4c5bef5876e5e5e1084acac Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Tue, 30 Jan 2024 10:08:07 -0300 Subject: [PATCH] [KiCanvas] Implemented the Quick Start hook --- kibot/out_kicanvas.py | 11 ++++++++--- tests/test_plot/test_misc.py | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/kibot/out_kicanvas.py b/kibot/out_kicanvas.py index 7d04666e..a250e879 100644 --- a/kibot/out_kicanvas.py +++ b/kibot/out_kicanvas.py @@ -95,7 +95,7 @@ class KiCanvasOptions(VariantOptions): self.restore_title(sch=True) def run(self, out_dir): - # We declare _none_related=True because we don't know if the PCB/SCH are needed until the output is configured. + # We declare _any_related=True because we don't know if the PCB/SCH are needed until the output is configured. # Now that we know it we can load the PCB and/or SCH. for s in self.source: if s == 'pcb': @@ -194,8 +194,13 @@ class KiCanvas(BaseOutput): # noqa: F821 @staticmethod def get_conf_examples(name, layers): - # TODO: implement - outs = [] + outs = BaseOutput.simple_conf_examples(name, 'Web page to browse the schematic and/or PCB', 'Browse') # noqa: F821 + sources = [] + if GS.sch_file: + sources.append('schematic') + if GS.pcb_file: + sources.append('pcb') + outs[0]['options'] = {'source': sources} return outs def get_navigate_targets(self, out_dir): diff --git a/tests/test_plot/test_misc.py b/tests/test_plot/test_misc.py index 2a73d0bf..42022bf6 100644 --- a/tests/test_plot/test_misc.py +++ b/tests/test_plot/test_misc.py @@ -1389,7 +1389,7 @@ def test_quick_start_1(test_dir): ctx.run(extra=['-c', dest_conf_f, '-b', dest_file, '-l'], no_out_dir=True, no_yaml_file=True, no_board_file=True) OUTS = ('boardview', 'dxf', 'excellon', 'gencad', 'gerb_drill', 'gerber', 'compress', 'hpgl', 'ibom', 'navigate_results', 'netlist', 'pcb_print', 'pcbdraw', 'pdf', 'position', 'ps', 'render_3d', - 'report', 'step', 'svg', 'kiri', # 'kicanvas', + 'report', 'step', 'svg', 'kiri', 'kicanvas', 'bom', 'download_datasheets', 'pdf_sch_print', 'svg_sch_print') for o in OUTS: ctx.search_out(r'\['+o+r'\]')