From 86a9c2594927ef5e855ca12d1dde6ed5b90b55cf Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Wed, 5 Oct 2022 11:30:00 -0300 Subject: [PATCH] [Diff] Added option to skip pages with no diffs --- CHANGELOG.md | 1 + README.md | 6 ++++-- docs/README.in | 2 +- docs/samples/generic_plot.kibot.yaml | 3 +++ kibot/out_diff.py | 7 ++++++- src/kibot-check | 2 +- 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2aeca951..87d6d12d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Mechanism to compare using a variant (See #278) - Mechanism to specify the current PCB/Schematic in memory (See #295) - Mechanism to compare with the last Nth tag (See #312) + - Option to skip pages with no differences - Sch Variant: - Option to copy the project. Needed for text variables. - Option to change the title (similar to PCB Variant) diff --git a/README.md b/README.md index 8fcb5c26..98659b0a 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ - The GitHub actions with KiCad 6 support are tagged as `v2_k6` (stable) and `v2_dk6` (development). Consult: [Github Actions tags](#github-actions-tags) -**Important note about PcbDraw 1.0.0 +**Important note about PcbDraw 1.0.0** - This release is incompatible with 0.9.0, I'm trying to fix some issues in the upstream package. **New on v1.3.0** @@ -150,7 +150,7 @@ Notes: [**KiBoM**](https://github.com/INTI-CMNB/KiBoM) v1.8.0 [![Tool](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/llave-inglesa-22x22.png)](https://github.com/INTI-CMNB/KiBoM) ![Auto-download](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/auto_download-22x22.png) - Mandatory for `kibom` -[**KiCad PCB/SCH Diff**](https://github.com/INTI-CMNB/KiDiff) v2.4.1 [![Tool](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/llave-inglesa-22x22.png)](https://github.com/INTI-CMNB/KiDiff) ![Auto-download](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/auto_download-22x22.png) +[**KiCad PCB/SCH Diff**](https://github.com/INTI-CMNB/KiDiff) v2.4.2 [![Tool](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/llave-inglesa-22x22.png)](https://github.com/INTI-CMNB/KiDiff) ![Auto-download](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/auto_download-22x22.png) - Mandatory for `diff` [**LXML**](https://pypi.org/project/LXML/) [![Python module](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/Python-logo-notext-22x22.png)](https://pypi.org/project/LXML/) [![Debian](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/debian-openlogo-22x22.png)](https://packages.debian.org/bullseye/python3-lxml) ![Auto-download](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/auto_download-22x22.png) @@ -1737,6 +1737,8 @@ Notes: - `old_type`: [string='git'] [git,file,output,multivar] How to interpret the `old` name. Use `git` for a git hash, branch, etc. Use `file` for a file name. Use `output` to specify the name of a `pcb_variant`/`sch_variant` output. Use `multivar` to specify a reference file when `new_type` is also `multivar`. + - `only_different`: [boolean=false] Only include the pages with differences in the output PDF. + Note that when no differeces are found we get a page saying *No diff*. - `pcb`: [boolean=true] Compare the PCB, otherwise compare the schematic. - `threshold`: [number=0] [0,1000000] Error threshold for the `stats` mode, 0 is no error. When specified a difference bigger than the indicated value will make the diff fail. diff --git a/docs/README.in b/docs/README.in index f37ee7a9..e844ee84 100644 --- a/docs/README.in +++ b/docs/README.in @@ -13,7 +13,7 @@ - The GitHub actions with KiCad 6 support are tagged as `v2_k6` (stable) and `v2_dk6` (development). Consult: [Github Actions tags](#github-actions-tags) -**Important note about PcbDraw 1.0.0 +**Important note about PcbDraw 1.0.0** - This release is incompatible with 0.9.0, I'm trying to fix some issues in the upstream package. **New on v1.3.0** diff --git a/docs/samples/generic_plot.kibot.yaml b/docs/samples/generic_plot.kibot.yaml index c754dbce..b8015056 100644 --- a/docs/samples/generic_plot.kibot.yaml +++ b/docs/samples/generic_plot.kibot.yaml @@ -524,6 +524,9 @@ outputs: # Use `file` for a file name. Use `output` to specify the name of a `pcb_variant`/`sch_variant` output. # Use `multivar` to specify a reference file when `new_type` is also `multivar` old_type: 'git' + # [boolean=false] Only include the pages with differences in the output PDF. + # Note that when no differeces are found we get a page saying *No diff* + only_different: false # [string='%f-%i%I%v.%x'] Filename for the output (%i=diff_pcb/diff_sch, %x=pdf). Affected by global options output: '%f-%i%I%v.%x' # [boolean=true] Compare the PCB, otherwise compare the schematic diff --git a/kibot/out_diff.py b/kibot/out_diff.py index 69b68444..7cad7bef 100644 --- a/kibot/out_diff.py +++ b/kibot/out_diff.py @@ -6,7 +6,7 @@ """ Dependencies: - name: KiCad PCB/SCH Diff - version: 2.4.1 + version: 2.4.2 role: mandatory github: INTI-CMNB/KiDiff command: kicad-diff.py @@ -99,6 +99,9 @@ class DiffOptions(BaseOptions): self.use_file_id = False """ When creating the link name of an output file related to a variant use the variant `file_id` instead of its name """ + self.only_different = False + """ Only include the pages with differences in the output PDF. + Note that when no differeces are found we get a page saying *No diff* """ super().__init__() self._expand_id = 'diff' self._expand_ext = 'pdf' @@ -403,6 +406,8 @@ class DiffOptions(BaseOptions): cmd.extend(['--layers', self.incl_file]) if self.threshold: cmd.extend(['--threshold', str(self.threshold)]) + if self.only_different: + cmd.append('--only_different') cmd.extend([self.file_exist, self.file_exist]) if GS.debug_enabled: cmd.insert(1, '-'+'v'*GS.debug_level) diff --git a/src/kibot-check b/src/kibot-check index 8218605d..daa1f280 100755 --- a/src/kibot-check +++ b/src/kibot-check @@ -485,7 +485,7 @@ deps = '{\ "version": [\ 2,\ 4,\ - 1\ + 2\ ]\ }\ ],\