diff options
| author | George Steel <george.steel@gmail.com> | 2024-04-27 14:16:18 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-27 14:16:18 -0400 |
| commit | 05ca4132f17a581939fd0b206319f215248e5232 (patch) | |
| tree | bac063a76fe7d6f4549cd0f50158735b9fc99dd1 /lib/elements | |
| parent | f715f2dfb0074d941c23719812e5bf08f5255412 (diff) | |
Add option to disable the stitch plan cache (#2655)
Setting the cache size to 0 bypasses the cache completely.
This is necessary during development to ensure newly-changed code actually gets run.
Also fixes the error pane in the params gui.
* make params warning pane large enough to see contents
* rename sizers in preferences dialog descriptive names
* add shapely version bound
* add option to disable stitch plan cache
* remove out-of-date wxg file
* make a cache size of 0 disable the cache
Diffstat (limited to 'lib/elements')
| -rw-r--r-- | lib/elements/element.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/elements/element.py b/lib/elements/element.py index c9d7c377..ae0ff5c6 100644 --- a/lib/elements/element.py +++ b/lib/elements/element.py @@ -22,7 +22,7 @@ from ..svg import (PIXELS_PER_MM, apply_transforms, convert_length, get_node_transform) from ..svg.tags import INKSCAPE_LABEL, INKSTITCH_ATTRIBS from ..utils import Point, cache -from ..utils.cache import CacheKeyGenerator, get_stitch_plan_cache +from ..utils.cache import get_stitch_plan_cache, is_cache_disabled, CacheKeyGenerator class Param(object): @@ -496,6 +496,9 @@ class EmbroideryElement(object): @debug.time def _load_cached_stitch_groups(self, previous_stitch): + if is_cache_disabled(): + return None + if not self.uses_previous_stitch(): # we don't care about the previous stitch previous_stitch = None @@ -519,6 +522,9 @@ class EmbroideryElement(object): @debug.time def _save_cached_stitch_groups(self, stitch_groups, previous_stitch): + if is_cache_disabled(): + return + stitch_plan_cache = get_stitch_plan_cache() cache_key = self.get_cache_key(previous_stitch) if cache_key not in stitch_plan_cache: |
