From da30cc4445e52ad552a73e4972210c56765b4c2b Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Fri, 1 Dec 2023 08:05:43 -0300 Subject: [PATCH] [KiRi][Added] Option to keep generated hashes --- kibot/out_kiri.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kibot/out_kiri.py b/kibot/out_kiri.py index ca4bae99..20565c57 100644 --- a/kibot/out_kiri.py +++ b/kibot/out_kiri.py @@ -66,6 +66,8 @@ class KiRiOptions(VariantOptions): """ *Selects the color theme. Only applies to KiCad 6. To use the KiCad 6 default colors select `_builtin_default`. Usually user colors are stored as `user`, but you can give it another name """ + self.keep_generated = False + """ *Avoid PCB and SCH images regeneration. Useful for incremental usage """ super().__init__() self._expand_id = 'diff' self._expand_ext = 'pdf' @@ -275,6 +277,9 @@ class KiRiOptions(VariantOptions): try: for h in hashes: hash = h[0] + if self.keep_generated and os.path.isdir(os.path.join(self.cache_dir, hash[:7])): + logger.debug(f'- Images for {hash} already generated') + continue git_tmp_wd = mkdtemp() logger.debug('Checking out '+hash+' to '+git_tmp_wd) self.run_git(['worktree', 'add', git_tmp_wd, hash])