index 9089215d96dfa13f3a5e9704e91436254f6334a6..c29922d9412bb0c93a440600a3a5f54a8852f64e 100755 (executable)
# 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):
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.5']", 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):
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")