diff options
| author | bulia byak <buliabyak@gmail.com> | 2007-07-15 03:29:51 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2007-07-15 03:29:51 +0000 |
| commit | d218fee8cc61a79dcdd89b05c8d58072f9e69c52 (patch) | |
| tree | 160486d6573afb2ee53230beaec7576465770644 /share/extensions/text_replace.py | |
| parent | Add poppler (diff) | |
| download | inkscape-d218fee8cc61a79dcdd89b05c8d58072f9e69c52.tar.gz inkscape-d218fee8cc61a79dcdd89b05c8d58072f9e69c52.zip | |
text replace
(bzr r3245)
Diffstat (limited to 'share/extensions/text_replace.py')
| -rw-r--r-- | share/extensions/text_replace.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/share/extensions/text_replace.py b/share/extensions/text_replace.py new file mode 100644 index 000000000..3ea665970 --- /dev/null +++ b/share/extensions/text_replace.py @@ -0,0 +1,16 @@ +import chardataeffect, inkex, string
+
+class C(chardataeffect.CharDataEffect):
+ def __init__(self):
+ chardataeffect.CharDataEffect.__init__(self)
+ self.OptionParser.add_option("-f", "--from_text", action="store", type="string", dest="from_text", default="", help="Replace")
+ self.OptionParser.add_option("-t", "--to_text", action="store", type="string", dest="to_text", default="", help="by")
+
+ def process_chardata(self,text, line, par):
+ fr = self.options.from_text.strip('"').replace('\$','$')
+ to = self.options.to_text.strip('"').replace('\$','$')
+
+ return (text.replace(fr, to))
+
+c = C()
+c.affect()
|
