Code

etree CDATA support compatibilization in inkwebeffect.py
authoraurium <aurium@users.sourceforge.net>
Mon, 30 Mar 2009 17:46:33 +0000 (17:46 +0000)
committeraurium <aurium@users.sourceforge.net>
Mon, 30 Mar 2009 17:46:33 +0000 (17:46 +0000)
share/extensions/Makefile.am
share/extensions/inkwebeffect.py

index 70b06c213bbf4f615e35bbbfcae7fb6f7f48a34f..7fac49c5c78e192918e560052271577088b3cb5e 100644 (file)
@@ -67,6 +67,8 @@ extensions = \
        ill2svg.pl \
        inkex.py \
        Inkscape.pm \
+       inkwebeffect.py \
+       inkweb.js \
        interp.py \
        interp-att-g.py \
        launch_webbrowser.py \
@@ -191,7 +193,7 @@ modules = \
        inkscape_help_svgspec.inx \
        inkscape_help_keys.inx \
        interp.inx \
-       interp-att-g.py \
+       interp-att-g.inx \
        lindenmayer.inx \
        lorem_ipsum.inx \
        markers_strokepaint.inx \
@@ -231,8 +233,8 @@ modules = \
        text_braille.inx \
        triangle.inx \
        txt2svg.inx \
-       web-set-att.py \
-       web-transmit-att.py \
+       web-set-att.inx \
+       web-transmit-att.inx \
        whirl.inx \
        wmf_input.inx \
        xaml2svg.inx
index 5fbb8db8be5e3b11d445ffb0dee1567864c05ea8..994f74dea7b25064e79568b3e16c4e5e81c6dd83 100644 (file)
@@ -25,7 +25,6 @@ class InkWebEffect(inkex.Effect):
     self.reUpdateJS = '/\\*\\s* inkweb.js [^*]* InkWebEffect:AutoUpdate \\s*\\*/'
 
   def mustAddInkWebJSCode(self, scriptEl):
-    #inkex.errormsg( re.search(self.reUpdateJS, scriptEl.text) )
     if not scriptEl.text: return True
     if len(scriptEl.text) == 0: return True
     if re.search(self.reUpdateJS, scriptEl.text): return True
@@ -33,10 +32,14 @@ class InkWebEffect(inkex.Effect):
 
   def addInkWebJSCode(self, scriptEl):
     js = open( os.path.join(sys.path[0], "inkweb.js"), 'r' )
-    scriptEl.text = \
-      inkex.etree.CDATA(
-        "\n/* inkweb.js - InkWebEffect:AutoUpdate */\n" + js.read()
-      )
+    if hasattr(inkex.etree, "CDATA"):
+      scriptEl.text = \
+        inkex.etree.CDATA(
+          "\n/* inkweb.js - InkWebEffect:AutoUpdate */\n" + js.read()
+        )
+    else:
+      scriptEl.text = \
+          "\n/* inkweb.js - InkWebEffect:AutoUpdate */\n" + js.read()
     js.close()
 
   def ensureInkWebSupport(self):