Gentoo Archives: gentoo-commits

From: "Mike Gilbert (floppym)" <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-python/docutils/files: docutils-0.11-python3.3-odt-writer.patch
Date: Tue, 01 Apr 2014 04:47:52
Message-Id: 20140401044748.D16872005E@flycatcher.gentoo.org
1 floppym 14/04/01 04:47:48
2
3 Added: docutils-0.11-python3.3-odt-writer.patch
4 Log:
5 Version bump, add python3.4.
6
7 (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 0BBEEA1FEA4843A4)
8
9 Revision Changes Path
10 1.1 dev-python/docutils/files/docutils-0.11-python3.3-odt-writer.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/docutils/files/docutils-0.11-python3.3-odt-writer.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/docutils/files/docutils-0.11-python3.3-odt-writer.patch?rev=1.1&content-type=text/plain
14
15 Index: docutils-0.11-python3.3-odt-writer.patch
16 ===================================================================
17 --- a/docutils/writers/odf_odt/__init__.py
18 +++ b/docutils/writers/odf_odt/__init__.py
19 @@ -88,16 +88,20 @@
20 # that support for the ability to get the parent of an element.
21 #
22 if WhichElementTree == 'elementtree':
23 - class _ElementInterfaceWrapper(etree._ElementInterface):
24 + import weakref
25 + _parents = weakref.WeakKeyDictionary()
26 + if isinstance(etree.Element, type):
27 + _ElementInterface = etree.Element
28 + else:
29 + _ElementInterface = etree._ElementInterface
30 + class _ElementInterfaceWrapper(_ElementInterface):
31 def __init__(self, tag, attrib=None):
32 - etree._ElementInterface.__init__(self, tag, attrib)
33 - if attrib is None:
34 - attrib = {}
35 - self.parent = None
36 + _ElementInterface.__init__(self, tag, attrib)
37 + _parents[self] = None
38 def setparent(self, parent):
39 - self.parent = parent
40 + _parents[self] = parent
41 def getparent(self):
42 - return self.parent
43 + return _parents[self]
44
45
46 #