index 350c87f28fa581eafd882742ed7c5804d41911b3..265b4d4338f1beeb7e5c625ef9e8b5b732a41bb2 100644 (file)
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):
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():
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')
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)
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