diff options
| author | Peter Moulder <peter.moulder@monash.edu> | 2008-03-29 10:21:03 +0000 |
|---|---|---|
| committer | pjrm <pjrm@users.sourceforge.net> | 2008-03-29 10:21:03 +0000 |
| commit | 48cfa43e90e580b90d9d8ce37524cf79a06d56be (patch) | |
| tree | 6c323130b2f0c2fb32503513474fb36d84fc7ab9 /share/extensions/text_replace.py | |
| parent | svn propset svn:eol-style native *.[ch] *.cpp (including buildtool.cpp, packa... (diff) | |
| download | inkscape-48cfa43e90e580b90d9d8ce37524cf79a06d56be.tar.gz inkscape-48cfa43e90e580b90d9d8ce37524cf79a06d56be.zip | |
svn propset svn:eol-style native *.py
(bzr r5228)
Diffstat (limited to 'share/extensions/text_replace.py')
| -rw-r--r-- | share/extensions/text_replace.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/share/extensions/text_replace.py b/share/extensions/text_replace.py index 73b562743..0d6e501f5 100644 --- a/share/extensions/text_replace.py +++ b/share/extensions/text_replace.py @@ -1,16 +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(unicode(fr,"utf-8"), unicode(to,"utf-8")))
-
-c = C()
-c.affect()
+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(unicode(fr,"utf-8"), unicode(to,"utf-8"))) + +c = C() +c.affect() |
