From 29891d822f1f9710dd30754b3e3baa7b599e110c Mon Sep 17 00:00:00 2001 From: JazzyNico Date: Sun, 28 Mar 2010 08:45:18 +0200 Subject: [PATCH] Extensions. Small bug in uniconvertor output. --- share/extensions/uniconv_output.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/share/extensions/uniconv_output.py b/share/extensions/uniconv_output.py index ffd78736b..9cdac7fc2 100644 --- a/share/extensions/uniconv_output.py +++ b/share/extensions/uniconv_output.py @@ -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 -- 2.30.2