# Copyright 2008, 2009 Hannes Hochreiner
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 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, see http://www.gnu.org/licenses/.
# These lines are only needed if you don't put the script directly into
# the installation directory
import sys
# Unix
# OS X
# Windows
import subprocess
import tempfile
import os
import zipfile
import glob
import re
dictio = {}
return dictio
str = ""
return str[1:]
props = {}
inkscapeCommand = None
zipFile = None
self.OptionParser.add_option('--type', action = 'store', type = 'string', dest = 'type', default = '')
self.OptionParser.add_option('--resolution', action = 'store', type = 'string', dest = 'resolution', default = '')
# Register jessyink namespace.
# Set inkscape command.
if (self.inkscapeCommand == None):
pass
# Remove any temporary files that might be left from last time.
# Check whether the JessyInk-script is present (indicating that the presentation has not been properly exported).
inkex.errormsg(_("The JessyInk script is not installed in this SVG file or has a different version than the JessyInk extensions. Please select \"install/update...\" from the \"JessyInk\" sub-menu of the \"Extensions\" menu to install or update the JessyInk script.\n\n"))
# Find layers.
for node in exportNodes:
for node in exportNodes:
# Write temporary zip file to stdout.
# Switch stdout to binary on Windows.
# Output the file.
# Delete temporary files.
# Function to export the current state of the file using Inkscape.
# Write the svg file.
# Prepare output file.
proc = subprocess.Popen([self.inkscapeCommand + " --file=" + svgFile + " --without-gui --export-dpi=" + str(self.options.resolution) + " --export-" + ext + "=" + outFile], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# Function to remove any temporary files created during the export.
try:
except:
pass
# Function to try and find the correct command to invoke Inkscape.
commands = []
proc = subprocess.Popen([command + " --without-gui --version"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
return command
return None
e = MyEffect()
e.affect()