~valavanisalex/ubuntu/precise/inkscape/fix-943984

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/share/extensions/text_replace.py

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-07-02 17:09:45 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702170945-nn6d6zswovbwju1t
Tags: 0.47~pre1-0ubuntu1
* New upstream release.
  - Don't constrain maximization on small resolution devices (pre0)
    (LP: #348842)
  - Fixes segfault on startup (pre0)
    (LP: #391149)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import chardataeffect, inkex, string
 
2
 
 
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")
 
8
 
 
9
  def process_chardata(self,text, line, par):
 
10
    fr = self.options.from_text.strip('"').replace('\$','$')
 
11
    to = self.options.to_text.strip('"').replace('\$','$')
 
12
 
 
13
    return (text.replace(unicode(fr,"utf-8"), unicode(to,"utf-8")))
 
14
 
 
15
c = C()
 
16
c.affect()