From 25b0557d5a4da6506d50f438e883c65e3a89814e Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Wed, 14 Jun 2023 09:01:27 -0300 Subject: [PATCH] [Compress] Added `skip_not_run` - Used to skip outputs not generated in default runs. --- CHANGELOG.md | 2 ++ README.md | 1 + docs/samples/generic_plot.kibot.yaml | 2 ++ kibot/out_compress.py | 4 ++++ kibot/resources/config_templates/JLCPCB.kibot.yaml | 2 ++ 5 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58bc5354..5b7c6d96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `show_adhesive`: to see the content of the *.Adhesive layers. - Navigate_Results: - `skip_not_run`: used to skip outputs not generated in default runs. +- Compress: + - `skip_not_run`: used to skip outputs not generated in default runs. ### Changed - Command line: diff --git a/README.md b/README.md index af4fc5b9..c62e440a 100644 --- a/README.md +++ b/README.md @@ -2105,6 +2105,7 @@ Notes: - `follow_links`: [boolean=true] Store the file pointed by symlinks, not the symlink. - `move_files`: [boolean=false] Move the files to the archive. In other words: remove the files after adding them to the archive. - *remove_files*: Alias for move_files. + - `skip_not_run`: [boolean=false] Skip outputs with `run_by_default: false`. - `category`: [string|list(string)=''] The category for this output. If not specified an internally defined category is used. Categories looks like file system paths, i.e. **PCB/fabrication/gerber**. The categories are currently used for `navigate_results`. diff --git a/docs/samples/generic_plot.kibot.yaml b/docs/samples/generic_plot.kibot.yaml index 0efd2fe6..65989314 100644 --- a/docs/samples/generic_plot.kibot.yaml +++ b/docs/samples/generic_plot.kibot.yaml @@ -627,6 +627,8 @@ outputs: # [string='%f-%i%I%v.%x'] Name for the generated archive (%i=name of the output %x=according to format). Affected by global options output: '%f-%i%I%v.%x' # `remove_files` is an alias for `move_files` + # [boolean=false] Skip outputs with `run_by_default: false` + skip_not_run: false # Files copier: # Useful when an external tool is used to compress the output directory. # Note that you can use the `compress` output to create archives diff --git a/kibot/out_compress.py b/kibot/out_compress.py index adc1d5d5..326856c2 100644 --- a/kibot/out_compress.py +++ b/kibot/out_compress.py @@ -85,6 +85,8 @@ class CompressOptions(BaseOptions): """ {move_files} """ self.follow_links = True """ Store the file pointed by symlinks, not the symlink """ + self.skip_not_run = False + """ Skip outputs with `run_by_default: false` """ super().__init__() def config(self, parent): @@ -154,6 +156,8 @@ class CompressOptions(BaseOptions): if f.from_output: logger.debugl(2, '- From output `{}`'.format(f.from_output)) files_list, out_dir, out = get_output_targets(f.from_output, self._parent) + if not out.run_by_default and self.skip_not_run: + continue output_out_dir = out_dir logger.debugl(2, '- List of files: {}'.format(files_list)) if out_dir not in dirs_list: diff --git a/kibot/resources/config_templates/JLCPCB.kibot.yaml b/kibot/resources/config_templates/JLCPCB.kibot.yaml index 2f5862b9..d0a57fa4 100644 --- a/kibot/resources/config_templates/JLCPCB.kibot.yaml +++ b/kibot/resources/config_templates/JLCPCB.kibot.yaml @@ -119,6 +119,8 @@ outputs: type: compress dir: @_KIBOT_MANF_DIR_COMP@ options: + # Position and BoM can be disabled + skip_not_run: true files: - from_output: _JLCPCB_gerbers dest: /