|
From: <gr...@us...> - 2019-08-19 20:05:58
|
Revision: 8316
http://sourceforge.net/p/docutils/code/8316
Author: grubert
Date: 2019-08-19 20:05:56 +0000 (Mon, 19 Aug 2019)
Log Message:
-----------
Add odt classifier test
Fix: xml.etree.ElementTree Element.getchildren deprecated warning
Modified Paths:
--------------
trunk/docutils/docutils/writers/odf_odt/__init__.py
trunk/docutils/test/test_writers/test_odt.py
Added Paths:
-----------
trunk/docutils/test/functional/expected/odt_classifier.odt
trunk/docutils/test/functional/input/odt_classifier.txt
Modified: trunk/docutils/docutils/writers/odf_odt/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/odf_odt/__init__.py 2019-08-19 19:41:38 UTC (rev 8315)
+++ trunk/docutils/docutils/writers/odf_odt/__init__.py 2019-08-19 20:05:56 UTC (rev 8316)
@@ -1938,9 +1938,8 @@
self.bumped_list_level_stack.pop()
def visit_classifier(self, node):
- els = self.current_element.getchildren()
- if len(els) > 0:
- el = els[-1]
+ if len(self.current_element) > 0:
+ el = self.current_element[-1]
el1 = SubElement(
el, 'text:span',
attrib={'text:style-name': self.rststyle('emphasis')})
Added: trunk/docutils/test/functional/expected/odt_classifier.odt
===================================================================
(Binary files differ)
Index: trunk/docutils/test/functional/expected/odt_classifier.odt
===================================================================
--- trunk/docutils/test/functional/expected/odt_classifier.odt 2019-08-19 19:41:38 UTC (rev 8315)
+++ trunk/docutils/test/functional/expected/odt_classifier.odt 2019-08-19 20:05:56 UTC (rev 8316)
Property changes on: trunk/docutils/test/functional/expected/odt_classifier.odt
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/docutils/test/functional/input/odt_classifier.txt
===================================================================
--- trunk/docutils/test/functional/input/odt_classifier.txt (rev 0)
+++ trunk/docutils/test/functional/input/odt_classifier.txt 2019-08-19 20:05:56 UTC (rev 8316)
@@ -0,0 +1,13 @@
+Definition Lists
+----------------
+
+Term
+ Definition
+Term : classifier
+ Definition paragraph 1.
+
+ Definition paragraph 2.
+Term
+ Definition
+
+
Property changes on: trunk/docutils/test/functional/input/odt_classifier.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Modified: trunk/docutils/test/test_writers/test_odt.py
===================================================================
--- trunk/docutils/test/test_writers/test_odt.py 2019-08-19 19:41:38 UTC (rev 8315)
+++ trunk/docutils/test/test_writers/test_odt.py 2019-08-19 20:05:56 UTC (rev 8316)
@@ -202,6 +202,9 @@
def test_odt_contents(self):
self.process_test('odt_contents.txt', 'odt_contents.odt')
+ def test_odt_classifier(self):
+ self.process_test('odt_classifier.txt', 'odt_classifier.odt')
+
#
# Template for new tests.
# Also add functional/input/odt_xxxx.txt and
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|