Commit 95fb6f9c authored by Hannes Hochreiner's avatar Hannes Hochreiner

Updated the JessyInk extensions to version 1.5.4.

(bzr r9864)
parent 43910107
......@@ -25,6 +25,8 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
import gettext
_ = gettext.gettext
class JessyInk_AutoTexts(inkex.Effect):
def __init__(self):
......@@ -38,19 +40,19 @@ class JessyInk_AutoTexts(inkex.Effect):
def effect(self):
# Check version.
scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.1']", namespaces=inkex.NSS)
scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.4']", namespaces=inkex.NSS)
if len(scriptNodes) != 1:
sys.stderr.write("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 \"Effects\" menu to install or update the JessyInk script.\n\n")
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"))
if len(self.selected) == 0:
sys.stderr.write("To assign an effect, please select an object.\n")
inkex.errormsg(_("To assign an effect, please select an object.\n\n"))
for id, node in self.selected.items():
nodes = node.xpath("./svg:tspan", namespaces=inkex.NSS)
if len(nodes) != 1:
sys.stderr.write("Node with id '" + str(id) + "' is not a suitable text node and was therefore ignored.\n")
inkex.errormsg(_("Node with id '{0}' is not a suitable text node and was therefore ignored.\n\n").format(str(id)))
else:
if self.options.autoText == "slideTitle":
nodes[0].set("{" + inkex.NSS["jessyink"] + "}autoText","slideTitle")
......
......@@ -6,7 +6,7 @@
<dependency type="executable" location="extensions">jessyInk_effects.py</dependency>
<param name="tab" type="notebook">
<page name="settings" _gui-text="Settings">
<_param name="effectInLabel" type="groupheader">Build-in effect</_param>
<_param name="effectInLabel" type="description">Build-in effect</_param>
<param name="effectInOrder" type="int" min="1" max="100" _gui-text="Order:">1</param>
<param name="effectInDuration" precision="1" type="float" min="0.1" max="10.0" _gui-text="Duration in seconds:">0.8</param>
<param name="effectIn" type="optiongroup" _gui-text="Type:">
......@@ -15,7 +15,7 @@
<_option value="fade">Fade</_option>
<_option value="pop">Pop</_option>
</param>
<_param name="effectOutLabel" type="groupheader">Build-out effect</_param>
<_param name="effectOutLabel" type="description">Build-out effect</_param>
<param name="effectOutOrder" type="int" min="1" max="100" _gui-text="Order:">1</param>
<param name="effectOutDuration" precision="1" type="float" min="0.1" max="10.0" _gui-text="Duration in seconds:">0.8</param>
<param name="effectOut" type="optiongroup" _gui-text="Type:">
......
......@@ -25,6 +25,8 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
import gettext
_ = gettext.gettext
class JessyInk_Effects(inkex.Effect):
def __init__(self):
......@@ -43,13 +45,13 @@ class JessyInk_Effects(inkex.Effect):
def effect(self):
# Check version.
scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.1']", namespaces=inkex.NSS)
scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.4']", namespaces=inkex.NSS)
if len(scriptNodes) != 1:
sys.stderr.write("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 \"Effects\" menu to install or update the JessyInk script.\n\n")
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"))
if len(self.selected) == 0:
sys.stderr.write("No object selected. Please select the object you want to assign an effect to and then press apply.\n")
inkex.errormsg(_("No object selected. Please select the object you want to assign an effect to and then press apply.\n"))
for id, node in self.selected.items():
if (self.options.effectIn == "appear") or (self.options.effectIn == "fade") or (self.options.effectIn == "pop"):
......
......@@ -30,6 +30,8 @@ import os
import zipfile
import glob
import re
import gettext
_ = gettext.gettext
def propStrToDict(inStr):
dictio = {}
......@@ -77,7 +79,7 @@ class MyEffect(inkex.Effect):
self.inkscapeCommand = self.findInkscapeCommand()
if (self.inkscapeCommand == None):
sys.stderr.write("Could not find Inkscape command.\n")
inkex.errormsg(_("Could not find Inkscape command.\n"))
sys.exit(1)
def output(self):
......@@ -91,7 +93,7 @@ class MyEffect(inkex.Effect):
scriptNodes = self.document.xpath("//svg:script[@jessyink:version]", namespaces=inkex.NSS)
if len(scriptNodes) != 0:
sys.stderr.write("The JessyInk-script is present in this SVG file. This indicates that the presentation has not been properly exported. Please visit code.goolge.com/p/jessyink to find information on how to export a JessyInk presentation.\n\n")
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"))
zipFileDesc, zpFile = tempfile.mkstemp(suffix=".zip", prefix="jessyInk__")
......
......@@ -60,7 +60,7 @@ class JessyInk_Install(inkex.Effect):
scriptElm = inkex.etree.Element(inkex.addNS("script", "svg"))
scriptElm.text = open(os.path.join(os.path.dirname(__file__), "jessyInk.js")).read()
scriptElm.set("id","JessyInk")
scriptElm.set("{" + inkex.NSS["jessyink"] + "}version", "1.5.1")
scriptElm.set("{" + inkex.NSS["jessyink"] + "}version", '1.5.4')
self.document.getroot().append(scriptElm)
# Remove "jessyInkInit()" in the "onload" attribute, if present.
......
......@@ -18,9 +18,10 @@
<param name="slide_addSlide" type="string" _gui-text="Add slide:">n</param>
<param name="slide_toggleProgressBar" type="string" _gui-text="Toggle progress bar:">p</param>
<param name="slide_resetTimer" type="string" _gui-text="Reset timer:">t</param>
<param name="slide_export" type="string" _gui-text="Export presentation:">e</param>
</page>
<page name="settings" _gui-text="Drawing mode">
<param name="drawing_switchToSlideMode" type="string" _gui-text="Switch to slide mode:">d</param>
<param name="drawing_switchToSlideMode" type="string" _gui-text="Switch to slide mode:">ESCAPE, d</param>
<param name="drawing_pathWidthDefault" type="string" _gui-text="Set path width to default:">0</param>
<param name="drawing_pathWidth1" type="string" _gui-text="Set path width to 1:">1</param>
<param name="drawing_pathWidth3" type="string" _gui-text="Set path width to 3:">3</param>
......
......@@ -25,10 +25,12 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
import gettext
_ = gettext.gettext
class JessyInk_CustomKeyBindings(inkex.Effect):
modes = ('slide', 'index', 'drawing')
keyCodes = ('LEFT', 'RIGHT', 'DOWN', 'UP', 'HOME', 'END', 'ENTER', 'SPACE', 'PAGE_UP', 'PAGE_DOWN')
keyCodes = ('LEFT', 'RIGHT', 'DOWN', 'UP', 'HOME', 'END', 'ENTER', 'SPACE', 'PAGE_UP', 'PAGE_DOWN', 'ESCAPE')
slideActions = {}
slideCharCodes = {}
slideKeyCodes = {}
......@@ -57,6 +59,7 @@ class JessyInk_CustomKeyBindings(inkex.Effect):
self.OptionParser.add_option('--slide_addSlide', action = 'callback', type = 'string', callback = self.slideOptions, default = '')
self.OptionParser.add_option('--slide_toggleProgressBar', action = 'callback', type = 'string', callback = self.slideOptions, default = '')
self.OptionParser.add_option('--slide_resetTimer', action = 'callback', type = 'string', callback = self.slideOptions, default = '')
self.OptionParser.add_option('--slide_export', action = 'callback', type = 'string', callback = self.slideOptions, default = '')
self.OptionParser.add_option('--drawing_switchToSlideMode', action = 'callback', type = 'string', callback = self.drawingOptions, default = '')
self.OptionParser.add_option('--drawing_pathWidthDefault', action = 'callback', type = 'string', callback = self.drawingOptions, default = '')
self.OptionParser.add_option('--drawing_pathWidth1', action = 'callback', type = 'string', callback = self.drawingOptions, default = '')
......@@ -105,6 +108,7 @@ class JessyInk_CustomKeyBindings(inkex.Effect):
self.slideActions["addSlide"] = "slideAddSlide(activeSlide);"
self.slideActions["toggleProgressBar"] = "slideToggleProgressBarVisibility();"
self.slideActions["resetTimer"] = "slideResetTimer();"
self.slideActions["export"] = "slideUpdateExportLayer();"
self.drawingActions["switchToSlideMode"] = "drawingSwitchToSlideMode();"
self.drawingActions["pathWidthDefault"] = "drawingResetPathWidth();"
......@@ -178,10 +182,10 @@ class JessyInk_CustomKeyBindings(inkex.Effect):
def effect(self):
# Check version.
scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.1']", namespaces=inkex.NSS)
scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.4']", namespaces=inkex.NSS)
if len(scriptNodes) != 1:
sys.stderr.write("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 \"Effects\" menu to install or update the JessyInk script.\n\n")
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"))
# Remove old master slide property
for node in self.document.xpath("//svg:g[@jessyink:customKeyBindings='customKeyBindings']", namespaces=inkex.NSS):
......
......@@ -25,6 +25,8 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
import gettext
_ = gettext.gettext
class JessyInk_MasterSlide(inkex.Effect):
def __init__(self):
......@@ -38,10 +40,10 @@ class JessyInk_MasterSlide(inkex.Effect):
def effect(self):
# Check version.
scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.1']", namespaces=inkex.NSS)
scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.4']", namespaces=inkex.NSS)
if len(scriptNodes) != 1:
sys.stderr.write("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 \"Effects\" menu to install or update the JessyInk script.\n\n")
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"))
# Remove old master slide property
for node in self.document.xpath("//*[@jessyink:masterSlide='masterSlide']", namespaces=inkex.NSS):
......@@ -51,9 +53,9 @@ class JessyInk_MasterSlide(inkex.Effect):
if self.options.layerName != "":
nodes = self.document.xpath("//*[@inkscape:groupmode='layer' and @inkscape:label='" + self.options.layerName + "']", namespaces=inkex.NSS)
if len(nodes) == 0:
sys.stderr.write("Layer not found. Removed current master slide selection.\n")
inkex.errormsg(_("Layer not found. Removed current master slide selection.\n"))
elif len(nodes) > 1:
sys.stderr.write("More than one layer with this name found. Removed current master slide selection.\n")
inkex.errormsg(_("More than one layer with this name found. Removed current master slide selection.\n"))
else:
nodes[0].set("{" + inkex.NSS["jessyink"] + "}masterSlide","masterSlide")
......
......@@ -27,6 +27,8 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
import gettext
_ = gettext.gettext
class JessyInk_CustomMouseHandler(inkex.Effect):
def __init__(self):
......@@ -40,10 +42,10 @@ class JessyInk_CustomMouseHandler(inkex.Effect):
def effect(self):
# Check version.
scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.1']", namespaces=inkex.NSS)
scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.4']", namespaces=inkex.NSS)
if len(scriptNodes) != 1:
sys.stderr.write("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 \"Effects\" menu to install or update the JessyInk script.\n\n")
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"))
# Remove old mouse handler
for node in self.document.xpath("//jessyink:mousehandler", namespaces=inkex.NSS):
......
......@@ -6,7 +6,8 @@
<dependency type="executable" location="extensions">jessyInk_summary.py</dependency>
<param name="tab" type="notebook">
<page name="help" _gui-text="Help">
<_param name="help_text" type="description">This extension allows you to obtain information about the JessyInk script, effects and transitions contained in this SVG file. Please see code.google.com/p/jessyink for more details.</_param>
<_param name="help_text" type="description">This extension allows you to obtain information about the JessyInk script, effects and transitions contained in this SVG file. Please see code.google.com/p/jessyink for more details.
</_param>
</page>
</param>
<effect>
......
......@@ -25,6 +25,8 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
import gettext
_ = gettext.gettext
def propStrToList(str):
list = []
......@@ -56,19 +58,17 @@ class JessyInk_Summary(inkex.Effect):
def effect(self):
# Check version.
scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.1']", namespaces=inkex.NSS)
scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.4']", namespaces=inkex.NSS)
if len(scriptNodes) != 1:
sys.stderr.write("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 \"Effects\" menu to install or update the JessyInk script.\n\n")
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 the script node, if present
for node in self.document.xpath("//svg:script[@id='JessyInk']", namespaces=inkex.NSS):
sys.stderr.write("JessyInk script ")
if node.get("{" + inkex.NSS["jessyink"] + "}version"):
sys.stderr.write("version " + node.get("{" + inkex.NSS["jessyink"] + "}version") + " ")
sys.stderr.write("installed.\n")
inkex.errormsg(_("JessyInk script version {0} installed.").format(node.get("{" + inkex.NSS["jessyink"] + "}version")))
else:
inkex.errormsg(_("JessyInk script installed."))
slides = []
masterSlide = None
......@@ -80,50 +80,47 @@ class JessyInk_Summary(inkex.Effect):
slides.append(node)
if masterSlide is not None:
sys.stderr.write("\nMaster slide:\n")
inkex.errormsg(_("\nMaster slide:"))
self.describeNode(masterSlide, "\t", "<the number of the slide>", str(len(slides)), "<the title of the slide>")
slideCounter = 1
for slide in slides:
sys.stderr.write("\nSlide " + str(slideCounter) + ":\n")
inkex.errormsg(_("\nSlide {0!s}:").format(slideCounter))
self.describeNode(slide, "\t", str(slideCounter), str(len(slides)), slide.get("{" + inkex.NSS["inkscape"] + "}label"))
slideCounter += 1
def describeNode(self, node, prefix, slideNumber, numberOfSlides, slideTitle):
sys.stderr.write(prefix + "Layer name: " + node.get("{" + inkex.NSS["inkscape"] + "}label") + "\n")
inkex.errormsg(_(u"{0}Layer name: {1}").format(prefix, node.get("{" + inkex.NSS["inkscape"] + "}label")))
# Display information about transitions.
transitionInAttribute = node.get("{" + inkex.NSS["jessyink"] + "}transitionIn")
if transitionInAttribute:
transInDict = propListToDict(propStrToList(transitionInAttribute))
sys.stderr.write(prefix + "Transition in: " + transInDict["name"])
if (transInDict["name"] != "appear") and transInDict.has_key("length"):
sys.stderr.write(" (" + str(int(transInDict["length"]) / 1000.0) + " s)")
sys.stderr.write("\n")
inkex.errormsg(_("{0}Transition in: {1} ({2!s} s)").format(prefix, transInDict["name"], int(transInDict["length"]) / 1000.0))
else:
inkex.errormsg(_("{0}Transition in: {1}").format(prefix, transInDict["name"]))
transitionOutAttribute = node.get("{" + inkex.NSS["jessyink"] + "}transitionOut")
if transitionOutAttribute:
transOutDict = propListToDict(propStrToList(transitionOutAttribute))
sys.stderr.write(prefix + "Transition out: " + transOutDict["name"])
if (transOutDict["name"] != "appear") and transOutDict.has_key("length"):
sys.stderr.write(" (" + str(int(transOutDict["length"]) / 1000.0) + " s)")
sys.stderr.write("\n")
inkex.errormsg(_("{0}Transition out: {1} ({2!s} s)").format(prefix, transOutDict["name"], int(transOutDict["length"]) / 1000.0))
else:
inkex.errormsg(_("{0}Transition out: {1}").format(prefix, transOutDict["name"]))
# Display information about auto-texts.
autoTexts = {"slideNumber" : slideNumber, "numberOfSlides" : numberOfSlides, "slideTitle" : slideTitle}
autoTextNodes = node.xpath(".//*[@jessyink:autoText]", namespaces=inkex.NSS)
if (len(autoTextNodes) > 0):
sys.stderr.write("\n" + prefix + "Auto-texts:\n")
inkex.errormsg(_("\n{0}Auto-texts:").format(prefix))
for atNode in autoTextNodes:
sys.stderr.write(prefix + "\t\"" + atNode.text + "\" (object id \"" + atNode.getparent().get("id") + "\") will be replaced by")
sys.stderr.write(" \"" + autoTexts[atNode.get("{" + inkex.NSS["jessyink"] + "}autoText")] + "\".\n")
inkex.errormsg(_("{0}\t\"{1}\" (object id \"{2}\") will be replaced by \"{3}\".").format(prefix, atNode.text, atNode.getparent().get("id"), autoTexts[atNode.get("{" + inkex.NSS["jessyink"] + "}autoText")]))
# Collect information about effects.
effects = {}
......@@ -165,29 +162,31 @@ class JessyInk_Summary(inkex.Effect):
# Display information about effects.
for orderItem in order:
tmpStr = ""
if orderNumber == 0:
sys.stderr.write("\n" + prefix + "Initial effect (order number " + effects[orderItem][0]["order"] + "):\n")
tmpStr += _("\n{0}Initial effect (order number {1}):").format(prefix, effects[orderItem][0]["order"])
else:
sys.stderr.write("\n" + prefix + "Effect " + str(orderNumber) + " (order number " + effects[orderItem][0]["order"] + "):\n")
tmpStr += _("\n{0}Effect {1!s} (order number {2}):").format(prefix, orderNumber, effects[orderItem][0]["order"])
for item in effects[orderItem]:
if item["type"] == "view":
sys.stderr.write(prefix + "\tView will be set according to object \"" + item["id"] + "\"")
tmpStr += _("{0}\tView will be set according to object \"{1}\"").format(prefix, item["id"])
else:
sys.stderr.write(prefix + "\tObject \"" + item["id"] + "\"")
tmpStr += _("{0}\tObject \"{1}\"").format(prefix, item["id"])
if item["direction"] == "in":
sys.stderr.write(" will appear")
tmpStr += _(" will appear")
elif item["direction"] == "out":
sys.stderr.write(" will disappear")
tmpStr += _(" will disappear")
if item["name"] != "appear":
sys.stderr.write(" using effect \"" + item["name"] + "\"")
tmpStr += _(" using effect \"{0}\"").format(item["name"])
if item.has_key("length"):
sys.stderr.write(" in " + str(int(item["length"]) / 1000.0) + " s")
tmpStr += _(" in {0!s} s").format(int(item["length"]) / 1000.0)
sys.stderr.write(".\n")
inkex.errormsg(tmpStr + ".\n")
orderNumber += 1
......
......@@ -7,7 +7,7 @@
<param name="tab" type="notebook">
<page name="settings" _gui-text="Settings">
<param name="layerName" type="string" _gui-text="Name of layer:"></param>
<_param name="effectInLabel" type="groupheader">Transition in effect</_param>
<_param name="effectInLabel" type="description">Transition in effect</_param>
<param name="effectInDuration" precision="1" type="float" min="0.1" max="10.0" _gui-text="Duration in seconds:">0.8</param>
<param name="effectIn" type="optiongroup" _gui-text="Type:">
<_option value="default">Default</_option>
......@@ -15,7 +15,7 @@
<_option value="fade">Fade</_option>
<_option value="pop">Pop</_option>
</param>
<_param name="effectOutLabel" type="groupheader">Transition out effect</_param>
<_param name="effectOutLabel" type="description">Transition out effect</_param>
<param name="effectOutDuration" precision="1" type="float" min="0.1" max="10.0" _gui-text="Duration in seconds:">0.8</param>
<param name="effectOut" type="optiongroup" _gui-text="Type:">
<_option value="default">Default</_option>
......
......@@ -25,6 +25,8 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
import gettext
_ = gettext.gettext
class JessyInk_Transitions(inkex.Effect):
def __init__(self):
......@@ -42,17 +44,17 @@ class JessyInk_Transitions(inkex.Effect):
def effect(self):
# Check version.
scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.1']", namespaces=inkex.NSS)
scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.4']", namespaces=inkex.NSS)
if len(scriptNodes) != 1:
sys.stderr.write("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 \"Effects\" menu to install or update the JessyInk script.\n\n")
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"))
if self.options.layerName != "":
nodes = self.document.xpath("//*[@inkscape:groupmode='layer' and @inkscape:label='" + self.options.layerName + "']", namespaces=inkex.NSS)
nodes = self.document.xpath(unicode("//*[@inkscape:groupmode='layer' and @inkscape:label='" + self.options.layerName + "']", 'utf-8'), namespaces=inkex.NSS)
if len(nodes) == 0:
sys.stderr.write("Layer not found.\n")
inkex.errormsg(_("Layer not found.\n"))
elif len(nodes) > 1:
sys.stderr.write("More than one layer with this name found.\n")
inkex.errormsg(_("More than one layer with this name found.\n"))
else:
if self.options.effectIn == "default":
if nodes[0].get("{" + inkex.NSS["jessyink"] + "}transitionIn"):
......@@ -65,7 +67,7 @@ class JessyInk_Transitions(inkex.Effect):
else:
nodes[0].set("{" + inkex.NSS["jessyink"] + "}transitionOut","name:" + self.options.effectOut + ";length:" + str(int(self.options.effectOutDuration * 1000)))
else:
sys.stderr.write("Please enter a layer name.\n")
inkex.errormsg(_("Please enter a layer name.\n"))
# Create effect instance
effect = JessyInk_Transitions()
......
......@@ -29,6 +29,8 @@ import os
import re
from lxml import etree
from copy import deepcopy
import gettext
_ = gettext.gettext
class JessyInk_Effects(inkex.Effect):
def __init__(self):
......@@ -41,20 +43,20 @@ class JessyInk_Effects(inkex.Effect):
def effect(self):
# Check version.
scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.1']", namespaces=inkex.NSS)
scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.4']", namespaces=inkex.NSS)
if len(scriptNodes) != 1:
sys.stderr.write("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 \"Effects\" menu to install or update the JessyInk script.\n\n")
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"))
baseView = self.document.xpath("//sodipodi:namedview[@id='base']", namespaces=inkex.NSS)
if len(baseView) != 1:
sys.stderr.write("Could not obtain the selected layer for inclusion of the video element.\n\n")
inkex.errormsg(_("Could not obtain the selected layer for inclusion of the video element.\n\n"))
layer = self.document.xpath("//svg:g[@id='" + baseView[0].attrib["{" + inkex.NSS["inkscape"] + "}current-layer"] + "']", namespaces=inkex.NSS)
if (len(layer) != 1):
sys.stderr.write("Could not obtain the selected layer for inclusion of the video element.\n\n")
inkex.errormsg(_("Could not obtain the selected layer for inclusion of the video element.\n\n"))
# Parse template file.
tmplFile = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'jessyInk_video.svg'), 'r')
......
......@@ -25,6 +25,8 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions')
# We will use the inkex module with the predefined Effect base class.
import inkex
import gettext
_ = gettext.gettext
def propStrToList(str):
list = []
......@@ -59,10 +61,10 @@ class JessyInk_Effects(inkex.Effect):
def effect(self):
# Check version.
scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.1']", namespaces=inkex.NSS)
scriptNodes = self.document.xpath("//svg:script[@jessyink:version='1.5.4']", namespaces=inkex.NSS)
if len(scriptNodes) != 1:
sys.stderr.write("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 \"Effects\" menu to install or update the JessyInk script.\n\n")
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"))
rect = None
......@@ -70,11 +72,11 @@ class JessyInk_Effects(inkex.Effect):
if rect == None:
rect = node
else:
sys.stderr.write("More than one object selected. Please select only one object.\n")
inkex.errormsg(_("More than one object selected. Please select only one object.\n"))
exit()
if rect == None:
sys.stderr.write("No object selected. Please select the object you want to assign a view to and then press apply.\n")
inkex.errormsg(_("No object selected. Please select the object you want to assign a view to and then press apply.\n"))
exit()
if not self.options.removeView:
......
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