diff options
| author | Stephen Silver <sasilver@yahoo.com> | 2008-06-27 20:43:58 +0000 |
|---|---|---|
| committer | sasilver <sasilver@users.sourceforge.net> | 2008-06-27 20:43:58 +0000 |
| commit | 9d2a093e5dabde8499e3a06cec9cf9f44ea5524a (patch) | |
| tree | 6f3fcff10b3ffcc1cd5642524816299177c3df5f | |
| parent | sodipodi:docname is obsolete (diff) | |
| download | inkscape-9d2a093e5dabde8499e3a06cec9cf9f44ea5524a.tar.gz inkscape-9d2a093e5dabde8499e3a06cec9cf9f44ea5524a.zip | |
Use Python script instead of shell script for .fig import (fixes bug 240889).
(bzr r6082)
| -rw-r--r-- | share/extensions/Makefile.am | 2 | ||||
| -rw-r--r-- | share/extensions/fig2dev-ext.py | 30 | ||||
| -rwxr-xr-x | share/extensions/fig2svg.sh | 10 | ||||
| -rw-r--r-- | share/extensions/fig_input.inx | 4 |
4 files changed, 33 insertions, 13 deletions
diff --git a/share/extensions/Makefile.am b/share/extensions/Makefile.am index 92a52847c..24289b5bb 100644 --- a/share/extensions/Makefile.am +++ b/share/extensions/Makefile.am @@ -50,7 +50,7 @@ extensions = \ export_gimp_palette.py \ extractimage.py \ ffgeom.py\ - fig2svg.sh \ + fig2dev-ext.py \ flatten.py \ fractalize.py \ funcplot.py \ diff --git a/share/extensions/fig2dev-ext.py b/share/extensions/fig2dev-ext.py new file mode 100644 index 000000000..0e32a941d --- /dev/null +++ b/share/extensions/fig2dev-ext.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python + +""" +fig2dev-ext.py +Python script for running fig2dev 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 +""" + +import sys +from run_command import run + +run('fig2dev -L svg "%s" "%%s"' % sys.argv[1].replace("%","%%"), "fig2dev") + + +# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 encoding=utf-8 textwidth=99 diff --git a/share/extensions/fig2svg.sh b/share/extensions/fig2svg.sh deleted file mode 100755 index 81c6bc827..000000000 --- a/share/extensions/fig2svg.sh +++ /dev/null @@ -1,10 +0,0 @@ -#! /bin/sh -rc=0 -TMPDIR="${TMPDIR-/tmp}" -TEMPFILENAME=`mktemp 2>/dev/null || echo "$TMPDIR/tmp-fig$$.svg"` - -fig2dev -L svg "$1" "${TEMPFILENAME}" > /dev/null 2>&1 || rc=1 - -cat < "${TEMPFILENAME}" || rc=1 -rm -f "${TEMPFILENAME}" -exit $rc diff --git a/share/extensions/fig_input.inx b/share/extensions/fig_input.inx index 5ef749bc6..8f0410221 100644 --- a/share/extensions/fig_input.inx +++ b/share/extensions/fig_input.inx @@ -3,7 +3,7 @@ <_name>XFIG Input</_name> <id>org.inkscape.input.fig</id> <dependency type="executable" location="path">fig2dev</dependency> - <dependency type="executable" location="extensions">fig2svg.sh</dependency> + <dependency type="executable" location="extensions">fig2dev-ext.py</dependency> <input> <extension>.fig</extension> <mimetype>image/x-xfig</mimetype> @@ -12,6 +12,6 @@ <output_extension>org.inkscape.output.fig</output_extension> </input> <script> - <command reldir="extensions">fig2svg.sh</command> + <command reldir="extensions" interpreter="python">fig2dev-ext.py</command> </script> </inkscape-extension> |
