Code

Restore 0.46 placement of node alignment buttons
[inkscape.git] / share / extensions / markers_strokepaint.py
index 350c87f28fa581eafd882742ed7c5804d41911b3..265b4d4338f1beeb7e5c625ef9e8b5b732a41bb2 100644 (file)
@@ -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