File: //usr/share/inkscape/extensions/uniconv_output.pyc
�
��Yc @ sL d Z d d l Z d d l Z d d l Z d d l Z d � Z d � Z d S( sr
uniconv_output.py
Module for running UniConverter exporting commands in Inkscape extensions
Copyright (C) 2009 Nicolas Dufour (jazzynico)
Based on unicon-ext.py and run_command.py by Stephen Silver
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
i����Nc C sl t j | � } | | } d } yyb d d l m } m } | | d t d | d | �} | j � } | j j � }
| j
j � } Wn� t k
ryW d d l m
} | | t � } | j � | j � } | j j � }
| j j � } Wq t k
rd } q Xn X| r1| d k r1d | |
| f } n Wn) t k
r]}
d | t |
� f } n X| d k rt j d
k r�d d l } | j t j j � t j � n y9 t | d � } | j � } t j j | � | j � Wqt k
r}
d t |
� } qXn y t j | � Wn t k
r*n X| d k r[t j
j | d
� t j d � n
t j d � d S( Ni����( t Popent PIPEt shellt stdoutt stderr( t Popen3s7 Neither subprocess.Popen nor popen2.Popen3 is availables %s failed:
%s
%s
s Error attempting to run %s: %st ntt rbs Error reading temporary file: %ss
i i ( t tempfilet mktempt Nonet
subprocessR R t Truet waitR t readR t ImportErrort popen2R t pollt fromchildt childerrt Exceptiont strt ost namet msvcrtt setmodet syst filenot O_BINARYt opent writet closet IOErrort removet exit( t command_formatt prog_namet uniconv_formatt outfilet commandt msgR R t pt rct outt errR t instR t ft data( ( s0 /usr/share/inkscape/extensions/uniconv_output.pyt run&