diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2011-07-06 01:59:32 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2011-07-06 01:59:32 +0000 |
| commit | e65a02ed32b78534739aba24929ece7c44dd967f (patch) | |
| tree | 13cf022f18f6b5bae46aad4bc339e512f069a514 /share/extensions/funcplot.py | |
| parent | Pull 2Geom revision 2013 (extra constructors for Rect). (diff) | |
| parent | Text edit dialog: Apply button should grab default only after adding to window (diff) | |
| download | inkscape-e65a02ed32b78534739aba24929ece7c44dd967f.tar.gz inkscape-e65a02ed32b78534739aba24929ece7c44dd967f.zip | |
Merge from trunk
(bzr r10347.1.5)
Diffstat (limited to 'share/extensions/funcplot.py')
| -rw-r--r-- | share/extensions/funcplot.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/share/extensions/funcplot.py b/share/extensions/funcplot.py index 0beaf3946..a868e92a4 100644 --- a/share/extensions/funcplot.py +++ b/share/extensions/funcplot.py @@ -28,6 +28,8 @@ Changes: import inkex, simplepath, simplestyle from math import * from random import * +import gettext +_ = gettext.gettext 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): @@ -235,6 +237,7 @@ class FuncPlot(inkex.Effect): help="dummy") def effect(self): + newpath = None for id, node in self.selected.iteritems(): if node.tag == inkex.addNS('rect','svg'): # create new path with basic dimensions of selected rectangle @@ -283,7 +286,9 @@ class FuncPlot(inkex.Effect): # option wether to remove the rectangle or not. if self.options.remove: node.getparent().remove(node) - + if newpath is None: + inkex.errormsg(_("Please select a rectangle")) + if __name__ == '__main__': e = FuncPlot() e.affect() |
