diff options
| -rw-r--r-- | lib/lettering/font_variant.py | 2 | ||||
| -rw-r--r-- | lib/update.py | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/lib/lettering/font_variant.py b/lib/lettering/font_variant.py index ad97c3cd..9d3793a6 100644 --- a/lib/lettering/font_variant.py +++ b/lib/lettering/font_variant.py @@ -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) 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: |
