@@ -392,11 +392,20 @@ def __init__(self):
392392 """ [string|list(string)] Name/s of the field/s used for the current raiting.
393393 You can use `_field_current` as field name to use it in most places """
394394 self .invalidate_pcb_text_cache = 'auto'
395- """ [auto,yes,no] Remove any cached text variable in the PCB. This is needed in order to force a text
396- variables update when using `set_text_variables`. You might want to disable it when applying some
397- changes to the PCB and create a new copy to send to somebody without changing the cached values.
398- Note that it will save the PCB with the cache erased.
399- The `auto` value will remove the cached values only when using `set_text_variables` """
395+ """ [auto,yes,no] Clear the text variables cache in the PCB file. This is needed in order to force KiCad to read
396+ updated text variables from the project file when they are changed with `set_text_variables`. You might want to
397+ disable it when applying some changes to the PCB and create a new copy to send to somebody without changing the
398+ cached values.
399+ The `auto` value will remove the cached values only when using `set_text_variables`.
400+ Note that at least one of the `invalidate_pcb_text_cache` and `update_pcb_text_cache` config values must be set
401+ to 'no', otherwise an error is produced."""
402+ self .update_pcb_text_cache = 'no'
403+ """ [auto,yes,no] Update the text variables cache in the PCB file. This makes the PCB file self-contained (usable
404+ without the project file next to it) by copying all text variables from the project file (possibly modified by
405+ the `set_text_variables` preflight) into the PCB file (the cache is completely replaced).
406+ The `auto` value will update the cache only when using `set_text_variables`.
407+ Note that at least one of the `invalidate_pcb_text_cache` and `update_pcb_text_cache` config values must be set
408+ to 'no', otherwise an error is produced."""
400409 self .git_diff_strategy = 'worktree'
401410 """ [worktree,stash] When computing a PCB/SCH diff it configures how do we preserve the current
402411 working state. The *worktree* mechanism creates a separated worktree, that then is just removed.
@@ -581,6 +590,9 @@ def config(self, parent):
581590 KiConf .aliases_3D [alias .name ] = alias .value
582591 logger .debugl (1 , '- {}={}' .format (alias .name , alias .value ))
583592 logger .debugl (1 , 'Finished adding aliases' )
593+ if GS .global_invalidate_pcb_text_cache != 'no' and GS .global_update_pcb_text_cache != 'no' :
594+ raise KiPlotConfigurationError ("At least one of `invalidate_pcb_text_cache` and `update_pcb_text_cache`"
595+ " option must be `no`" )
584596
585597
586598logger = get_logger (__name__ )
0 commit comments