Commit e50a76ec authored by Martin Owens's avatar Martin Owens

Remove uniconverter extensions for incompatibility with any OS

parent f16e436c
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>AI 8.0 Input</_name>
<id>org.inkscape.input.ai8</id>
<dependency type="executable" location="extensions">uniconv-ext.py</dependency>
<input>
<extension>.ai</extension>
<mimetype>image/x-adobe-illustrator</mimetype>
<_filetypename>Adobe Illustrator 8.0 and below (UC) (*.ai)</_filetypename>
<_filetypetooltip>Open files saved with Adobe Illustrator 8.0 or
older</_filetypetooltip>
</input>
<script>
<command reldir="extensions" interpreter="python">uniconv-ext.py</command>
</script>
</inkscape-extension>
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>Corel DRAW Compressed Exchange files input (UC)</_name>
<id>org.inkscape.input.ccx.uniconvertor</id>
<dependency type="executable" location="extensions">uniconv-ext.py</dependency>
<input>
<extension>.ccx</extension>
<mimetype>application/x-xccx</mimetype>
<_filetypename>Corel DRAW Compressed Exchange files (UC) (*.ccx)</_filetypename>
<_filetypetooltip>Open compressed exchange files saved in Corel DRAW (UC)</_filetypetooltip>
</input>
<script>
<command reldir="extensions" interpreter="python">uniconv-ext.py</command>
</script>
</inkscape-extension>
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>Corel DRAW Input (UC)</_name>
<id>org.inkscape.input.cdr.uniconvertor</id>
<!-- the uniconv or uniconvertor dependency will be tested by uniconv-ext.py -->
<dependency type="executable" location="extensions">uniconv-ext.py</dependency>
<input>
<extension>.cdr</extension>
<mimetype>image/x-xcdr</mimetype>
<_filetypename>Corel DRAW 7-X4 files (UC) (*.cdr)</_filetypename>
<_filetypetooltip>Open files saved in Corel DRAW 7-X4 (UC)</_filetypetooltip>
<output_extension>org.inkscape.output.cdr</output_extension>
</input>
<script>
<command reldir="extensions" interpreter="python">uniconv-ext.py</command>
</script>
</inkscape-extension>
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>Corel DRAW templates input (UC)</_name>
<id>org.inkscape.input.cdt.uniconvertor</id>
<dependency type="executable" location="extensions">uniconv-ext.py</dependency>
<input>
<extension>.cdt</extension>
<mimetype>application/x-xcdt</mimetype>
<_filetypename>Corel DRAW 7-13 template files (UC) (*.cdt)</_filetypename>
<_filetypetooltip>Open files saved in Corel DRAW 7-13 (UC)</_filetypetooltip>
</input>
<script>
<command reldir="extensions" interpreter="python">uniconv-ext.py</command>
</script>
</inkscape-extension>
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>Computer Graphics Metafile files input</_name>
<id>org.inkscape.input.cgm</id>
<dependency type="executable" location="extensions">uniconv-ext.py</dependency>
<input>
<extension>.cgm</extension>
<mimetype>application/x-xcgm</mimetype>
<_filetypename>Computer Graphics Metafile files (UC) (*.cgm)</_filetypename>
<_filetypetooltip>Open Computer Graphics Metafile files</_filetypetooltip>
</input>
<script>
<command reldir="extensions" interpreter="python">uniconv-ext.py</command>
</script>
</inkscape-extension>
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>Corel DRAW Presentation Exchange files input (UC)</_name>
<id>org.inkscape.input.cmx.uniconvertor</id>
<dependency type="executable" location="extensions">uniconv-ext.py</dependency>
<input>
<extension>.cmx</extension>
<mimetype>application/x-xcmx</mimetype>
<_filetypename>Corel DRAW Presentation Exchange files (UC) (*.cmx)</_filetypename>
<_filetypetooltip>Open presentation exchange files saved in Corel DRAW (UC)</_filetypetooltip>
</input>
<script>
<command reldir="extensions" interpreter="python">uniconv-ext.py</command>
</script>
</inkscape-extension>
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>AutoCAD Plot Input</_name>
<id>org.inkscape.input.plt</id>
<dependency type="executable" location="extensions">uniconv-ext.py</dependency>
<input>
<extension>.plt</extension>
<mimetype>image/x-plt</mimetype>
<_filetypename>HP Graphics Language Plot file [AutoCAD] (UC) (*.plt)</_filetypename>
<_filetypetooltip>Open HPGL plotter files</_filetypetooltip>
<output_extension>org.inkscape.output.plt</output_extension>
</input>
<script>
<command reldir="extensions" interpreter="python">uniconv-ext.py</command>
</script>
</inkscape-extension>
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>AutoCAD Plot Output</_name>
<id>org.inkscape.output.plt</id>
<dependency type="executable" location="extensions">plt_output.py</dependency>
<output>
<extension>.plt</extension>
<mimetype>image/x-plt</mimetype>
<_filetypename>HP Graphics Language Plot file [AutoCAD] (UC) (*.plt)</_filetypename>
<_filetypetooltip>Save a file for plotters</_filetypetooltip>
</output>
<script>
<command reldir="extensions" interpreter="python">plt_output.py</command>
</script>
</inkscape-extension>
#!/usr/bin/env python
"""
plt_output.py
Module for running UniConverter sk1 exporting commands in Inkscape extensions
Copyright (C) 2009 Nicolas Dufour (jazzynico)
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
"""
import sys
from uniconv_output import run, get_command
cmd = get_command()
run((cmd + ' "%s" ') % sys.argv[1], "UniConvertor", ".plt")
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>sK1 vector graphics files input</_name>
<id>org.inkscape.input.sk1</id>
<dependency type="executable" location="extensions">uniconv-ext.py</dependency>
<input>
<extension>.sk1</extension>
<mimetype>application/x-xsk1</mimetype>
<_filetypename>sK1 vector graphics files (UC) (*.sk1)</_filetypename>
<_filetypetooltip>Open files saved in sK1 vector graphics editor</_filetypetooltip>
</input>
<script>
<command reldir="extensions" interpreter="python">uniconv-ext.py</command>
</script>
</inkscape-extension>
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>sK1 vector graphics files output</_name>
<id>org.inkscape.output.sk1</id>
<dependency type="executable" location="extensions">sk1_output.py</dependency>
<output>
<extension>.sk1</extension>
<mimetype>application/x-xsk1</mimetype>
<_filetypename>sK1 vector graphics files (UC) (*.sk1)</_filetypename>
<_filetypetooltip>File format for use in sK1 vector graphics editor</_filetypetooltip>
</output>
<script>
<command reldir="extensions" interpreter="python">sk1_output.py</command>
</script>
</inkscape-extension>
#!/usr/bin/env python
"""
sk1_output.py
Module for running UniConverter sk1 exporting commands in Inkscape extensions
Copyright (C) 2009 Nicolas Dufour (jazzynico)
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
"""
import sys
from uniconv_output import run, get_command
cmd = get_command()
run((cmd + ' "%s" ') % sys.argv[1], "UniConvertor", ".sk1")
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99
\ No newline at end of file
#!/usr/bin/env python
"""
uniconv-ext.py
Python script for running UniConvertor in Inkscape extensions
Copyright (C) 2008 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
"""
# standard library
import sys
# local library
from run_command import run
import inkex
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()
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)
try:
# cannot simply import uniconvertor, it aborts if you import it without parameters
import imp
imp.find_module("uniconvertor")
except ImportError:
inkex.localize()
inkex.errormsg(_('You need to install the UniConvertor software.\n'+\
'For GNU/Linux: install the package python-uniconvertor.\n'+\
'For Windows: download it from\n'+\
'https://sk1project.net/modules.php?name=Products&product=uniconvertor&op=download\n'+\
'and install into your Inkscape\'s Python location\n'))
sys.exit(1)
cmd = 'python -c "import uniconvertor; uniconvertor.uniconv_run()"'
run((cmd+' "%s" "%%s"') % sys.argv[1].replace("%","%%"), "UniConvertor")
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99
#!/usr/bin/env python
"""
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
"""
# Run a command that generates an UniConvertor export file from a SVG file.
# On success, outputs the contents of the UniConverter conversion to stdout,
# and exits with a return code of 0.
# On failure, outputs an error message to stderr, and exits with a return
# code of 1.
# standard library
import os
import sys
import tempfile
# local library
import inkex
def run(command_format, prog_name, uniconv_format):
outfile = tempfile.mktemp(uniconv_format)
command = command_format + outfile
msg = None
# In order to get a return code from the process, we use subprocess.Popen
# if it's available (Python 2.4 onwards) and otherwise use popen2.Popen3
# (Unix only). As the Inkscape package for Windows includes Python 2.5,
# this should cover all supported platforms.
try:
try:
from subprocess import Popen, PIPE
p = Popen(command, shell=True, stdout=PIPE, stderr=PIPE)
rc = p.wait()
out = p.stdout.read()
err = p.stderr.read()
except ImportError:
try:
from popen2 import Popen3
p = Popen3(command, True)
p.wait()
rc = p.poll()
out = p.fromchild.read()
err = p.childerr.read()
except ImportError:
# shouldn't happen...
msg = "Neither subprocess.Popen nor popen2.Popen3 is available"
if rc and msg is None:
msg = "%s failed:\n%s\n%s\n" % (prog_name, out, err)
except Exception, inst:
msg = "Error attempting to run %s: %s" % (prog_name, str(inst))
# If successful, copy the output file to stdout.
if msg is None:
if os.name == 'nt': # make stdout work in binary on Windows
import msvcrt
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
try:
f = open(outfile, "rb")
data = f.read()
sys.stdout.write(data)
f.close()
except IOError, inst:
msg = "Error reading temporary file: %s" % str(inst)
# Clean up.
try:
os.remove(outfile)
except Exception:
pass
# Output error message (if any) and exit.
if msg is not None:
sys.stderr.write(msg + "\n")
sys.exit(1)
else:
sys.exit(0)
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()
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)
try:
# cannot simply import uniconvertor, it aborts if you import it without parameters
import imp
imp.find_module("uniconvertor")
except ImportError:
inkex.localize()
inkex.errormsg(_('You need to install the UniConvertor software.\n'+\
'For GNU/Linux: install the package python-uniconvertor.\n'+\
'For Windows: download it from\n'+\
'https://sk1project.net/modules.php?name=Products&product=uniconvertor&op=download\n'+\
'and install into your Inkscape\'s Python location\n'))
sys.exit(1)
cmd = 'python -c "import uniconvertor; uniconvertor.uniconv_run();"'
return cmd
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>Windows Metafile Input</_name>
<id>org.inkscape.input.wmf</id>
<dependency type="executable" location="extensions">uniconv-ext.py</dependency>
<input>
<extension>.wmf</extension>
<mimetype>application/x-wmf</mimetype>
<_filetypename>Windows Metafile (UC) (*.wmf)</_filetypename>
<_filetypetooltip>A popular graphics file format for clipart</_filetypetooltip>
</input>
<script>
<command reldir="extensions" interpreter="python">uniconv-ext.py</command>
</script>
</inkscape-extension>
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>Windows Metafile Input</_name>
<id>org.inkscape.output.wmf</id>
<dependency type="executable" location="extensions">wmf_output.py</dependency>
<output>
<extension>.wmf</extension>
<mimetype>application/x-wmf</mimetype>
<_filetypename>Windows Metafile (UC) (*.wmf)</_filetypename>
<_filetypetooltip>A popular graphics file format for clipart</_filetypetooltip>
</output>
<script>
<command reldir="extensions" interpreter="python">wmf_output.py</command>
</script>
</inkscape-extension>
#!/usr/bin/env python
"""
wmf_output.py
Module for running UniConverter wmf exporting commands in Inkscape extensions
Copyright (C) 2009 Nicolas Dufour (jazzynico)
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
"""
import sys
from uniconv_output import run, get_command
cmd = get_command()
run((cmd + ' "%s" ') % sys.argv[1], "UniConvertor", ".wmf")
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment