do not request update for legacy fonts (#3456)

pull/3457/head dev-build-kaalleen-auto-run-networkx
Kaalleen 2025-01-22 18:27:25 +01:00 zatwierdzone przez GitHub
rodzic 5283a529b4
commit 903428106f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
2 zmienionych plików z 8 dodań i 7 usunięć

Wyświetl plik

@ -64,7 +64,7 @@ class FontVariant(object):
variant_file_paths = self._get_variant_file_paths()
for svg_path in variant_file_paths:
document = inkex.load_svg(svg_path)
update_inkstitch_document(document)
update_inkstitch_document(document, warn_unversioned=False)
svg = document.getroot()
svg = self._apply_transforms(svg)

Wyświetl plik

@ -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: