Code

Deprecation warning fix on xcf export
authorJazzyNico <nicoduf@yahoo.fr>
Sun, 29 Nov 2009 12:42:45 +0000 (13:42 +0100)
committerJazzyNico <nicoduf@yahoo.fr>
Sun, 29 Nov 2009 12:42:45 +0000 (13:42 +0100)
share/extensions/gimp_xcf.py

index 22e45006b3b0ff01d3c02f7d9e988747c667375d..92da6cf40ff04c7b18deace6fe7d4f7545a37ec5 100755 (executable)
@@ -19,6 +19,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 import inkex
 import sys, os, tempfile
 
+try:
+    from subprocess import Popen, PIPE
+    bsubprocess = True
+except:
+    bsubprocess = False
+
 class MyEffect(inkex.Effect):
     def __init__(self):
         inkex.Effect.__init__(self)
@@ -95,7 +101,13 @@ class MyEffect(inkex.Effect):
             name = "%s.png" % id
             filename = os.path.join(tmp_dir, name)
             command = "inkscape -i %s -j %s -e %s %s " % (id, area, filename, svg_file)
-            _,f,err = os.popen3(command,'r')
+            if bsubprocess:
+                p = Popen(command, shell=True, stdout=PIPE, stderr=PIPE)
+                return_code = p.wait()
+                f = p.stdout
+                err = p.stderr
+            else:
+                _,f,err = os.popen3(command,'r')
             f.read()
             f.close()
             err.close()