Code

Extensions. Use uniconvertor first, instead of uniconv.
authorJazzyNico <nicoduf@yahoo.fr>
Sun, 28 Mar 2010 06:35:33 +0000 (08:35 +0200)
committerJazzyNico <nicoduf@yahoo.fr>
Sun, 28 Mar 2010 06:35:33 +0000 (08:35 +0200)
share/extensions/uniconv-ext.py
share/extensions/uniconv_output.py

index 6869196a54da2b5af7ec7fc2523690964b296fc4..3b248d8b82bcbfa96433b95edca44677baef50e0 100644 (file)
@@ -28,13 +28,13 @@ cmd = None
 
 try:
     from subprocess import Popen, PIPE
-    p = Popen('uniconv', shell=True, stdout=PIPE, stderr=PIPE).wait()
+    p = Popen('uniconvertor', shell=True, stdout=PIPE, stderr=PIPE).wait()
     if p==0 :
-        cmd = 'uniconv'
+        cmd = 'uniconvertor'
     else:
-        p = Popen('uniconvertor', shell=True, stdout=PIPE, stderr=PIPE).wait()
+        p = Popen('uniconv', shell=True, stdout=PIPE, stderr=PIPE).wait()
         if p==0 :
-            cmd = 'uniconvertor'
+            cmd = 'uniconv'
 except ImportError:
     from popen2 import Popen3
     p = Popen3('uniconv', True).wait()
index ee32edae34cd5788ef9cd319d868dd208cff5b3e..ffd78736b3d4c0fadc23ec464b80a1003d3ee5f5 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
+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()
         if p==0 :
             cmd = 'uniconv'
-        else:
-            p = Popen('uniconvertor', shell=True, stdout=PIPE, stderr=PIPE).wait()
-            if p==0 :
-                cmd = 'uniconvertor'
-    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'
+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)