X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=share%2Fextensions%2Fmarkers_strokepaint.py;h=265b4d4338f1beeb7e5c625ef9e8b5b732a41bb2;hb=04ae50eb1e8d1b509dc91d0475039bdae0077469;hp=350c87f28fa581eafd882742ed7c5804d41911b3;hpb=e9df3bcdd3387ec845d1fea626de245aa8d7e93b;p=inkscape.git diff --git a/share/extensions/markers_strokepaint.py b/share/extensions/markers_strokepaint.py index 350c87f28..265b4d433 100644 --- a/share/extensions/markers_strokepaint.py +++ b/share/extensions/markers_strokepaint.py @@ -17,6 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ''' import random, inkex, simplestyle, copy +import gettext +_ = gettext.gettext class MyEffect(inkex.Effect): def __init__(self): @@ -28,7 +30,7 @@ class MyEffect(inkex.Effect): def effect(self): defs = self.xpathSingle('/svg:svg//svg:defs') - if not defs: + if defs == None: defs = inkex.etree.SubElement(self.document.getroot(),inkex.addNS('defs','svg')) for id, node in self.selected.iteritems(): @@ -36,7 +38,7 @@ class MyEffect(inkex.Effect): try: style = simplestyle.parseStyle(node.get('style')) except: - inkex.debug("No style attribute found for id: %s" % id) + inkex.errormsg(_("No style attribute found for id: %s") % id) continue stroke = style.get('stroke', '#000000') @@ -51,7 +53,7 @@ class MyEffect(inkex.Effect): else: mnode = old_mnode except: - inkex.debug("unable to locate marker: %s" % marker_id) + inkex.errormsg(_("unable to locate marker: %s") % marker_id) continue new_id = self.uniqueId(marker_id, not self.options.modify) @@ -71,5 +73,9 @@ class MyEffect(inkex.Effect): child.set('style',simplestyle.formatStyle(cstyle)) node.set('style',simplestyle.formatStyle(style)) -e = MyEffect() -e.affect() +if __name__ == '__main__': + e = MyEffect() + e.affect() + + +# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 encoding=utf-8 textwidth=99