diff options
| author | Michael Soegtrop <MSoegtrop@yahoo.de> | 2016-06-12 10:52:33 +0000 |
|---|---|---|
| committer | Michael Soegtrop <MSoegtrop@yahoo.de> | 2016-06-12 10:52:33 +0000 |
| commit | 013ba80c5b0115dbb0f6da01e1f42806a4037eb8 (patch) | |
| tree | fe8d764a8e808c2084df8ace149d472109f3ae25 /share/extensions | |
| parent | Fixed Bool LPE review issues (diff) | |
| parent | Optionally sort attributes and properties into a canonical order. (diff) | |
| download | inkscape-013ba80c5b0115dbb0f6da01e1f42806a4037eb8.tar.gz inkscape-013ba80c5b0115dbb0f6da01e1f42806a4037eb8.zip | |
updated to latest trunk
(bzr r14876.2.3)
Diffstat (limited to 'share/extensions')
66 files changed, 395 insertions, 141 deletions
diff --git a/share/extensions/convert2dashes.py b/share/extensions/convert2dashes.py index 3910d8e82..1d1ba9736 100755 --- a/share/extensions/convert2dashes.py +++ b/share/extensions/convert2dashes.py @@ -26,8 +26,6 @@ import cubicsuperpath import bezmisc import simplestyle -inkex.localize() - def tpoint((x1,y1), (x2,y2), t = 0.5): return [x1+t*(x2-x1),y1+t*(y2-y1)] def cspbezsplit(sp1, sp2, t = 0.5): @@ -49,9 +47,21 @@ def cspseglength(sp1,sp2, tolerance = 0.001): class SplitIt(inkex.Effect): def __init__(self): inkex.Effect.__init__(self) + self.not_converted = [] def effect(self): - for id, node in self.selected.iteritems(): + for i, node in self.selected.iteritems(): + self.convert2dash(node) + if len(self.not_converted): + inkex.errormsg(_('Total number of objects not converted: {}\n').format(len(self.not_converted))) + # return list of IDs in case the user needs to find a specific object + inkex.debug(self.not_converted) + + def convert2dash(self, node): + if node.tag == inkex.addNS('g', 'svg'): + for child in node: + self.convert2dash(child) + else: if node.tag == inkex.addNS('path','svg'): dashes = [] offset = 0 @@ -97,7 +107,7 @@ class SplitIt(inkex.Effect): if node.get(inkex.addNS('type','sodipodi')): del node.attrib[inkex.addNS('type', 'sodipodi')] else: - inkex.errormsg(_("The selected object is not a path.\nTry using the procedure Path->Object to Path.")) + self.not_converted.append(node.get('id')) if __name__ == '__main__': e = SplitIt() diff --git a/share/extensions/dimension.py b/share/extensions/dimension.py index 462a05bae..e6b2d8f85 100755 --- a/share/extensions/dimension.py +++ b/share/extensions/dimension.py @@ -44,7 +44,6 @@ import inkex import pathmodifier from simpletransform import * -inkex.localize() class Dimension(pathmodifier.PathModifier): def __init__(self): diff --git a/share/extensions/draw_from_triangle.py b/share/extensions/draw_from_triangle.py index 5efabfbba..74a58b863 100755 --- a/share/extensions/draw_from_triangle.py +++ b/share/extensions/draw_from_triangle.py @@ -38,7 +38,6 @@ import inkex import simplestyle import simplepath -inkex.localize() #DRAWING ROUTINES diff --git a/share/extensions/dxf_input.py b/share/extensions/dxf_input.py index 30adb73f9..1dcbac7b8 100755 --- a/share/extensions/dxf_input.py +++ b/share/extensions/dxf_input.py @@ -26,7 +26,6 @@ import inkex, simplestyle, math from StringIO import StringIO from urllib import quote -inkex.localize() def export_MTEXT(): # mandatory group codes : (1 or 3, 10, 20) (text, x, y) @@ -482,6 +481,9 @@ while line[0] and (line[1] != 'ENDSEC' or not inENTITIES): elif vals[groups['8']]: # use Common Layer Name if not vals[groups['8']][0]: vals[groups['8']][0] = '0' # use default name + if not layer_nodes.has_key(vals[groups['8']][0]): + attribs = {inkex.addNS('groupmode','inkscape'): 'layer', inkex.addNS('label','inkscape'): '%s' % vals[groups['8']][0]} + layer_nodes[vals[groups['8']][0]] = inkex.etree.SubElement(doc.getroot(), 'g', attribs) layer = layer_nodes[vals[groups['8']][0]] color = '#000000' # default color if vals[groups['8']]: diff --git a/share/extensions/dxf_outlines.py b/share/extensions/dxf_outlines.py index 0e8cb7f62..525461bde 100755 --- a/share/extensions/dxf_outlines.py +++ b/share/extensions/dxf_outlines.py @@ -40,8 +40,6 @@ import cubicsuperpath import coloreffect import dxf_templates -inkex.localize() - try: from numpy import * from numpy.linalg import solve diff --git a/share/extensions/embedimage.py b/share/extensions/embedimage.py index 136c20f98..9ebe084a3 100755 --- a/share/extensions/embedimage.py +++ b/share/extensions/embedimage.py @@ -25,7 +25,6 @@ import urlparse # local library import inkex -inkex.localize() class Embedder(inkex.Effect): def __init__(self): diff --git a/share/extensions/export_gimp_palette.py b/share/extensions/export_gimp_palette.py index 25856f4b4..9c04d6e34 100755 --- a/share/extensions/export_gimp_palette.py +++ b/share/extensions/export_gimp_palette.py @@ -19,8 +19,6 @@ except: import inkex import simplestyle -inkex.localize() - colortags=(u'fill',u'stroke',u'stop-color',u'flood-color',u'lighting-color') colors={} diff --git a/share/extensions/extractimage.py b/share/extensions/extractimage.py index aae7bd062..031a01560 100755 --- a/share/extensions/extractimage.py +++ b/share/extensions/extractimage.py @@ -22,8 +22,6 @@ import os # local library import inkex -inkex.localize() - class MyEffect(inkex.Effect): def __init__(self): inkex.Effect.__init__(self) diff --git a/share/extensions/extrude.py b/share/extensions/extrude.py index 8db6b1512..88ae3994a 100755 --- a/share/extensions/extrude.py +++ b/share/extensions/extrude.py @@ -22,8 +22,6 @@ import simplepath import simpletransform import cubicsuperpath -inkex.localize() - class Extrude(inkex.Effect): def __init__(self): inkex.Effect.__init__(self) diff --git a/share/extensions/funcplot.py b/share/extensions/funcplot.py index c0fb3e525..557aac302 100755 --- a/share/extensions/funcplot.py +++ b/share/extensions/funcplot.py @@ -34,8 +34,6 @@ import inkex import simplepath import simplestyle -inkex.localize() - def drawfunction(xstart, xend, ybottom, ytop, samples, width, height, left, bottom, fx = "sin(x)", fpx = "cos(x)", fponum = True, times2pi = False, polar = False, isoscale = True, drawaxis = True, endpts = False): diff --git a/share/extensions/gcodetools.py b/share/extensions/gcodetools.py index 4cb5b2696..dab0312af 100755 --- a/share/extensions/gcodetools.py +++ b/share/extensions/gcodetools.py @@ -87,8 +87,6 @@ import simplepath import cubicsuperpath import simpletransform import bezmisc - -inkex.localize() ### Check if inkex has errormsg (0.46 version does not have one.) Could be removed later. if "errormsg" not in dir(inkex): diff --git a/share/extensions/generate_voronoi.py b/share/extensions/generate_voronoi.py index 8907db493..4cf541aa2 100755 --- a/share/extensions/generate_voronoi.py +++ b/share/extensions/generate_voronoi.py @@ -27,8 +27,6 @@ import inkex import simplestyle, simpletransform import voronoi -inkex.localize() - try: from subprocess import Popen, PIPE except: diff --git a/share/extensions/gimp_xcf.py b/share/extensions/gimp_xcf.py index 39dec8c13..7dfdc0cc8 100755 --- a/share/extensions/gimp_xcf.py +++ b/share/extensions/gimp_xcf.py @@ -27,8 +27,6 @@ import tempfile # local library import inkex -inkex.localize() - # Define extension exceptions class GimpXCFError(Exception): pass diff --git a/share/extensions/guides_creator.py b/share/extensions/guides_creator.py index e0aa6cadf..70144d9dd 100755 --- a/share/extensions/guides_creator.py +++ b/share/extensions/guides_creator.py @@ -54,9 +54,6 @@ from math import sqrt import inkex from simplestyle import * -# for localized debugging output -inkex.localize() - from xml.etree import ElementTree as ET # for golden number formula and diagonal guides diff --git a/share/extensions/guillotine.py b/share/extensions/guillotine.py index 15a0fba96..ee7ae39fa 100755 --- a/share/extensions/guillotine.py +++ b/share/extensions/guillotine.py @@ -50,8 +50,6 @@ except: import inkex import simplestyle -inkex.localize() - locale.setlocale(locale.LC_ALL, '') def float_sort(a, b): diff --git a/share/extensions/hpgl_input.py b/share/extensions/hpgl_input.py index 8cc7edaaf..2b275cbf8 100755 --- a/share/extensions/hpgl_input.py +++ b/share/extensions/hpgl_input.py @@ -25,8 +25,6 @@ from StringIO import StringIO import hpgl_decoder import inkex import sys -inkex.localize() - # parse options parser = inkex.optparse.OptionParser(usage='usage: %prog [options] HPGLfile', option_class=inkex.InkOption) @@ -68,4 +66,4 @@ if 'UNKNOWN_COMMANDS' in warnings: # deliver document to inkscape doc.write(inkex.sys.stdout) -# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99
\ No newline at end of file +# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99 diff --git a/share/extensions/hpgl_output.py b/share/extensions/hpgl_output.py index 477db40e7..58f82da71 100755 --- a/share/extensions/hpgl_output.py +++ b/share/extensions/hpgl_output.py @@ -23,7 +23,6 @@ import sys # local libraries import hpgl_encoder import inkex -inkex.localize() class HpglOutput(inkex.Effect): @@ -79,4 +78,4 @@ if __name__ == '__main__': e = HpglOutput() e.affect() -# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99
\ No newline at end of file +# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99 diff --git a/share/extensions/image_attributes.py b/share/extensions/image_attributes.py index 80ad62c26..98cc5204f 100755 --- a/share/extensions/image_attributes.py +++ b/share/extensions/image_attributes.py @@ -28,12 +28,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. import inkex import simplestyle -try: - inkex.localize() -except: - import gettext - _ = gettext.gettext - class SetAttrImage(inkex.Effect): def __init__(self): diff --git a/share/extensions/inkex.py b/share/extensions/inkex.py index 264ae0ff4..9d3bb0c6d 100755 --- a/share/extensions/inkex.py +++ b/share/extensions/inkex.py @@ -95,7 +95,6 @@ def errormsg(msg): Note that this should always be combined with translation: import inkex - inkex.localize() ... inkex.errormsg(_("This extension requires two selected paths.")) """ @@ -275,6 +274,7 @@ class Effect: def affect(self, args=sys.argv[1:], output=True): """Affect an SVG document with a callback effect""" self.svg_file = args[-1] + localize() self.getoptions(args) self.parse() self.getposinlayer() diff --git a/share/extensions/inkscape_help_keys.inx b/share/extensions/inkscape_help_keys.inx index 612524517..5aabbea41 100644 --- a/share/extensions/inkscape_help_keys.inx +++ b/share/extensions/inkscape_help_keys.inx @@ -4,7 +4,7 @@ <id>org.inkscape.help.keys</id>
<dependency type="executable" location="extensions">launch_webbrowser.py</dependency>
<!-- i18n. Please don't translate it unless a page exists in your language -->
- <_param name="url" gui-hidden="true" type="string">http://inkscape.org/doc/keys091.html</_param>
+ <_param name="url" gui-hidden="true" type="string">http://inkscape.org/doc/keys092.html</_param>
<effect needs-document="false">
<object-type>all</object-type>
<effects-menu hidden="true" />
diff --git a/share/extensions/inkscape_help_relnotes.inx b/share/extensions/inkscape_help_relnotes.inx index d032eb7e0..5c5b1b4e8 100644 --- a/share/extensions/inkscape_help_relnotes.inx +++ b/share/extensions/inkscape_help_relnotes.inx @@ -4,7 +4,7 @@ <id>org.inkscape.help.relnotes</id>
<dependency type="executable" location="extensions">launch_webbrowser.py</dependency>
<!-- i18n. Please don't translate it unless a page exists in your language -->
- <_param name="url" gui-hidden="true" type="string">http://wiki.inkscape.org/wiki/index.php/Release_notes/0.91</_param>
+ <_param name="url" gui-hidden="true" type="string">http://wiki.inkscape.org/wiki/index.php/Release_notes/0.92</_param>
<effect needs-document="false">
<object-type>all</object-type>
<effects-menu hidden="true" />
diff --git a/share/extensions/interp_att_g.py b/share/extensions/interp_att_g.py index 2ae46b46d..8718caf41 100755 --- a/share/extensions/interp_att_g.py +++ b/share/extensions/interp_att_g.py @@ -25,7 +25,6 @@ import inkex import simplestyle from pathmodifier import zSort -inkex.localize() class InterpAttG(inkex.Effect): diff --git a/share/extensions/jessyInk_autoTexts.py b/share/extensions/jessyInk_autoTexts.py index ed0edb6fa..2c52964da 100755 --- a/share/extensions/jessyInk_autoTexts.py +++ b/share/extensions/jessyInk_autoTexts.py @@ -25,7 +25,6 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions') # We will use the inkex module with the predefined Effect base class. import inkex -inkex.localize() class JessyInk_AutoTexts(inkex.Effect): def __init__(self): diff --git a/share/extensions/jessyInk_effects.py b/share/extensions/jessyInk_effects.py index e20e9fc2c..dc56d3a75 100755 --- a/share/extensions/jessyInk_effects.py +++ b/share/extensions/jessyInk_effects.py @@ -25,7 +25,6 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions') # We will use the inkex module with the predefined Effect base class. import inkex -inkex.localize() class JessyInk_Effects(inkex.Effect): def __init__(self): diff --git a/share/extensions/jessyInk_export.py b/share/extensions/jessyInk_export.py index 71907e276..1c7cc8c37 100755 --- a/share/extensions/jessyInk_export.py +++ b/share/extensions/jessyInk_export.py @@ -31,8 +31,6 @@ import zipfile import glob import re -inkex.localize() - def propStrToDict(inStr): dictio = {} diff --git a/share/extensions/jessyInk_keyBindings.py b/share/extensions/jessyInk_keyBindings.py index df50f4447..2e2b48c7d 100755 --- a/share/extensions/jessyInk_keyBindings.py +++ b/share/extensions/jessyInk_keyBindings.py @@ -26,7 +26,6 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions') # We will use the inkex module with the predefined Effect base class. import inkex -inkex.localize() class JessyInk_CustomKeyBindings(inkex.Effect): modes = ('slide', 'index', 'drawing') diff --git a/share/extensions/jessyInk_masterSlide.py b/share/extensions/jessyInk_masterSlide.py index eca7711ff..edaf751fa 100755 --- a/share/extensions/jessyInk_masterSlide.py +++ b/share/extensions/jessyInk_masterSlide.py @@ -26,8 +26,6 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions') # We will use the inkex module with the predefined Effect base class. import inkex -inkex.localize() - class JessyInk_MasterSlide(inkex.Effect): def __init__(self): # Call the base class constructor. diff --git a/share/extensions/jessyInk_mouseHandler.py b/share/extensions/jessyInk_mouseHandler.py index fafc8eec3..3b64e7658 100755 --- a/share/extensions/jessyInk_mouseHandler.py +++ b/share/extensions/jessyInk_mouseHandler.py @@ -28,7 +28,6 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions') # We will use the inkex module with the predefined Effect base class. import inkex -inkex.localize() class JessyInk_CustomMouseHandler(inkex.Effect): def __init__(self): diff --git a/share/extensions/jessyInk_summary.py b/share/extensions/jessyInk_summary.py index feff79b37..c5be47a49 100755 --- a/share/extensions/jessyInk_summary.py +++ b/share/extensions/jessyInk_summary.py @@ -26,7 +26,6 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions') # We will use the inkex module with the predefined Effect base class. import inkex -inkex.localize() def propStrToList(str): list = [] diff --git a/share/extensions/jessyInk_transitions.py b/share/extensions/jessyInk_transitions.py index bfd75584c..f463b2fb5 100755 --- a/share/extensions/jessyInk_transitions.py +++ b/share/extensions/jessyInk_transitions.py @@ -26,7 +26,6 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions') # We will use the inkex module with the predefined Effect base class. import inkex -inkex.localize() class JessyInk_Transitions(inkex.Effect): def __init__(self): diff --git a/share/extensions/jessyInk_video.py b/share/extensions/jessyInk_video.py index bca98e9a7..bd20d837f 100755 --- a/share/extensions/jessyInk_video.py +++ b/share/extensions/jessyInk_video.py @@ -30,8 +30,6 @@ import re from lxml import etree from copy import deepcopy -inkex.localize() - class JessyInk_Effects(inkex.Effect): def __init__(self): # Call the base class constructor. diff --git a/share/extensions/jessyInk_view.py b/share/extensions/jessyInk_view.py index ee71a1d35..37a30758f 100755 --- a/share/extensions/jessyInk_view.py +++ b/share/extensions/jessyInk_view.py @@ -26,7 +26,6 @@ sys.path.append('C:\Program Files\Inkscape\share\extensions') # We will use the inkex module with the predefined Effect base class. import inkex -inkex.localize() def propStrToList(str): list = [] diff --git a/share/extensions/radiusrand.inx b/share/extensions/jitternodes.inx index 38e7d6c4c..817fbd276 100644 --- a/share/extensions/radiusrand.inx +++ b/share/extensions/jitternodes.inx @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> <_name>Jitter nodes</_name> - <id>org.ekips.filter.radiusrand</id> - <dependency type="executable" location="extensions">radiusrand.py</dependency> + <id>org.ekips.filter.jitternodes</id> + <dependency type="executable" location="extensions">jitternodes.py</dependency> <dependency type="executable" location="extensions">inkex.py</dependency> <param name="tab" type="notebook"> <page name="Options" _gui-text="Options"> @@ -10,7 +10,12 @@ <param name="radiusy" type="float" min="0.0" max="1000.0" _gui-text="Maximum displacement in Y (px):">10.0</param> <param name="end" type="boolean" _gui-text="Shift nodes">true</param> <param name="ctrl" type="boolean" _gui-text="Shift node handles">false</param> - <param name="norm" type="boolean" _gui-text="Use normal distribution">true</param> + <param name="dist" type="enum" _gui-text="Distribution of the displacements:"> + <_item value="Uniform">Uniform</_item> + <_item value="Pareto">Pareto</_item> + <_item value="Gaussian">Gaussian</_item> + <_item value="Lognorm">Log-normal</_item> + </param> </page> <page name="Help" _gui-text="Help"> <_param name="title" type="description">This effect randomly shifts the nodes (and optionally node handles) of the selected path.</_param> @@ -23,6 +28,6 @@ </effects-menu> </effect> <script> - <command reldir="extensions" interpreter="python">radiusrand.py</command> + <command reldir="extensions" interpreter="python">jitternodes.py</command> </script> </inkscape-extension> diff --git a/share/extensions/radiusrand.py b/share/extensions/jitternodes.py index e4585ccd4..d6f5ce36d 100755 --- a/share/extensions/radiusrand.py +++ b/share/extensions/jitternodes.py @@ -1,10 +1,11 @@ -#!/usr/bin/env python +#!/usr/bin/env python ''' +Copyright (C) 2012 Juan Pablo Carbajal ajuanpi-dev@gmail.com Copyright (C) 2005 Aaron Spike, aaron@ekips.org 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 +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, @@ -18,40 +19,63 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ''' import random, math, inkex, cubicsuperpath -def randomize((x, y), rx, ry, norm): - if norm: - r = abs(random.normalvariate(0.0,0.5*max(rx, ry))) - else: - r = random.uniform(0.0,max(rx, ry)) - a = random.uniform(0.0,2*math.pi) - x += math.cos(a)*rx - y += math.sin(a)*ry +def randomize((x, y), rx, ry, dist): + + if dist == "Gaussian": + r1 = random.gauss(0.0,rx) + r2 = random.gauss(0.0,ry) + elif dist == "Pareto": + ''' + sign is used ot fake a double sided pareto distribution. + for parameter value between 1 and 2 the distribution has infinite variance + I truncate the distribution to a high value and then normalize it. + The idea is to get spiky distributions, any distribution with long-tails is + good (ideal would be Levy distribution). + ''' + sign = random.uniform(-1.0,1.0) + + r1 = min(random.paretovariate(1.0), 20.0)/20.0 + r2 = min(random.paretovariate(1.0), 20.0)/20.0 + + r1 = rx * math.copysign(r1, sign) + r2 = ry * math.copysign(r2, sign) + elif dist == "Lognorm": + sign = random.uniform(-1.0,1.0) + r1 = rx * math.copysign(random.lognormvariate(0.0,1.0)/3.5,sign) + r2 = ry * math.copysign(random.lognormvariate(0.0,1.0)/3.5,sign) + elif dist == "Uniform": + r1 = random.uniform(-rx,rx) + r2 = random.uniform(-ry,ry) + + x += r1 + y += r2 + return [x, y] -class RadiusRandomize(inkex.Effect): +class JitterNodes(inkex.Effect): def __init__(self): inkex.Effect.__init__(self) self.OptionParser.add_option("--title") self.OptionParser.add_option("-x", "--radiusx", - action="store", type="float", + action="store", type="float", dest="radiusx", default=10.0, help="Randomly move nodes and handles within this radius, X") self.OptionParser.add_option("-y", "--radiusy", - action="store", type="float", + action="store", type="float", dest="radiusy", default=10.0, help="Randomly move nodes and handles within this radius, Y") self.OptionParser.add_option("-c", "--ctrl", - action="store", type="inkbool", + action="store", type="inkbool", dest="ctrl", default=True, help="Randomize control points") self.OptionParser.add_option("-e", "--end", - action="store", type="inkbool", + action="store", type="inkbool", dest="end", default=True, help="Randomize nodes") - self.OptionParser.add_option("-n", "--norm", - action="store", type="inkbool", - dest="norm", default=True, - help="Use normal distribution") + self.OptionParser.add_option("-d", "--dist", + action="store", type="string", + dest="dist", default="Uniform", + help="Choose the distribution of the displacements") self.OptionParser.add_option("--tab", action="store", type="string", dest="tab", @@ -65,20 +89,20 @@ class RadiusRandomize(inkex.Effect): for subpath in p: for csp in subpath: if self.options.end: - delta=randomize([0,0], self.options.radiusx, self.options.radiusy, self.options.norm) - csp[0][0]+=delta[0] - csp[0][1]+=delta[1] - csp[1][0]+=delta[0] - csp[1][1]+=delta[1] - csp[2][0]+=delta[0] - csp[2][1]+=delta[1] + delta=randomize([0,0], self.options.radiusx, self.options.radiusy, self.options.dist) + csp[0][0]+=delta[0] + csp[0][1]+=delta[1] + csp[1][0]+=delta[0] + csp[1][1]+=delta[1] + csp[2][0]+=delta[0] + csp[2][1]+=delta[1] if self.options.ctrl: - csp[0]=randomize(csp[0], self.options.radiusx, self.options.radiusy, self.options.norm) - csp[2]=randomize(csp[2], self.options.radiusx, self.options.radiusy, self.options.norm) + csp[0]=randomize(csp[0], self.options.radiusx, self.options.radiusy, self.options.dist) + csp[2]=randomize(csp[2], self.options.radiusx, self.options.radiusy, self.options.dist) node.set('d',cubicsuperpath.formatPath(p)) if __name__ == '__main__': - e = RadiusRandomize() + e = JitterNodes() e.affect() diff --git a/share/extensions/launch_webbrowser.py b/share/extensions/launch_webbrowser.py index 27a738e38..225484393 100755 --- a/share/extensions/launch_webbrowser.py +++ b/share/extensions/launch_webbrowser.py @@ -5,7 +5,6 @@ import threading from optparse import OptionParser # local library import inkex -inkex.localize() class VisitWebSiteWithoutLockingInkscape(threading.Thread): def __init__(self): @@ -17,6 +16,7 @@ class VisitWebSiteWithoutLockingInkscape(threading.Thread): (self.options, args) = parser.parse_args() def run(self): + inkex.localize() webbrowser.open(_(self.options.url)) vwswli = VisitWebSiteWithoutLockingInkscape() diff --git a/share/extensions/markers_strokepaint.py b/share/extensions/markers_strokepaint.py index 76284b234..d922ef474 100755 --- a/share/extensions/markers_strokepaint.py +++ b/share/extensions/markers_strokepaint.py @@ -24,7 +24,6 @@ import copy import inkex import simplestyle -inkex.localize() class MyEffect(inkex.Effect): def __init__(self): diff --git a/share/extensions/measure.py b/share/extensions/measure.py index fe981e39e..2711727cf 100755 --- a/share/extensions/measure.py +++ b/share/extensions/measure.py @@ -41,7 +41,6 @@ import simpletransform import cubicsuperpath import bezmisc -inkex.localize() # On darwin, fall back to C in cases of # - incorrect locale IDs (see comments in bug #406662) diff --git a/share/extensions/pathalongpath.py b/share/extensions/pathalongpath.py index 93bb99d6b..8c3d42016 100755 --- a/share/extensions/pathalongpath.py +++ b/share/extensions/pathalongpath.py @@ -42,7 +42,6 @@ import bezmisc import pathmodifier import simpletransform -inkex.localize() def flipxy(path): for pathcomp in path: diff --git a/share/extensions/pathmodifier.py b/share/extensions/pathmodifier.py index d80b6eeae..bf45dd77a 100755 --- a/share/extensions/pathmodifier.py +++ b/share/extensions/pathmodifier.py @@ -39,8 +39,6 @@ import bezmisc import simplestyle from simpletransform import * -inkex.localize() - #################################################################### ##-- zOrder computation... ##-- this should be shipped out in a separate file. inkex.py? diff --git a/share/extensions/pathscatter.py b/share/extensions/pathscatter.py index 92af6ad76..361e8f8e1 100755 --- a/share/extensions/pathscatter.py +++ b/share/extensions/pathscatter.py @@ -44,8 +44,6 @@ import bezmisc import pathmodifier import simpletransform -inkex.localize() - def zSort(inNode,idList): sortedList=[] theid = inNode.get("id") diff --git a/share/extensions/perspective.py b/share/extensions/perspective.py index febe34a22..ea08b98dc 100755 --- a/share/extensions/perspective.py +++ b/share/extensions/perspective.py @@ -34,8 +34,6 @@ import cubicsuperpath import simpletransform from ffgeom import * -inkex.localize() - # third party try: from numpy import * diff --git a/share/extensions/plotter.py b/share/extensions/plotter.py index 1c4a683c1..8a14d55bc 100755 --- a/share/extensions/plotter.py +++ b/share/extensions/plotter.py @@ -27,7 +27,6 @@ import gettext import hpgl_decoder import hpgl_encoder import inkex -inkex.localize() class Plot(inkex.Effect): @@ -148,7 +147,7 @@ class Plot(inkex.Effect): + "\n\n" + _("1. Download and extract (unzip) this file to your local harddisk:") + "\n" + " https://pypi.python.org/packages/source/p/pyserial/pyserial-2.7.tar.gz" + "\n" + _("2. Copy the \"serial\" folder (Can be found inside the just extracted folder)") - + "\n" + _(" into the following Inkscape folder: C:\\<Program files>\\inkscape\\python\\Lib\\") + + "\n" + _(" into the following Inkscape folder: C:\\[Program files]\\inkscape\\python\\Lib\\") + "\n" + _("3. Close and restart Inkscape.")) return # init serial framework @@ -268,4 +267,4 @@ if __name__ == '__main__': e = Plot() e.affect() -# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99
\ No newline at end of file +# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99 diff --git a/share/extensions/polyhedron_3d.py b/share/extensions/polyhedron_3d.py index 7ce8b1c6d..86203d4bc 100755 --- a/share/extensions/polyhedron_3d.py +++ b/share/extensions/polyhedron_3d.py @@ -57,8 +57,6 @@ import inkex import simplestyle from simpletransform import computePointInNode -inkex.localize() - # third party try: from numpy import * diff --git a/share/extensions/print_win32_vector.py b/share/extensions/print_win32_vector.py index bf8e89845..7151a3f88 100755 --- a/share/extensions/print_win32_vector.py +++ b/share/extensions/print_win32_vector.py @@ -35,8 +35,6 @@ import simplestyle import simpletransform import cubicsuperpath -inkex.localize() - if not inkex.sys.platform.startswith('win'): exit(_("sorry, this will run only on Windows, exiting...")) diff --git a/share/extensions/render_alphabetsoup.py b/share/extensions/render_alphabetsoup.py index 06c82cb2d..4aa6af4c7 100755 --- a/share/extensions/render_alphabetsoup.py +++ b/share/extensions/render_alphabetsoup.py @@ -35,8 +35,6 @@ import bezmisc import simplepath import simpletransform -inkex.localize() - syntax = render_alphabetsoup_config.syntax alphabet = render_alphabetsoup_config.alphabet units = render_alphabetsoup_config.units diff --git a/share/extensions/render_barcode_datamatrix.py b/share/extensions/render_barcode_datamatrix.py index 82c827bb8..659e74de6 100755 --- a/share/extensions/render_barcode_datamatrix.py +++ b/share/extensions/render_barcode_datamatrix.py @@ -55,8 +55,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. import inkex import simplestyle from simpletransform import computePointInNode - -inkex.localize() symbols = { 'sq10': (10, 10), diff --git a/share/extensions/render_barcode_qrcode.py b/share/extensions/render_barcode_qrcode.py index d4cffd3e2..062488ca1 100755 --- a/share/extensions/render_barcode_qrcode.py +++ b/share/extensions/render_barcode_qrcode.py @@ -4,8 +4,6 @@ import math, sys import inkex from simpletransform import computePointInNode -inkex.localize() - #QRCode for Python # #Ported from the Javascript library by Sam Curren diff --git a/share/extensions/replace_font.py b/share/extensions/replace_font.py index 090920ced..06d8a8661 100755 --- a/share/extensions/replace_font.py +++ b/share/extensions/replace_font.py @@ -34,8 +34,6 @@ import sys import inkex import simplestyle -inkex.localize() - text_tags = ['{http://www.w3.org/2000/svg}tspan', '{http://www.w3.org/2000/svg}text', '{http://www.w3.org/2000/svg}flowRoot', diff --git a/share/extensions/restack.inx b/share/extensions/restack.inx index 4f5f577cb..e14d2d5d5 100644 --- a/share/extensions/restack.inx +++ b/share/extensions/restack.inx @@ -9,7 +9,7 @@ <_param name="desc_dir" type="description" appearance="header">Restack Direction</_param> <param name="nb_direction" type="notebook"> <page name="presets" _gui-text="Presets"> - <param name="direction" type="enum" _gui-text=""> + <param name="direction" type="enum" gui-text=""> <_item value="lr">Left to Right (0)</_item> <_item value="bt">Bottom to Top (90)</_item> <_item value="rl">Right to Left (180)</_item> @@ -36,7 +36,7 @@ </page> <page name="z_order" _gui-text="Based on Z-Order"> <_param name="desc_zsort" type="description" appearance="header">Restack Mode</_param> - <param name="zsort" type="enum" _gui-text=""> + <param name="zsort" type="enum" gui-text=""> <_item value="rev">Reverse Z-Order</_item> <_item value="rand">Shuffle Z-Order</_item> </param> diff --git a/share/extensions/restack.py b/share/extensions/restack.py index 67d738a13..d38e18b52 100755 --- a/share/extensions/restack.py +++ b/share/extensions/restack.py @@ -24,7 +24,6 @@ THE SOFTWARE. import inkex, os, csv, math, random from pathmodifier import zSort -inkex.localize() try: from subprocess import Popen, PIPE diff --git a/share/extensions/seamless_pattern.inx b/share/extensions/seamless_pattern.inx index f63872272..219319b85 100644 --- a/share/extensions/seamless_pattern.inx +++ b/share/extensions/seamless_pattern.inx @@ -6,7 +6,7 @@ <dependency type="executable" location="extensions">inkex.py</dependency> <param name="width" _gui-text="Custom Width (px):" type="int" min="1" max="99999999">100</param> <param name="height" _gui-text="Custom Height (px):" type="int" min="1" max="99999999">100</param> - <_param name="help-info" type="description">This extension overwrite current document</_param> + <_param name="help-info" type="description">This extension overwrites the current document</_param> <effect needs-live-preview="false"> <object-type>All</object-type> diff --git a/share/extensions/summersnight.py b/share/extensions/summersnight.py index 7af4bb571..abc9327e5 100755 --- a/share/extensions/summersnight.py +++ b/share/extensions/summersnight.py @@ -26,8 +26,6 @@ import simplepath import simpletransform from ffgeom import * -inkex.localize() - try: from subprocess import Popen, PIPE bsubprocess = True diff --git a/share/extensions/svg_and_media_zip_output.py b/share/extensions/svg_and_media_zip_output.py index c5963b721..fb1ddd823 100755 --- a/share/extensions/svg_and_media_zip_output.py +++ b/share/extensions/svg_and_media_zip_output.py @@ -51,7 +51,7 @@ import inkex import simplestyle locale.setlocale(locale.LC_ALL, '') -inkex.localize() +inkex.localize() # TODO: test if it's still needed now that localize is called from inkex. class CompressedMediaOutput(inkex.Effect): def __init__(self): diff --git a/share/extensions/svgcalendar.py b/share/extensions/svgcalendar.py index 9f221a807..29dee262b 100755 --- a/share/extensions/svgcalendar.py +++ b/share/extensions/svgcalendar.py @@ -37,7 +37,6 @@ from datetime import * import inkex import simplestyle -inkex.localize() class SVGCalendar (inkex.Effect): diff --git a/share/extensions/test/radiusrand.test.py b/share/extensions/test/jitternodes.test.py index 99cb2972b..699752af2 100755 --- a/share/extensions/test/radiusrand.test.py +++ b/share/extensions/test/jitternodes.test.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# This is only the automatic generated test file for ../radiusrand.py +# This is only the automatic generated test file for ../jitternodes.py # This must be filled with real tests and this commentary # must be cleared. # If you want to help, read the python unittest documentation: @@ -10,15 +10,15 @@ import sys sys.path.append('..') # this line allows to import the extension code import unittest -from radiusrand import * +from jitternodes import * -class RadiusRandomizeBasicTest(unittest.TestCase): +class JitterNodesBasicTest(unittest.TestCase): #def setUp(self): def test_run_without_parameters(self): args = [ 'minimal-blank.svg' ] - e = RadiusRandomize() + e = JitterNodes() e.affect( args, False ) #self.assertEqual( e.something, 'some value', 'A commentary about that.' ) diff --git a/share/extensions/ungroup_deep.inx b/share/extensions/ungroup_deep.inx new file mode 100644 index 000000000..f0b6339e8 --- /dev/null +++ b/share/extensions/ungroup_deep.inx @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>Deep Ungroup</_name> + <id>mcepl.ungroup_deep</id> + <dependency type="executable" location="extensions">ungroup_deep.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <_param name="title" type="description">Ungroup all groups in the selected object.</_param> + <param name="startdepth" type="int" min="0" max="65535" _gui-text="Starting Depth">0</param> + <param name="maxdepth" type="int" min="0" max="65535" _gui-text="Stopping Depth (from top)">65535</param> + <param name="keepdepth" type="int" min="0" max="65535" _gui-text="Depth to Keep (from bottom)">0</param> + <effect needs-live-preview="false"> + <effects-menu > + <submenu _name="Arrange" /> + </effects-menu> + </effect> + <script> + <command reldir="extensions" interpreter="python">ungroup_deep.py</command> + </script> +</inkscape-extension> diff --git a/share/extensions/ungroup_deep.py b/share/extensions/ungroup_deep.py new file mode 100644 index 000000000..d27bb8a69 --- /dev/null +++ b/share/extensions/ungroup_deep.py @@ -0,0 +1,281 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +see #inkscape on Freenode and +https://github.com/nikitakit/svg2sif/blob/master/synfig_prepare.py#L370 +for an example how to do the transform of parent to children. +""" + +__version__ = "0.2" # Works but in terms of maturity, still unsure + +from inkex import addNS +import logging +import simplestyle +import simpletransform +logging.basicConfig(format='%(levelname)s:%(funcName)s:%(message)s', + level=logging.INFO) + +try: + import inkex +except ImportError: + raise ImportError("""No module named inkex in {0}.""".format(__file__)) + +try: + from numpy import matrix +except: + raise ImportError("""Cannot find numpy.matrix in {0}.""".format(__file__)) + +SVG_NS = "http://www.w3.org/2000/svg" +INKSCAPE_NS = "http://www.inkscape.org/namespaces/inkscape" + + +class Ungroup(inkex.Effect): + + def __init__(self): + inkex.Effect.__init__(self) + self.OptionParser.add_option("-s", "--startdepth", + action="store", type="int", + dest="startdepth", default=0, + help="starting depth for ungrouping") + self.OptionParser.add_option("-m", "--maxdepth", + action="store", type="int", + dest="maxdepth", default=65535, + help="maximum ungrouping depth") + self.OptionParser.add_option("-k", "--keepdepth", + action="store", type="int", + dest="keepdepth", default=0, + help="levels of ungrouping to " + + "leave untouched") + + def _get_dimension(s="1024"): + """Convert an SVG length string from arbitrary units to pixels""" + if s == "": + return 0 + try: + last = int(s[-1]) + except: + last = None + + if type(last) == int: + return float(s) + elif s[-1] == "%": + return 1024 + elif s[-2:] == "px": + return float(s[:-2]) + elif s[-2:] == "pt": + return float(s[:-2]) * 1.25 + elif s[-2:] == "em": + return float(s[:-2]) * 16 + elif s[-2:] == "mm": + return float(s[:-2]) * 3.54 + elif s[-2:] == "pc": + return float(s[:-2]) * 15 + elif s[-2:] == "cm": + return float(s[:-2]) * 35.43 + elif s[-2:] == "in": + return float(s[:-2]) * 90 + else: + return 1024 + + def _merge_transform(self, node, transform): + """Propagate style and transform to remove inheritance + Originally from + https://github.com/nikitakit/svg2sif/blob/master/synfig_prepare.py#L370 + """ + + # Compose the transformations + if node.tag == addNS("svg", "svg") and node.get("viewBox"): + vx, vy, vw, vh = [self._get_dimension(x) + for x in node.get("viewBox").split()] + dw = self._get_dimension(node.get("width", vw)) + dh = self._get_dimension(node.get("height", vh)) + t = ("translate(%f, %f) scale(%f, %f)" % + (-vx, -vy, dw / vw, dh / vh)) + this_transform = simpletransform.parseTransform( + t, transform) + this_transform = simpletransform.parseTransform( + node.get("transform"), this_transform) + del node.attrib["viewBox"] + else: + this_transform = simpletransform.parseTransform(node.get( + "transform"), transform) + + # Set the node's transform attrib + node.set("transform", + simpletransform.formatTransform(this_transform)) + + def _merge_style(self, node, style): + """Propagate style and transform to remove inheritance + Originally from + https://github.com/nikitakit/svg2sif/blob/master/synfig_prepare.py#L370 + """ + + # Compose the style attribs + this_style = simplestyle.parseStyle(node.get("style", "")) + remaining_style = {} # Style attributes that are not propagated + + # Filters should remain on the top ancestor + non_propagated = ["filter"] + for key in non_propagated: + if key in this_style.keys(): + remaining_style[key] = this_style[key] + del this_style[key] + + # Create a copy of the parent style, and merge this style into it + parent_style_copy = style.copy() + parent_style_copy.update(this_style) + this_style = parent_style_copy + + # Merge in any attributes outside of the style + style_attribs = ["fill", "stroke"] + for attrib in style_attribs: + if node.get(attrib): + this_style[attrib] = node.get(attrib) + del node.attrib[attrib] + + if (node.tag == addNS("svg", "svg") + or node.tag == addNS("g", "svg") + or node.tag == addNS("a", "svg") + or node.tag == addNS("switch", "svg")): + # Leave only non-propagating style attributes + if len(remaining_style) == 0: + if "style" in node.keys(): + del node.attrib["style"] + else: + node.set("style", simplestyle.formatStyle(remaining_style)) + + else: + # This element is not a container + + # Merge remaining_style into this_style + this_style.update(remaining_style) + + # Set the element's style attribs + node.set("style", simplestyle.formatStyle(this_style)) + + def _merge_clippath(self, node, clippathurl): + + if (clippathurl): + node_transform = simpletransform.parseTransform( + node.get("transform")) + if (node_transform): + # Clip-paths on nodes with a transform have the transform + # applied to the clipPath as well, which we don't want. So, we + # create new clipPath element with references to all existing + # clippath subelements, but with the inverse transform applied + inverse_node_transform = simpletransform.formatTransform( + self._invert_transform(node_transform)) + new_clippath = inkex.etree.SubElement( + self.xpathSingle('//svg:defs'), 'clipPath', + {'clipPathUnits': 'userSpaceOnUse', + 'id': self.uniqueId("clipPath")}) + clippath = self.getElementById(clippathurl[5:-1]) + for c in (clippath.iterchildren()): + inkex.etree.SubElement( + new_clippath, 'use', + {inkex.addNS('href', 'xlink'): '#' + c.get("id"), + 'transform': inverse_node_transform, + 'id': self.uniqueId("use")}) + + # Set the clippathurl to be the one with the inverse transform + clippathurl = "url(#" + new_clippath.get("id") + ")" + + # Reference the parent clip-path to keep clipping intersection + # Find end of clip-path chain and add reference there + node_clippathurl = node.get("clip-path") + while (node_clippathurl): + node = self.getElementById(node_clippathurl[5:-1]) + node_clippathurl = node.get("clip-path") + node.set("clip-path", clippathurl) + + def _invert_transform(self, transform): + # duplicate list to avoid modifying it + return matrix(transform + [[0, 0, 1]]).I.tolist()[0:2] + + # Flatten a group into same z-order as parent, propagating attribs + def _ungroup(self, node): + node_parent = node.getparent() + node_index = list(node_parent).index(node) + node_style = simplestyle.parseStyle(node.get("style")) + node_transform = simpletransform.parseTransform(node.get("transform")) + node_clippathurl = node.get('clip-path') + for c in reversed(list(node)): + self._merge_transform(c, node_transform) + self._merge_style(c, node_style) + self._merge_clippath(c, node_clippathurl) + node_parent.insert(node_index, c) + node_parent.remove(node) + + # Put all ungrouping restrictions here + def _want_ungroup(self, node, depth, height): + if (node.tag == addNS("g", "svg") and + node.getparent() is not None and + height > self.options.keepdepth and + depth >= self.options.startdepth and + depth <= self.options.maxdepth): + return True + return False + + def _deep_ungroup(self, node): + # using iteration instead of recursion to avoid hitting Python + # max recursion depth limits, which is a problem in converted PDFs + + # Seed the queue (stack) with initial node + q = [{'node': node, + 'depth': 0, + 'prev': {'height': None}, + 'height': None}] + + while q: + current = q[-1] + node = current['node'] + depth = current['depth'] + height = current['height'] + + # Recursion path + if (height is None): + # Don't enter non-graphical portions of the document + if (node.tag == addNS("namedview", "sodipodi") + or node.tag == addNS("defs", "svg") + or node.tag == addNS("metadata", "svg") + or node.tag == addNS("foreignObject", "svg")): + q.pop() + + # Base case: Leaf node + if (node.tag != addNS("g", "svg") or not len(node)): + current['height'] = 0 + + # Recursive case: Group element with children + else: + depth += 1 + for c in node.iterchildren(): + q.append({'node': c, 'prev': current, + 'depth': depth, 'height': None}) + + # Return path + else: + # Ungroup if desired + if (self._want_ungroup(node, depth, height)): + self._ungroup(node) + + # Propagate (max) height up the call chain + height += 1 + previous = current['prev'] + prev_height = previous['height'] + if (prev_height is None or prev_height < height): + previous['height'] = height + + # Only process each node once + q.pop() + + def effect(self): + if len(self.selected): + for elem in self.selected.itervalues(): + self._deep_ungroup(elem) + else: + for elem in self.document.getroot(): + self._deep_ungroup(elem) + +if __name__ == '__main__': + effect = Ungroup() + effect.affect() diff --git a/share/extensions/uniconv-ext.py b/share/extensions/uniconv-ext.py index f4c80b5d6..c84ee2e0a 100755 --- a/share/extensions/uniconv-ext.py +++ b/share/extensions/uniconv-ext.py @@ -26,8 +26,6 @@ import sys from run_command import run import inkex -inkex.localize() - cmd = None try: diff --git a/share/extensions/uniconv_output.py b/share/extensions/uniconv_output.py index 93236483d..7815137b6 100755 --- a/share/extensions/uniconv_output.py +++ b/share/extensions/uniconv_output.py @@ -34,7 +34,6 @@ import sys import tempfile # local library import inkex -inkex.localize() def run(command_format, prog_name, uniconv_format): outfile = tempfile.mktemp(uniconv_format) diff --git a/share/extensions/voronoi2svg.py b/share/extensions/voronoi2svg.py index d4740b7f5..5232fb81e 100644 --- a/share/extensions/voronoi2svg.py +++ b/share/extensions/voronoi2svg.py @@ -38,7 +38,6 @@ import simpletransform import voronoi import random -inkex.localize() class Point: def __init__(self,x,y): diff --git a/share/extensions/web-set-att.py b/share/extensions/web-set-att.py index 0dafcb974..40246e2c5 100755 --- a/share/extensions/web-set-att.py +++ b/share/extensions/web-set-att.py @@ -20,8 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. import inkwebeffect import inkex -inkex.localize() - class InkWebTransmitAtt(inkwebeffect.InkWebEffect): def __init__(self): diff --git a/share/extensions/web-transmit-att.py b/share/extensions/web-transmit-att.py index bae6956b2..34c97cff3 100755 --- a/share/extensions/web-transmit-att.py +++ b/share/extensions/web-transmit-att.py @@ -20,7 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. import inkwebeffect import inkex -inkex.localize() class InkWebTransmitAtt(inkwebeffect.InkWebEffect): diff --git a/share/extensions/webslicer_create_group.py b/share/extensions/webslicer_create_group.py index 47e5f706f..567c911aa 100755 --- a/share/extensions/webslicer_create_group.py +++ b/share/extensions/webslicer_create_group.py @@ -20,8 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. from webslicer_effect import * import inkex -inkex.localize() - class WebSlicer_CreateGroup(WebSlicer_Effect): def __init__(self): diff --git a/share/extensions/webslicer_create_rect.py b/share/extensions/webslicer_create_rect.py index b68cd9ad8..865b74304 100755 --- a/share/extensions/webslicer_create_rect.py +++ b/share/extensions/webslicer_create_rect.py @@ -20,8 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. from webslicer_effect import * import inkex -inkex.localize() - class WebSlicer_CreateRect(WebSlicer_Effect): def __init__(self): diff --git a/share/extensions/webslicer_export.py b/share/extensions/webslicer_export.py index 47db5369c..9acb9d6c3 100755 --- a/share/extensions/webslicer_export.py +++ b/share/extensions/webslicer_export.py @@ -24,8 +24,6 @@ import tempfile from webslicer_effect import * import inkex -inkex.localize() - class WebSlicer_Export(WebSlicer_Effect): diff --git a/share/extensions/wireframe_sphere.py b/share/extensions/wireframe_sphere.py index 64a1266b6..9a8d646e3 100755 --- a/share/extensions/wireframe_sphere.py +++ b/share/extensions/wireframe_sphere.py @@ -61,7 +61,6 @@ import inkex import simplestyle from simpletransform import computePointInNode -inkex.localize() #SVG OUTPUT FUNCTIONS ================================================ def draw_SVG_ellipse((rx, ry), (cx, cy), width, parent, start_end=(0,2*pi),transform='' ): |
