index 5bac2550b5bad2fdd34ab9cd23dda8f8d49e7185..7a2fa09eabffe05ec601bc3a1b84a713dad89fed 100644 (file)
import inkex, cubicsuperpath, bezmisc
import pathmodifier,simpletransform
-
import copy, math, re, random
+import gettext
+_ = gettext.gettext
def flipxy(path):
for pathcomp in path:
action="store", type="inkbool",
dest="duplicate", default=False,
help="duplicate pattern before deformation")
+ self.OptionParser.add_option("--tab",
+ action="store", type="string",
+ dest="tab",
+ help="The selected UI-tab when OK was pressed")
def prepareSelectionList(self):
def effect(self):
if len(self.options.ids)<2:
- inkex.debug("This extension requires that you select two paths.")
+ inkex.errormsg(_("This extension requires two selected paths."))
return
self.prepareSelectionList()
self.options.wave = (self.options.kind=="Ribbon")
if self.options.vertical:
#flipxy(bbox)...
bbox=(-bbox[3],-bbox[2],-bbox[1],-bbox[0])
-
+
width=bbox[1]-bbox[0]
dx=width+self.options.space
+ if dx < 0.01:
+ exit(_("The total length of the pattern is too small :\nPlease choose a larger object or set 'Space between copies' > 0"))
for id, node in self.patterns.iteritems():
if node.tag == inkex.addNS('path','svg') or node.tag=='path':
node.set('d', cubicsuperpath.formatPath(newp))
-e = PathAlongPath()
-e.affect()
+if __name__ == '__main__':
+ e = PathAlongPath()
+ e.affect()
+# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99