From: Hannes Hochreiner Date: Fri, 29 Oct 2010 17:09:35 +0000 (+0200) Subject: Updated the JessyInk extensions to version 1.5.4. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;ds=sidebyside;h=4d761440b84b78f6af14bb66f2fd52b69641bfd2;p=inkscape.git Updated the JessyInk extensions to version 1.5.4. --- diff --git a/share/extensions/jessyInk_autoTexts.py b/share/extensions/jessyInk_autoTexts.py index a9873e2fc..57566888f 100755 --- a/share/extensions/jessyInk_autoTexts.py +++ b/share/extensions/jessyInk_autoTexts.py @@ -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") diff --git a/share/extensions/jessyInk_effects.inx b/share/extensions/jessyInk_effects.inx index a0ff98ae9..3a8a03df8 100644 --- a/share/extensions/jessyInk_effects.inx +++ b/share/extensions/jessyInk_effects.inx @@ -6,7 +6,7 @@ jessyInk_effects.py - <_param name="effectInLabel" type="groupheader">Build-in effect + <_param name="effectInLabel" type="description">Build-in effect 1 0.8 @@ -15,7 +15,7 @@ <_option value="fade">Fade <_option value="pop">Pop - <_param name="effectOutLabel" type="groupheader">Build-out effect + <_param name="effectOutLabel" type="description">Build-out effect 1 0.8 diff --git a/share/extensions/jessyInk_effects.py b/share/extensions/jessyInk_effects.py index 862e55001..336d0ee4e 100755 --- a/share/extensions/jessyInk_effects.py +++ b/share/extensions/jessyInk_effects.py @@ -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"): diff --git a/share/extensions/jessyInk_export.py b/share/extensions/jessyInk_export.py index 6f9bf9ecc..65247ab7e 100755 --- a/share/extensions/jessyInk_export.py +++ b/share/extensions/jessyInk_export.py @@ -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__") diff --git a/share/extensions/jessyInk_install.py b/share/extensions/jessyInk_install.py index f96615289..331b2d232 100755 --- a/share/extensions/jessyInk_install.py +++ b/share/extensions/jessyInk_install.py @@ -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. diff --git a/share/extensions/jessyInk_keyBindings.inx b/share/extensions/jessyInk_keyBindings.inx index 965079127..843957c0d 100644 --- a/share/extensions/jessyInk_keyBindings.inx +++ b/share/extensions/jessyInk_keyBindings.inx @@ -18,9 +18,10 @@ n p t + e - d + ESCAPE, d 0 1 3 diff --git a/share/extensions/jessyInk_keyBindings.py b/share/extensions/jessyInk_keyBindings.py index 45c0fe2ef..3f2ed34e9 100755 --- a/share/extensions/jessyInk_keyBindings.py +++ b/share/extensions/jessyInk_keyBindings.py @@ -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): diff --git a/share/extensions/jessyInk_masterSlide.py b/share/extensions/jessyInk_masterSlide.py index 9089215d9..41f0f8c71 100755 --- a/share/extensions/jessyInk_masterSlide.py +++ b/share/extensions/jessyInk_masterSlide.py @@ -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") diff --git a/share/extensions/jessyInk_mouseHandler.py b/share/extensions/jessyInk_mouseHandler.py index a0c06c196..f35a65bf5 100755 --- a/share/extensions/jessyInk_mouseHandler.py +++ b/share/extensions/jessyInk_mouseHandler.py @@ -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): diff --git a/share/extensions/jessyInk_summary.inx b/share/extensions/jessyInk_summary.inx index 37bc206fc..e661efd3e 100644 --- a/share/extensions/jessyInk_summary.inx +++ b/share/extensions/jessyInk_summary.inx @@ -6,7 +6,8 @@ jessyInk_summary.py - <_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 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. + diff --git a/share/extensions/jessyInk_summary.py b/share/extensions/jessyInk_summary.py index 56cec0308..f4b3d8d38 100755 --- a/share/extensions/jessyInk_summary.py +++ b/share/extensions/jessyInk_summary.py @@ -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", "", str(len(slides)), "") 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 diff --git a/share/extensions/jessyInk_transitions.inx b/share/extensions/jessyInk_transitions.inx index bf794e9cf..1599d2c20 100644 --- a/share/extensions/jessyInk_transitions.inx +++ b/share/extensions/jessyInk_transitions.inx @@ -7,7 +7,7 @@ - <_param name="effectInLabel" type="groupheader">Transition in effect + <_param name="effectInLabel" type="description">Transition in effect 0.8 <_option value="default">Default @@ -15,7 +15,7 @@ <_option value="fade">Fade <_option value="pop">Pop - <_param name="effectOutLabel" type="groupheader">Transition out effect + <_param name="effectOutLabel" type="description">Transition out effect 0.8 <_option value="default">Default diff --git a/share/extensions/jessyInk_transitions.py b/share/extensions/jessyInk_transitions.py index d35477d20..779532168 100755 --- a/share/extensions/jessyInk_transitions.py +++ b/share/extensions/jessyInk_transitions.py @@ -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() diff --git a/share/extensions/jessyInk_video.py b/share/extensions/jessyInk_video.py index 1d4ae0ee3..222670b35 100755 --- a/share/extensions/jessyInk_video.py +++ b/share/extensions/jessyInk_video.py @@ -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') diff --git a/share/extensions/jessyInk_view.py b/share/extensions/jessyInk_view.py index 639cb6b47..ba9c4a686 100755 --- a/share/extensions/jessyInk_view.py +++ b/share/extensions/jessyInk_view.py @@ -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: