Code

Extensions. Small bug in uniconvertor output.
authorJazzyNico <nicoduf@yahoo.fr>
Sun, 28 Mar 2010 06:45:18 +0000 (08:45 +0200)
committerJazzyNico <nicoduf@yahoo.fr>
Sun, 28 Mar 2010 06:45:18 +0000 (08:45 +0200)
share/extensions/uniconv_output.py

index ffd78736b3d4c0fadc23ec464b80a1003d3ee5f5..9cdac7fc28ac77b79f466c1b501fc2fab497afa8 100644 (file)
@@ -92,21 +92,21 @@ def run(command_format, prog_name, uniconv_format):
 def get_command():
     cmd = None
 
-try:
-    from subprocess import Popen, PIPE
-    p = Popen('uniconvertor', shell=True, stdout=PIPE, stderr=PIPE).wait()
-    if p==0 :
-        cmd = 'uniconvertor'
-    else:
-        p = Popen('uniconv', shell=True, stdout=PIPE, stderr=PIPE).wait()
+    try:
+        from subprocess import Popen, PIPE
+        p = Popen('uniconvertor', shell=True, stdout=PIPE, stderr=PIPE).wait()
         if p==0 :
-            cmd = 'uniconv'
-except ImportError:
-    from popen2 import Popen3
-    p = Popen3('uniconv', True).wait()
-    if p!=32512 : cmd = 'uniconv'
-    p = Popen3('uniconvertor', True).wait()
-    if p!=32512 : cmd = 'uniconvertor'
+            cmd = 'uniconvertor'
+        else:
+            p = Popen('uniconv', shell=True, stdout=PIPE, stderr=PIPE).wait()
+            if p==0 :
+                cmd = 'uniconv'
+    except ImportError:
+        from popen2 import Popen3
+        p = Popen3('uniconv', True).wait()
+        if p!=32512 : cmd = 'uniconv'
+        p = Popen3('uniconvertor', True).wait()
+        if p!=32512 : cmd = 'uniconvertor'
 
     if cmd == None:
         # there's no succeffully-returning uniconv command; try to get the module directly (on Windows)
@@ -122,6 +122,7 @@ except ImportError:
                          'and install into your Inkscape\'s Python location\n'))
             sys.exit(1)
         cmd = 'python -c "from uniconvertor import uniconv; uniconv();"'
+
     return cmd
 
 # vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 encoding=utf-8 textwidth=99