~ubuntu-branches/ubuntu/utopic/inkscape/utopic-proposed

« back to all changes in this revision

Viewing changes to share/extensions/inkex.py

  • Committer: Package Import Robot
  • Author(s): Alex Valavanis
  • Date: 2014-08-19 19:10:32 UTC
  • mfrom: (1.6.5) (2.5.14 sid)
  • Revision ID: package-import@ubuntu.com-20140819191032-2eca1qihaszjk9i6
Tags: 0.48.5-2ubuntu1
* Merge with Debian Unstable (LP: #1358863). Fixes several Ubuntu bugs:
  - Illustrator CS SVG won't load: namespace URIs in entities (LP: #166371)
  - inkscape crashed with SIGSEGV in
    sp_dtw_color_profile_event() (LP: #966441)
  - inkscape crashed with SIGSEGV (LP: #1051017)
  - inkscape crashed with SIGSEGV in Inkscape::Preferences::_getNode()
    (LP: #1163241)
  - save a copy reverts to save as (LP: #529843)
  - Extension to braille not working on Xubuntu 12.10 (LP: #1090865)
* Remaining changes:
  - debian/control:
    + Set Ubuntu Developer as maintainer,
    + build-depend on dh-translation to handle Ubuntu translation,
    + demote pstoedit from Recommends to Suggests (because it's in universe),
  - debian/patches/0006_add_unity_quicklist_support.patch: add.
  - debian/patches/series: update.
  - debian/rules:
    + add dh_translation to handle Ubuntu translation
* Drop debian/patches/librevenge.patch (superseded by
    debian/patches/0006-Update_to_new_libwpg.patch)

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
 
111
111
    def __init__(self, *args, **kwargs):
112
112
        self.document=None
 
113
        self.original_document=None
113
114
        self.ctx=None
114
115
        self.selected={}
115
116
        self.doc_ids={}
136
137
                stream = open(self.svg_file,'r')
137
138
        except:
138
139
            stream = sys.stdin
139
 
        self.document = etree.parse(stream)
 
140
        p = etree.XMLParser(huge_tree=True)
 
141
        self.document = etree.parse(stream, parser=p)
 
142
        self.original_document = copy.deepcopy(self.document)
140
143
        stream.close()
141
144
 
142
145
    def getposinlayer(self):
202
205
 
203
206
    def output(self):
204
207
        """Serialize document into XML on stdout"""
205
 
        self.document.write(sys.stdout)
 
208
        original = etree.tostring(self.original_document)        
 
209
        result = etree.tostring(self.document)        
 
210
        if original != result:
 
211
            self.document.write(sys.stdout)
206
212
 
207
213
    def affect(self, args=sys.argv[1:], output=True):
208
214
        """Affect an SVG document with a callback effect"""