[Python-modules-commits] r24395 - in packages/python-docutils/trunk/debian (3 files)
jwilk at users.alioth.debian.org
jwilk at users.alioth.debian.org
Thu May 16 00:05:44 UTC 2013
Date: Thursday, May 16, 2013 @ 00:05:42
Author: jwilk
Revision: 24395
Add patch to port the ODT writer to Python 3.3 ElementTree API.
Added:
packages/python-docutils/trunk/debian/patches/python3.3-odt-writer.diff
Modified:
packages/python-docutils/trunk/debian/changelog
packages/python-docutils/trunk/debian/patches/series
Modified: packages/python-docutils/trunk/debian/changelog
===================================================================
--- packages/python-docutils/trunk/debian/changelog 2013-05-15 20:26:47 UTC (rev 24394)
+++ packages/python-docutils/trunk/debian/changelog 2013-05-16 00:05:42 UTC (rev 24395)
@@ -8,8 +8,10 @@
(closes: #692286).
* Add patch (python3-pil-no-bytestrings.diff) not to pass byte strings to
PIL.Image.open() when running under Python 3.X (closes: #708159).
+ * Add patch (python3.3-odt-writer.diff) to port the ODT writer to Python 3.3
+ ElementTree API (closes: #692285).
- -- Jakub Wilk <jwilk at debian.org> Wed, 15 May 2013 22:14:41 +0200
+ -- Jakub Wilk <jwilk at debian.org> Thu, 16 May 2013 02:02:43 +0200
python-docutils (0.10-2) unstable; urgency=low
Added: packages/python-docutils/trunk/debian/patches/python3.3-odt-writer.diff
===================================================================
--- packages/python-docutils/trunk/debian/patches/python3.3-odt-writer.diff (rev 0)
+++ packages/python-docutils/trunk/debian/patches/python3.3-odt-writer.diff 2013-05-16 00:05:42 UTC (rev 24395)
@@ -0,0 +1,37 @@
+Description: port the ODT writer to Python 3.3 ElementTree API
+Author: Jakub Wilk <jwilk at debian.org>
+Bug: http://sourceforge.net/p/docutils/bugs/200/
+Bug-Debian: http://bugs.debian.org/692285
+Forwarded: no
+Last-Update: 2013-05-16
+
+--- a/docutils/writers/odf_odt/__init__.py
++++ b/docutils/writers/odf_odt/__init__.py
+@@ -88,16 +88,20 @@
+ # that support for the ability to get the parent of an element.
+ #
+ if WhichElementTree == 'elementtree':
+- class _ElementInterfaceWrapper(etree._ElementInterface):
++ import weakref
++ _parents = weakref.WeakKeyDictionary()
++ if isinstance(etree.Element, type):
++ _ElementInterface = etree.Element
++ else:
++ _ElementInterface = etree._ElementInterface
++ class _ElementInterfaceWrapper(_ElementInterface):
+ def __init__(self, tag, attrib=None):
+- etree._ElementInterface.__init__(self, tag, attrib)
+- if attrib is None:
+- attrib = {}
+- self.parent = None
++ _ElementInterface.__init__(self, tag, attrib)
++ _parents[self] = None
+ def setparent(self, parent):
+- self.parent = parent
++ _parents[self] = parent
+ def getparent(self):
+- return self.parent
++ return _parents[self]
+
+
+ #
Modified: packages/python-docutils/trunk/debian/patches/series
===================================================================
--- packages/python-docutils/trunk/debian/patches/series 2013-05-15 20:26:47 UTC (rev 24394)
+++ packages/python-docutils/trunk/debian/patches/series 2013-05-16 00:05:42 UTC (rev 24395)
@@ -1,5 +1,6 @@
strict-csv-parser.diff
python3-pil-no-bytestrings.diff
+python3.3-odt-writer.diff
math-output-html.diff
fix-buildhtml-progress.diff
iepngfix-license.diff
More information about the Python-modules-commits
mailing list