From f8cbca6a5c9b21191e2020111e7e55f377dabaf2 Mon Sep 17 00:00:00 2001 From: Mario Voigt Date: Mon, 11 Oct 2021 00:39:20 +0200 Subject: [PATCH] fixed iframe/object issue with modern browsers. svg is now embedded --- .../animate_order/animate_order.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/extensions/fablabchemnitz/animate_order/animate_order.py b/extensions/fablabchemnitz/animate_order/animate_order.py index 08b191f0..84bd5d90 100644 --- a/extensions/fablabchemnitz/animate_order/animate_order.py +++ b/extensions/fablabchemnitz/animate_order/animate_order.py @@ -5,6 +5,7 @@ import subprocess import shutil import os import sys +from lxml import etree import warnings """ @@ -60,6 +61,7 @@ class AnimateOrder(inkex.EffectExtension): target_html = os.path.join(extension_dir, "animate_order.html") docTitle = self.document.getroot().get("{http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd}docname") + animateId = self.document.getroot().get('id') if docTitle is None: title = "Animate Order - Vivus JS" else: @@ -71,6 +73,16 @@ class AnimateOrder(inkex.EffectExtension): type = self.options.sequence_type reverse = str(self.options.reverse).lower() + currentDoc = self.document_path() + if currentDoc == "": + self.msg("Your document is not saved as a permanent file yet. Please save first.") + exit(1) + + svgfile = open(self.document_path(), 'r') + #inkex.utils.debug(svgfile.read()) + svgContent = svgfile.read() + svgfile.close() + with open(target_html, "w") as text_file: print( '' , file=text_file) print( ' ' , file=text_file) @@ -83,11 +95,12 @@ class AnimateOrder(inkex.EffectExtension): print( ' ' , file=text_file) print( ' ' , file=text_file) print( '
' , file=text_file) - print(f' ' , file=text_file) + #print(f' ' , file=text_file) + print(svgContent , file=text_file) print(f' ' , file=text_file) print( ' ' , file=text_file) print( ' ' , file=text_file) print( '' , file=text_file)