summaryrefslogtreecommitdiff
path: root/lib/update.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2025-01-22 18:27:25 +0100
committerGitHub <noreply@github.com>2025-01-22 18:27:25 +0100
commit903428106f7e22ace036068b68881d671218b1f4 (patch)
tree04417892e724a2d778c22cb86cff464e469d83d4 /lib/update.py
parent5283a529b4b78bfec69a8c2d27d6d4b9a1822150 (diff)
do not request update for legacy fonts (#3456)
Diffstat (limited to 'lib/update.py')
-rw-r--r--lib/update.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/update.py b/lib/update.py
index a0bdb084..33ae6cc7 100644
--- a/lib/update.py
+++ b/lib/update.py
@@ -16,7 +16,7 @@ from .svg.tags import EMBROIDERABLE_TAGS, INKSTITCH_ATTRIBS
INKSTITCH_SVG_VERSION = 3
-def update_inkstitch_document(svg, selection=None):
+def update_inkstitch_document(svg, selection=None, warn_unversioned=True):
document = svg.getroot()
# get the inkstitch svg version from the document
search_string = "//*[local-name()='inkstitch_svg_version']//text()"
@@ -54,17 +54,18 @@ def update_inkstitch_document(svg, selection=None):
update_legacy_params(EmbroideryElement(element), file_version, INKSTITCH_SVG_VERSION)
else:
# this is the automatic update when a legacy inkstitch svg version was recognized
- automatic_version_update(document, file_version, INKSTITCH_SVG_VERSION)
+ automatic_version_update(document, file_version, INKSTITCH_SVG_VERSION, warn_unversioned)
_update_inkstitch_svg_version(svg)
-def automatic_version_update(document, file_version, INKSTITCH_SVG_VERSION):
+def automatic_version_update(document, file_version, INKSTITCH_SVG_VERSION, warn_unversioned):
# make sure the user really wants to update
if file_version == 0:
- do_update = RequestUpdate()
- if do_update.cancelled is True:
- return
+ if warn_unversioned:
+ do_update = RequestUpdate()
+ if do_update.cancelled is True:
+ return
# well then, let's update legeacy params
for element in document.iterdescendants():
if element.tag in EMBROIDERABLE_TAGS: