Code

Restore 0.46 placement of node alignment buttons
[inkscape.git] / share / extensions / text_replace.py
1 import chardataeffect, inkex, string
3 class C(chardataeffect.CharDataEffect):
4   def __init__(self):
5     chardataeffect.CharDataEffect.__init__(self)
6     self.OptionParser.add_option("-f", "--from_text", action="store", type="string", dest="from_text", default="", help="Replace")
7     self.OptionParser.add_option("-t", "--to_text", action="store", type="string", dest="to_text", default="", help="by")
9   def process_chardata(self,text, line, par):
10     fr = self.options.from_text.strip('"').replace('\$','$')
11     to = self.options.to_text.strip('"').replace('\$','$')
13     return (text.replace(unicode(fr,"utf-8"), unicode(to,"utf-8")))
15 c = C()
16 c.affect()