Code

discard stderr from nested inkscape invocations
authoracspike <acspike@users.sourceforge.net>
Sun, 1 Apr 2007 21:47:10 +0000 (21:47 +0000)
committeracspike <acspike@users.sourceforge.net>
Sun, 1 Apr 2007 21:47:10 +0000 (21:47 +0000)
share/extensions/g2pngs.py
share/extensions/gimp_xcf.py
share/extensions/summersnight.py

index a24906a04a49e9ea0ecfc524efbf4d6437a027b1..675ea10a464995d6dd76c4e97c4c2b3b05060341 100644 (file)
@@ -72,9 +72,10 @@ class MyEffect(inkex.Effect):
             name = "%s.png" % id
             filename = os.path.join(directory, name)
             command = "inkscape -i \"%s\" -e \"%s\" \"%s\" " % (id, filename, svg_file)
-            f = os.popen(command,'r')
+            _,f,err = os.popen3(command,'r')
             f.read()
             f.close()
+            err.close()
             pngs.append(filename)
 
 e = MyEffect()
index 1da8a260916242e171c7d1a0ef4a5f4af122eb02..998f5d9a16369eb4bc73a6ffb20013594ee5a1a4 100755 (executable)
@@ -41,9 +41,10 @@ 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 = os.popen(command,'r')
+            _,f,err = os.popen3(command,'r')
             f.read()
             f.close()
+            err.close()
             pngs.append(filename)
             names.append(id)
 
index af660d9d9bf12d0817cc224779a238955aabf0a7..803b2b37253149f944da382388155fa728a2e2dc 100755 (executable)
@@ -47,9 +47,10 @@ class Project(inkex.Effect):
             file = self.args[-1]
             id = self.options.ids[0]
             for query in self.q.keys():
-                f = os.popen("inkscape --query-%s --query-id=%s %s" % (query,id,file))
+                _,f,err = os.popen3("inkscape --query-%s --query-id=%s %s" % (query,id,file))
                 self.q[query] = float(f.read())
                 f.close()
+                err.close()
 
             #process path
             d = obj.attributes.getNamedItem('d')