Merge lp:~mitya57/ubuntu/quantal/python-docutils/resync into lp:ubuntu/quantal/python-docutils

Proposed by Dimitri John Ledkov
Status: Merged
Merged at revision: 23
Proposed branch: lp:~mitya57/ubuntu/quantal/python-docutils/resync
Merge into: lp:ubuntu/quantal/python-docutils
Diff against target: 1327 lines (+747/-292)
26 files modified
.pc/.quilt_patches (+1/-0)
.pc/.quilt_series (+1/-0)
.pc/applied-patches (+3/-1)
.pc/disable-DocutilsXMLTestCase.diff/test/test_writers/test_docutils_xml.py (+0/-85)
.pc/fix-docutilsxmltestcase-debian.diff/test/test_writers/test_docutils_xml.py (+107/-0)
.pc/fix-docutilsxmltestcase.diff/test/test_writers/test_docutils_xml.py (+85/-0)
.pc/no-test-skipping.diff/test/test_writers/test_odt.py (+185/-0)
debian/changelog (+72/-1)
debian/control (+6/-16)
debian/copyright (+2/-3)
debian/docutils-common.install (+1/-1)
debian/patches/add-missing-import.diff (+2/-2)
debian/patches/disable-DocutilsXMLTestCase.diff (+0/-90)
debian/patches/fix-docutilsxmltestcase-debian.diff (+26/-0)
debian/patches/fix-docutilsxmltestcase.diff (+62/-0)
debian/patches/fix-error-reporting-encoding-issues.diff (+2/-2)
debian/patches/fix-io-encoding-issues.diff (+2/-2)
debian/patches/no-test-skipping.diff (+17/-0)
debian/patches/series (+3/-1)
debian/patches/testall-no-stdout-stderr-redirect.diff (+1/-1)
debian/python-docutils.postinst (+0/-13)
debian/rst2odt_prepstyles.sgml (+0/-62)
debian/rst2odt_prepstyles.txt (+38/-0)
debian/rules (+15/-12)
test/test_writers/test_docutils_xml.py (+115/-0)
test/test_writers/test_odt.py (+1/-0)
To merge this branch: bzr merge lp:~mitya57/ubuntu/quantal/python-docutils/resync
Reviewer Review Type Date Requested Status
Dimitri John Ledkov Needs Fixing
Ubuntu branches Pending
Review via email: mp+120280@code.launchpad.net

Description of the change

When branch is ready, please propose it for merging.

To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Here is the review of your proposed changes:
* Now that the test is fixed, disable-DocutilsXMLTestCase.diff patch should be dropped from debian/patches/series
* docbook-to-man has been dropped in Debian (see changelog), it should be dropped in debian/control
* there conflict markers debian/changelog, did you merge lp:debian/docutils into lp:ubuntu/docutils when you were preparing the merge?

review: Needs Fixing
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

$ bzr init-repo python-docutils
$ cd python-docutils
$ bzr branch lp:ubuntu/python-docutils ubuntu
$ bzr branch lp:debian/python-docutils debian
$ cd debian
$ bzr merge ../ubuntu

Is how I start merges. This has a better chance of not loosing ubuntu changes & making sure it will be possible to merge it back into lp:ubuntu/package without conflicts.

23. By Dmitry Shachnev

Merge lp:ubuntu/python-docutils

This adds missing entry in debian/control and bumps python-all build-dependency
to the required ">= 2.6.6-3~" value

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

All conflicts resolved now.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.pc/.quilt_patches'
2--- .pc/.quilt_patches 1970-01-01 00:00:00 +0000
3+++ .pc/.quilt_patches 2012-08-19 07:58:22 +0000
4@@ -0,0 +1,1 @@
5+debian/patches
6
7=== added file '.pc/.quilt_series'
8--- .pc/.quilt_series 1970-01-01 00:00:00 +0000
9+++ .pc/.quilt_series 2012-08-19 07:58:22 +0000
10@@ -0,0 +1,1 @@
11+series
12
13=== modified file '.pc/applied-patches'
14--- .pc/applied-patches 2011-12-17 14:11:08 +0000
15+++ .pc/applied-patches 2012-08-19 07:58:22 +0000
16@@ -9,5 +9,7 @@
17 add-missing-import.diff
18 fix-error-reporting-encoding-issues.diff
19 fix-io-encoding-issues.diff
20+fix-docutilsxmltestcase.diff
21+fix-docutilsxmltestcase-debian.diff
22+no-test-skipping.diff
23 move-data-to-usr-share.diff
24-disable-DocutilsXMLTestCase.diff
25
26=== removed directory '.pc/disable-DocutilsXMLTestCase.diff'
27=== removed directory '.pc/disable-DocutilsXMLTestCase.diff/test'
28=== removed directory '.pc/disable-DocutilsXMLTestCase.diff/test/test_writers'
29=== removed file '.pc/disable-DocutilsXMLTestCase.diff/test/test_writers/test_docutils_xml.py'
30--- .pc/disable-DocutilsXMLTestCase.diff/test/test_writers/test_docutils_xml.py 2011-12-17 14:11:08 +0000
31+++ .pc/disable-DocutilsXMLTestCase.diff/test/test_writers/test_docutils_xml.py 1970-01-01 00:00:00 +0000
32@@ -1,85 +0,0 @@
33-#!/usr/bin/env python
34-
35-# $Id: test_docutils_xml.py 5889 2009-04-01 20:00:21Z gbrandl $
36-# Author: Lea Wiemann <LeWiemann@gmail.com>
37-# Copyright: This module has been placed in the public domain.
38-
39-"""
40-Test for docutils XML writer.
41-"""
42-
43-from __init__ import DocutilsTestSupport
44-
45-import docutils
46-import docutils.core
47-from docutils._compat import b
48-
49-
50-class DocutilsXMLTestCase(DocutilsTestSupport.StandardTestCase):
51-
52- input = b("""\
53-Test
54-
55-----------
56-
57-Test. \xc3\xa4\xc3\xb6\xc3\xbc\xe2\x82\xac""")
58- xmldecl = b('<?xml version="1.0" encoding="iso-8859-1"?>\n')
59- doctypedecl = b('<!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" "http://docutils.sourceforge.net/docs/ref/docutils.dtd">\n')
60- generatedby = b('<!-- Generated by Docutils %s -->\n' % docutils.__version__)
61- bodynormal = b('<document source="&lt;string&gt;"><paragraph>Test</paragraph><transition/><paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph></document>')
62- bodynewlines = b("""\
63-<document source="&lt;string&gt;">
64-<paragraph>
65-Test
66-</paragraph>
67-<transition/>
68-<paragraph>
69-Test. \xe4\xf6\xfc&#8364;
70-</paragraph>
71-</document>
72-""")
73- bodyindents = b("""\
74-<document source="&lt;string&gt;">
75- <paragraph>
76- Test
77- </paragraph>
78- <transition/>
79- <paragraph>
80- Test. \xe4\xf6\xfc&#8364;
81- </paragraph>
82-</document>
83-""")
84-
85- def test_publish(self):
86- settings = {'input_encoding': 'utf8',
87- 'output_encoding': 'iso-8859-1',
88- '_disable_config': 1}
89- for settings['newlines'] in 0, 1:
90- for settings['indents'] in 0, 1:
91- for settings['xml_declaration'] in 0, 1:
92- for settings['doctype_declaration'] in 0, 1:
93-
94- expected = b('')
95- if settings['xml_declaration']:
96- expected += self.xmldecl
97- if settings['doctype_declaration']:
98- expected += self.doctypedecl
99- expected += self.generatedby
100- if settings['indents']:
101- expected += self.bodyindents
102- elif settings['newlines']:
103- expected += self.bodynewlines
104- else:
105- expected += self.bodynormal
106-
107- self.assertEqual(docutils.core.publish_string
108- (source=self.input,
109- reader_name='standalone',
110- writer_name='docutils_xml',
111- settings_overrides=settings),
112- expected)
113-
114-
115-if __name__ == '__main__':
116- import unittest
117- unittest.main()
118
119=== added directory '.pc/fix-docutilsxmltestcase-debian.diff'
120=== added directory '.pc/fix-docutilsxmltestcase-debian.diff/test'
121=== added directory '.pc/fix-docutilsxmltestcase-debian.diff/test/test_writers'
122=== added file '.pc/fix-docutilsxmltestcase-debian.diff/test/test_writers/test_docutils_xml.py'
123--- .pc/fix-docutilsxmltestcase-debian.diff/test/test_writers/test_docutils_xml.py 1970-01-01 00:00:00 +0000
124+++ .pc/fix-docutilsxmltestcase-debian.diff/test/test_writers/test_docutils_xml.py 2012-08-19 07:58:22 +0000
125@@ -0,0 +1,107 @@
126+#!/usr/bin/env python
127+
128+# $Id: test_docutils_xml.py 5889 2009-04-01 20:00:21Z gbrandl $
129+# Author: Lea Wiemann <LeWiemann@gmail.com>
130+# Copyright: This module has been placed in the public domain.
131+
132+"""
133+Test for docutils XML writer.
134+"""
135+
136+from __init__ import DocutilsTestSupport
137+
138+import sys
139+import docutils
140+import docutils.core
141+from docutils._compat import b
142+
143+
144+class DocutilsXMLTestCase(DocutilsTestSupport.StandardTestCase):
145+
146+ input = b("""\
147+Test
148+
149+----------
150+
151+Test. \xc3\xa4\xc3\xb6\xc3\xbc\xe2\x82\xac""")
152+ xmldecl = b('<?xml version="1.0" encoding="iso-8859-1"?>\n')
153+ doctypedecl = b('<!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" "http://docutils.sourceforge.net/docs/ref/docutils.dtd">\n')
154+ generatedby = b('<!-- Generated by Docutils %s -->\n' % docutils.__version__)
155+ bodynormal = b('<document source="&lt;string&gt;"><paragraph>Test</paragraph><transition/><paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph></document>')
156+ bodynewlines = b("""\
157+<document source="&lt;string&gt;">
158+<paragraph>Test</paragraph>
159+<transition/>
160+<paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph>
161+</document>
162+""")
163+ bodynewlines_old = b("""\
164+<document source="&lt;string&gt;">
165+<paragraph>
166+Test
167+</paragraph>
168+<transition/>
169+<paragraph>
170+Test. \xe4\xf6\xfc&#8364;
171+</paragraph>
172+</document>
173+""")
174+ bodyindents = b("""\
175+<document source="&lt;string&gt;">
176+ <paragraph>Test</paragraph>
177+ <transition/>
178+ <paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph>
179+</document>
180+""")
181+ bodyindents_old = b("""\
182+<document source="&lt;string&gt;">
183+ <paragraph>
184+ Test
185+ </paragraph>
186+ <transition/>
187+ <paragraph>
188+ Test. \xe4\xf6\xfc&#8364;
189+ </paragraph>
190+</document>
191+""")
192+
193+ def test_publish(self):
194+ settings = {'input_encoding': 'utf8',
195+ 'output_encoding': 'iso-8859-1',
196+ '_disable_config': 1}
197+ for settings['newlines'] in 0, 1:
198+ for settings['indents'] in 0, 1:
199+ for settings['xml_declaration'] in 0, 1:
200+ for settings['doctype_declaration'] in 0, 1:
201+
202+ expected = b('')
203+ if settings['xml_declaration']:
204+ expected += self.xmldecl
205+ if settings['doctype_declaration']:
206+ expected += self.doctypedecl
207+ expected += self.generatedby
208+ if settings['indents']:
209+ expected += self.bodyindents
210+ elif settings['newlines']:
211+ expected += self.bodynewlines
212+ else:
213+ expected += self.bodynormal
214+
215+ self.assertEqual(docutils.core.publish_string
216+ (source=self.input,
217+ reader_name='standalone',
218+ writer_name='docutils_xml',
219+ settings_overrides=settings),
220+ expected)
221+
222+ # New formatting introduced in versions 2.7.3 and 3.2.3 on 2011-11-18
223+ # to fix http://bugs.python.org/issue4147
224+ if (sys.version_info < (2, 7, 3) or
225+ sys.version_info[0] == 3 and sys.version_info < (3, 2, 3)):
226+ bodynewlines = bodynewlines_old
227+ bodyindents = bodyindents_old
228+
229+
230+if __name__ == '__main__':
231+ import unittest
232+ unittest.main()
233
234=== added directory '.pc/fix-docutilsxmltestcase.diff'
235=== added directory '.pc/fix-docutilsxmltestcase.diff/test'
236=== added directory '.pc/fix-docutilsxmltestcase.diff/test/test_writers'
237=== added file '.pc/fix-docutilsxmltestcase.diff/test/test_writers/test_docutils_xml.py'
238--- .pc/fix-docutilsxmltestcase.diff/test/test_writers/test_docutils_xml.py 1970-01-01 00:00:00 +0000
239+++ .pc/fix-docutilsxmltestcase.diff/test/test_writers/test_docutils_xml.py 2012-08-19 07:58:22 +0000
240@@ -0,0 +1,85 @@
241+#!/usr/bin/env python
242+
243+# $Id: test_docutils_xml.py 5889 2009-04-01 20:00:21Z gbrandl $
244+# Author: Lea Wiemann <LeWiemann@gmail.com>
245+# Copyright: This module has been placed in the public domain.
246+
247+"""
248+Test for docutils XML writer.
249+"""
250+
251+from __init__ import DocutilsTestSupport
252+
253+import docutils
254+import docutils.core
255+from docutils._compat import b
256+
257+
258+class DocutilsXMLTestCase(DocutilsTestSupport.StandardTestCase):
259+
260+ input = b("""\
261+Test
262+
263+----------
264+
265+Test. \xc3\xa4\xc3\xb6\xc3\xbc\xe2\x82\xac""")
266+ xmldecl = b('<?xml version="1.0" encoding="iso-8859-1"?>\n')
267+ doctypedecl = b('<!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" "http://docutils.sourceforge.net/docs/ref/docutils.dtd">\n')
268+ generatedby = b('<!-- Generated by Docutils %s -->\n' % docutils.__version__)
269+ bodynormal = b('<document source="&lt;string&gt;"><paragraph>Test</paragraph><transition/><paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph></document>')
270+ bodynewlines = b("""\
271+<document source="&lt;string&gt;">
272+<paragraph>
273+Test
274+</paragraph>
275+<transition/>
276+<paragraph>
277+Test. \xe4\xf6\xfc&#8364;
278+</paragraph>
279+</document>
280+""")
281+ bodyindents = b("""\
282+<document source="&lt;string&gt;">
283+ <paragraph>
284+ Test
285+ </paragraph>
286+ <transition/>
287+ <paragraph>
288+ Test. \xe4\xf6\xfc&#8364;
289+ </paragraph>
290+</document>
291+""")
292+
293+ def test_publish(self):
294+ settings = {'input_encoding': 'utf8',
295+ 'output_encoding': 'iso-8859-1',
296+ '_disable_config': 1}
297+ for settings['newlines'] in 0, 1:
298+ for settings['indents'] in 0, 1:
299+ for settings['xml_declaration'] in 0, 1:
300+ for settings['doctype_declaration'] in 0, 1:
301+
302+ expected = b('')
303+ if settings['xml_declaration']:
304+ expected += self.xmldecl
305+ if settings['doctype_declaration']:
306+ expected += self.doctypedecl
307+ expected += self.generatedby
308+ if settings['indents']:
309+ expected += self.bodyindents
310+ elif settings['newlines']:
311+ expected += self.bodynewlines
312+ else:
313+ expected += self.bodynormal
314+
315+ self.assertEqual(docutils.core.publish_string
316+ (source=self.input,
317+ reader_name='standalone',
318+ writer_name='docutils_xml',
319+ settings_overrides=settings),
320+ expected)
321+
322+
323+if __name__ == '__main__':
324+ import unittest
325+ unittest.main()
326
327=== added directory '.pc/no-test-skipping.diff'
328=== added directory '.pc/no-test-skipping.diff/test'
329=== added directory '.pc/no-test-skipping.diff/test/test_writers'
330=== added file '.pc/no-test-skipping.diff/test/test_writers/test_odt.py'
331--- .pc/no-test-skipping.diff/test/test_writers/test_odt.py 1970-01-01 00:00:00 +0000
332+++ .pc/no-test-skipping.diff/test/test_writers/test_odt.py 2012-08-19 07:58:22 +0000
333@@ -0,0 +1,185 @@
334+#!/usr/bin/env python
335+
336+# $Id: test_odt.py 6989 2011-03-04 23:44:32Z dkuhlman $
337+# Author: Dave Kuhlman <dkuhlman@rexx.com>
338+# Copyright: This module has been placed in the public domain.
339+
340+"""
341+Tests for docutils odtwriter.
342+
343+Instructions for adding a new test:
344+
345+1. Add a new method to class DocutilsOdtTestCase (below) named
346+ test_odt_xxxx, where xxxx describes your new feature. See
347+ test_odt_basic for an example.
348+
349+2. Add a new input reST (.txt) file in test/functional/input. This
350+ file should contain the smallest amount of reST that tests your
351+ new feature. Name this file odt_xxxx.txt.
352+
353+3. Convert your input reST (.txt) file to an ODF (.odt) file using
354+ rst2odt.py. Place this ODF (.odt) file in
355+ test/functional/expected. Name this file odt_xxxx.odt.
356+ You can also pass parameter save_output_name='filename' to method
357+ process_test() in order to produce expected output.
358+ See and modify variable TEMP_FILE_PATH for destination.
359+
360+4. Run your test. Your new test should pass.
361+
362+5. If any other tests fail, that's a possible regression.
363+
364+"""
365+
366+import sys
367+import os
368+import StringIO
369+import zipfile
370+from xml.dom import minidom
371+import tempfile
372+
373+from __init__ import DocutilsTestSupport
374+
375+import docutils
376+import docutils.core
377+from docutils._compat import BytesIO
378+
379+#
380+# Globals
381+TEMP_FILE_PATH = '/tmp'
382+INPUT_PATH = 'functional/input/'
383+EXPECTED_PATH = 'functional/expected/'
384+
385+
386+class DocutilsOdtTestCase(DocutilsTestSupport.StandardTestCase):
387+
388+ #
389+ # Check to see if we can import the needed XML library.
390+ # Report failure if we cannot.
391+ def check_import(self):
392+ WhichElementTree = ''
393+ try:
394+ # 1. Try to use lxml.
395+ #from lxml import etree
396+ #WhichElementTree = 'lxml'
397+ raise ImportError('Ignoring lxml')
398+ except ImportError, e:
399+ try:
400+ # 2. Try to use ElementTree from the Python standard library.
401+ from xml.etree import ElementTree as etree
402+ WhichElementTree = 'elementtree'
403+ except ImportError, e:
404+ try:
405+ # 3. Try to use a version of ElementTree installed as a separate
406+ # product.
407+ from elementtree import ElementTree as etree
408+ WhichElementTree = 'elementtree'
409+ except ImportError, e:
410+ s1 = '\nSkipped test of odf_odt writer. ' \
411+ 'In order to test odf_odt writer ' \
412+ 'must install either a version of Python containing ' \
413+ 'ElementTree (Python version >=2.5) or ' \
414+ 'install ElementTree.\n\n'
415+ #self.fail(s1)
416+ sys.stderr.write(s1)
417+ return WhichElementTree
418+
419+ def process_test(self, input_filename, expected_filename,
420+ save_output_name=None, settings_overrides=None):
421+ if not self.check_import():
422+ return
423+ # Test that xmlcharrefreplace is the default output encoding
424+ # error handler.
425+ input_file = open(INPUT_PATH + input_filename, 'rb')
426+ expected_file = open(EXPECTED_PATH + expected_filename, 'rb')
427+ input = input_file.read()
428+ expected = expected_file.read()
429+ input_file.close()
430+ expected_file.close()
431+ if settings_overrides is None:
432+ settings_overrides={ }
433+ result = docutils.core.publish_string(
434+ source=input,
435+ reader_name='standalone',
436+ writer_name='odf_odt',
437+ settings_overrides=settings_overrides)
438+## msg = 'file length not equal: expected length: %d actual length: %d' % (
439+## len(expected), len(result), )
440+## self.assertEqual(str(len(result)), str(len(expected)))
441+ if save_output_name:
442+ filename = '%s%s%s' % (TEMP_FILE_PATH, os.sep, save_output_name,)
443+ outfile = open(filename, 'w')
444+ outfile.write(result)
445+ outfile.close()
446+ content1 = self.extract_file(result, 'content.xml')
447+ content2 = self.extract_file(expected, 'content.xml')
448+ msg = 'content.xml not equal: expected len: %d actual len: %d' % (
449+ len(content2), len(content1), )
450+ self.assertEqual(content1, content2, msg)
451+
452+ def extract_file(self, payload, filename):
453+ payloadfile = BytesIO()
454+ payloadfile.write(payload)
455+ payloadfile.seek(0)
456+ zfile = zipfile.ZipFile(payloadfile, 'r')
457+ content1 = zfile.read(filename)
458+ doc = minidom.parseString(content1)
459+ #content2 = doc.toprettyxml(indent=' ')
460+ content2 = doc.toxml()
461+ return content2
462+
463+ def assertEqual(self, first, second, msg=None):
464+ if msg is None:
465+ msg2 = msg
466+ else:
467+ sep = '+' * 60
468+ msg1 = '\n%s\nresult:\n%s\n%s\nexpected:\n%s\n%s' % (
469+ sep, first, sep, second, sep, )
470+ #msg2 = '%s\n%s' % (msg1, msg, )
471+ msg2 = '%s' % (msg, )
472+ DocutilsTestSupport.StandardTestCase.failUnlessEqual(self,
473+ first, second, msg2)
474+
475+ #
476+ # Unit test methods
477+ #
478+ # All test methods should be named "test_odt_xxxx", where
479+ # xxxx is replaced with a name for the new test.
480+ # See instructions above in module doc-string.
481+ #
482+
483+ def test_odt_basic(self):
484+ self.process_test('odt_basic.txt', 'odt_basic.odt',
485+ #save_output_name='odt_basic.odt'
486+ )
487+
488+ def test_odt_tables1(self):
489+ self.process_test('odt_tables1.txt', 'odt_tables1.odt',
490+ #save_output_name='odt_tables1.odt'
491+ )
492+
493+ def test_odt_custom_headfoot(self):
494+ settings_overrides = {
495+ 'custom_header': 'Page %p% of %P%',
496+ 'custom_footer': 'Title: %t% Date: %d3% Time: %t4%',
497+ }
498+ self.process_test('odt_custom_headfoot.txt', 'odt_custom_headfoot.odt',
499+ settings_overrides=settings_overrides,
500+ #save_output_name='odt_custom_headfoot.odt'
501+ )
502+
503+ #
504+ # Template for new tests.
505+ # Also add functional/input/odt_xxxx.txt and
506+ # functional/expected/odt_xxxx.odt
507+ # Replace all xxxx with name of your test.
508+ #
509+## def test_odt_xxxx(self):
510+## self.process_test('odt_xxxx.txt', 'odt_xxxx.odt')
511+
512+
513+# -----------------------------------------------------------------
514+
515+
516+if __name__ == '__main__':
517+ import unittest
518+ unittest.main()
519
520=== modified file 'debian/changelog'
521--- debian/changelog 2011-12-17 14:11:08 +0000
522+++ debian/changelog 2012-08-19 07:58:22 +0000
523@@ -1,3 +1,74 @@
524+python-docutils (0.8.1-8ubuntu1) quantal; urgency=low
525+
526+ * Resynchronize with Debian unstable (LP: #1038470), remaining change:
527+ - Use dh_python2 instead of dh_pysupport
528+
529+ -- Dmitry Shachnev <mitya57@gmail.com> Sat, 18 Aug 2012 20:16:07 +0400
530+
531+python-docutils (0.8.1-8) unstable; urgency=low
532+
533+ * Install all DTD files (really closes: #531170).
534+
535+ -- Jakub Wilk <jwilk@debian.org> Wed, 04 Jul 2012 14:07:30 +0200
536+
537+python-docutils (0.8.1-7) unstable; urgency=low
538+
539+ * Rebuild against debhelper (>= 9.20120528) to fix postinst that
540+ unconditionally overwrites files in /etc (see: #477751, closes: #675489).
541+ Thanks to Helmut Grohne for the bug report.
542+
543+ -- Jakub Wilk <jwilk@debian.org> Fri, 01 Jun 2012 18:20:46 +0200
544+
545+python-docutils (0.8.1-6) unstable; urgency=low
546+
547+ * Fix a typo in a patch description.
548+ * Bump standards version to 3.9.3 (no changes needed).
549+ * Don't mention “Dive Into Python” in python*-roman package descriptions
550+ (closes: #661555). Thanks to Konrad Schöbel for the bug report.
551+ * Remove references to http://diveintopython.org/ from debian/copyright.
552+ * Do not skip tests because of failed imports, as they should never happen.
553+ (no-test-skipping.diff)
554+ * Check only *.py files when looking for unguarded use of __file__.
555+ * Fix paths in the auto-generated manual pages.
556+ * Split section “Usage” into “Synopsis” and “Description” in the manual
557+ pages.
558+ * Fool DocutilsXMLTestCase into thinking that Python version is 2.7.3/3.2.3
559+ when it's in fact 2.7.2/3.2.2 with patched
560+ xml.dom.minidom.Document.toprettyxml() method (closes: #645369).
561+ (fix-docutilsxmltestcase.diff).
562+
563+ -- Jakub Wilk <jwilk@debian.org> Sat, 03 Mar 2012 01:40:35 +0100
564+
565+python-docutils (0.8.1-5) unstable; urgency=low
566+
567+ [ Simon McVittie ]
568+ * Remove myself from Uploaders
569+
570+ [ Jakub Wilk ]
571+ * Backport upstream patch to follow the changes in the
572+ xml.dom.minidom.Document.toprettyxml method
573+ (fix-docutilsxmltestcase.diff).
574+ * Drop postinst snippet to deal with a python-support bug (it cannot replace
575+ directory with a regular file). It was needed only for 0.7 upgrades.
576+ * Suggest fonts-linuxlibertine as an alternative to ttf-linux-libertine.
577+ * Update David Goodger's e-mail address in debian/copyright
578+ (closes: #653769). Thanks to Jari Aalto for the bug report.
579+ * Update Subversion repository URLs in patch headers (so that they point to
580+ SourceForge rather than BerliOS).
581+ * Use xargs to iterate over all Python versions.
582+ * Convert rst2odt_prepstyles manpage source from DocBook to
583+ reStructuredText.
584+ + Remove docbook-to-man from Build-Depends-Indep.
585+ + Update debian/rules.
586+ * Don't run dh_testroot in the clean target. There's a good chance that root
587+ privileges are not needed (e.g. because binary target was run under
588+ fakeroot), and even if they are actually needed, the target will fail
589+ quickly.
590+ * Drop obsolete virtual package: docutils-writer-manpage (closes: #631066).
591+ * Run tests with --verbose.
592+
593+ -- Jakub Wilk <jwilk@debian.org> Wed, 15 Feb 2012 19:21:26 +0100
594+
595 python-docutils (0.8.1-4ubuntu1) precise; urgency=low
596
597 * Build using dh_python2
598@@ -9,7 +80,7 @@
599 python-docutils (0.8.1-4) unstable; urgency=low
600
601 * When running the test suite, don't copy stdout and stderr output to a log
602- file, as this would break under LC_ALL=C, PYTHONWARNING=d and python3.X
603+ file, as this would break under LC_ALL=C, PYTHONWARNINGS=d and python3.X
604 (testall-no-stdout-stderr-redirect.diff).
605 * Use build/py2 and build/py3 for build directories.
606 * Remove excessive whitespace from debian/control.
607
608=== modified file 'debian/control'
609--- debian/control 2011-12-17 14:11:08 +0000
610+++ debian/control 2012-08-19 07:58:22 +0000
611@@ -1,26 +1,24 @@
612 Source: python-docutils
613 Section: python
614 Priority: optional
615-Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
616+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
617+XSBC-Original-Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
618 Uploaders: Jakub Wilk <jwilk@debian.org>,
619 martin f. krafft <madduck@debian.org>,
620- Simon McVittie <smcv@debian.org>,
621 Michael Schutte <michi@uiae.at>,
622 Ben Finney <ben+debian@benfinney.id.au>
623 Build-Depends: debhelper (>= 7)
624 Build-Depends-Indep: python-all (>= 2.6.6-3~),
625 python3-all (>= 3.1.2-7~),
626- docbook-to-man,
627 xml-core
628-Standards-Version: 3.9.2
629+Standards-Version: 3.9.3
630 X-Python-Version: >= 2.3
631 Vcs-Svn: svn://svn.debian.org/python-modules/packages/python-docutils/trunk/
632 Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/python-docutils/trunk/
633 Homepage: http://docutils.sourceforge.net/
634
635 Package: python-docutils
636-Provides: docutils,
637- docutils-writer-manpage
638+Provides: docutils
639 Architecture: all
640 Depends: ${misc:Depends}, ${python:Depends},
641 python-roman,
642@@ -30,7 +28,7 @@
643 libpaper-utils,
644 python-lxml,
645 docutils-doc (= ${source:Version})
646-Suggests: texlive-latex-recommended, texlive-latex-base, texlive-lang-french, ttf-linux-libertine
647+Suggests: texlive-latex-recommended, texlive-latex-base, texlive-lang-french, fonts-linuxlibertine | ttf-linux-libertine
648 Conflicts: python-odtwriter,
649 docutils-writer-odt
650 Replaces: python-odtwriter,
651@@ -61,7 +59,7 @@
652 Conflicts: python-docutils (<< 0.7-3~),
653 python-odtwriter,
654 docutils-writer-odt
655-Suggests: texlive-latex-recommended, texlive-latex-base, texlive-lang-french, docutils-doc, ttf-linux-libertine
656+Suggests: texlive-latex-recommended, texlive-latex-base, texlive-lang-french, fonts-linuxlibertine | ttf-linux-libertine, docutils-doc
657 Description: text processing system for reStructuredText (implemented in Python 3)
658 reStructuredText is an easy-to-read, what-you-see-is-what-you-get plaintext
659 markup syntax and parser system. It is useful for in-line program documentation
660@@ -122,10 +120,6 @@
661 from 1 to 4999 and understands the common shortcuts (IX == 9), but not
662 illegal ones (MIM == 1999).
663 .
664- This module is part of "Dive Into Python", a free Python tutorial for
665- experienced programmers. Visit http://diveintopython.org/ for the
666- latest version.
667- .
668 This package includes Python 2 modules.
669
670 Package: python3-roman
671@@ -136,8 +130,4 @@
672 from 1 to 4999 and understands the common shortcuts (IX == 9), but not
673 illegal ones (MIM == 1999).
674 .
675- This module is part of "Dive Into Python", a free Python tutorial for
676- experienced programmers. Visit http://diveintopython.org/ for the
677- latest version.
678- .
679 This package includes Python 3 modules.
680
681=== modified file 'debian/copyright'
682--- debian/copyright 2011-09-03 01:32:29 +0000
683+++ debian/copyright 2012-08-19 07:58:22 +0000
684@@ -11,7 +11,7 @@
685
686 It was downloaded from http://docutils.sourceforge.net/
687
688-Upstream Author: David Goodger <goodger@users.sourceforge.net>
689+Upstream Author: David Goodger <goodger@python.org>
690
691 Most of the files included in this project have been placed in the public
692 domain, and therefore have no license requirements and no restrictions on
693@@ -146,8 +146,7 @@
694 Copyright © 2001 Mark Pilgrim
695
696 This program is part of "Dive Into Python", a free Python tutorial for
697- experienced programmers. Visit http://diveintopython.org/ for the
698- latest version.
699+ experienced programmers.
700
701 This program is free software; you can redistribute it and/or modify
702 it under the terms of the Python 2.1.1 license, available at
703
704=== modified file 'debian/docutils-common.install'
705--- debian/docutils-common.install 2011-08-22 18:50:14 +0000
706+++ debian/docutils-common.install 2012-08-19 07:58:22 +0000
707@@ -1,4 +1,4 @@
708 /usr/share/docutils/
709 tools/editors/emacs/rst.el usr/share/emacs/site-lisp
710 debian/50python-docutils.el etc/emacs/site-start.d
711-docs/ref/docutils.dtd usr/share/xml/docutils/
712+docs/ref/*.dtd usr/share/xml/docutils/
713
714=== modified file 'debian/patches/add-missing-import.diff'
715--- debian/patches/add-missing-import.diff 2011-10-23 22:59:02 +0000
716+++ debian/patches/add-missing-import.diff 2012-08-19 07:58:22 +0000
717@@ -1,6 +1,6 @@
718 Description: Add missing import.
719-Origin: upstream, http://svn.berlios.de/viewvc/docutils/trunk/docutils/docutils/frontend.py?r1=7071&r2=7196
720-Last-Update: 2011-10-23
721+Origin: upstream, http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/docutils/frontend.py?r1=7071&r2=7196
722+Last-Update: 2011-12-31
723
724 --- a/docutils/frontend.py
725 +++ b/docutils/frontend.py
726
727=== removed file 'debian/patches/disable-DocutilsXMLTestCase.diff'
728--- debian/patches/disable-DocutilsXMLTestCase.diff 2011-12-17 14:11:08 +0000
729+++ debian/patches/disable-DocutilsXMLTestCase.diff 1970-01-01 00:00:00 +0000
730@@ -1,90 +0,0 @@
731-Index: python-docutils-0.8.1/test/test_writers/test_docutils_xml.py
732-===================================================================
733---- python-docutils-0.8.1.orig/test/test_writers/test_docutils_xml.py 2009-04-01 20:00:21.000000000 +0000
734-+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
735-@@ -1,85 +0,0 @@
736--#!/usr/bin/env python
737--
738--# $Id: test_docutils_xml.py 5889 2009-04-01 20:00:21Z gbrandl $
739--# Author: Lea Wiemann <LeWiemann@gmail.com>
740--# Copyright: This module has been placed in the public domain.
741--
742--"""
743--Test for docutils XML writer.
744--"""
745--
746--from __init__ import DocutilsTestSupport
747--
748--import docutils
749--import docutils.core
750--from docutils._compat import b
751--
752--
753--class DocutilsXMLTestCase(DocutilsTestSupport.StandardTestCase):
754--
755-- input = b("""\
756--Test
757--
758------------
759--
760--Test. \xc3\xa4\xc3\xb6\xc3\xbc\xe2\x82\xac""")
761-- xmldecl = b('<?xml version="1.0" encoding="iso-8859-1"?>\n')
762-- doctypedecl = b('<!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" "http://docutils.sourceforge.net/docs/ref/docutils.dtd">\n')
763-- generatedby = b('<!-- Generated by Docutils %s -->\n' % docutils.__version__)
764-- bodynormal = b('<document source="&lt;string&gt;"><paragraph>Test</paragraph><transition/><paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph></document>')
765-- bodynewlines = b("""\
766--<document source="&lt;string&gt;">
767--<paragraph>
768--Test
769--</paragraph>
770--<transition/>
771--<paragraph>
772--Test. \xe4\xf6\xfc&#8364;
773--</paragraph>
774--</document>
775--""")
776-- bodyindents = b("""\
777--<document source="&lt;string&gt;">
778-- <paragraph>
779-- Test
780-- </paragraph>
781-- <transition/>
782-- <paragraph>
783-- Test. \xe4\xf6\xfc&#8364;
784-- </paragraph>
785--</document>
786--""")
787--
788-- def test_publish(self):
789-- settings = {'input_encoding': 'utf8',
790-- 'output_encoding': 'iso-8859-1',
791-- '_disable_config': 1}
792-- for settings['newlines'] in 0, 1:
793-- for settings['indents'] in 0, 1:
794-- for settings['xml_declaration'] in 0, 1:
795-- for settings['doctype_declaration'] in 0, 1:
796--
797-- expected = b('')
798-- if settings['xml_declaration']:
799-- expected += self.xmldecl
800-- if settings['doctype_declaration']:
801-- expected += self.doctypedecl
802-- expected += self.generatedby
803-- if settings['indents']:
804-- expected += self.bodyindents
805-- elif settings['newlines']:
806-- expected += self.bodynewlines
807-- else:
808-- expected += self.bodynormal
809--
810-- self.assertEqual(docutils.core.publish_string
811-- (source=self.input,
812-- reader_name='standalone',
813-- writer_name='docutils_xml',
814-- settings_overrides=settings),
815-- expected)
816--
817--
818--if __name__ == '__main__':
819-- import unittest
820-- unittest.main()
821
822=== added file 'debian/patches/fix-docutilsxmltestcase-debian.diff'
823--- debian/patches/fix-docutilsxmltestcase-debian.diff 1970-01-01 00:00:00 +0000
824+++ debian/patches/fix-docutilsxmltestcase-debian.diff 2012-08-19 07:58:22 +0000
825@@ -0,0 +1,26 @@
826+Description: Forge sys.version_info for DocutilsXMLTestCase.
827+ Fool DocutilsXMLTestCase into thinking that Python version is 2.7.3/3.2.3 when
828+ it's in fact 2.7.2/3.2.2 with patched xml.dom.minidom.Document.toprettyxml()
829+ method.
830+Author: Jakub Wilk <jwilk@debian.org>
831+Bug-Debian: http://bugs.debian.org/645369
832+Forwarded: not-needed
833+Last-Update: 2012-03-03
834+
835+--- a/test/test_writers/test_docutils_xml.py
836++++ b/test/test_writers/test_docutils_xml.py
837+@@ -15,6 +15,14 @@
838+ import docutils.core
839+ from docutils._compat import b
840+
841++if sys.version_info[:3] in [(2, 7, 2), (3, 2, 2)]:
842++ import xml.dom.minidom as minidom
843++ if minidom.parseString('<x><y>z</y></x>').toprettyxml() == '<?xml version="1.0" ?>\n<x>\n\t<y>z</y>\n</x>\n':
844++ sys_version_info = sys.version_info[:2] + (3, 'candidate', 0)
845++ class sys:
846++ version_info = sys_version_info
847++ del sys_version_info
848++ del minidom
849+
850+ class DocutilsXMLTestCase(DocutilsTestSupport.StandardTestCase):
851+
852
853=== added file 'debian/patches/fix-docutilsxmltestcase.diff'
854--- debian/patches/fix-docutilsxmltestcase.diff 1970-01-01 00:00:00 +0000
855+++ debian/patches/fix-docutilsxmltestcase.diff 2012-08-19 07:58:22 +0000
856@@ -0,0 +1,62 @@
857+Description: Follow the changes in xml.dom.minidom.Document.toprettyxml().
858+ xml.dom.minidom.Document.toprettyxml() has change behaviour in Python 2.7.3
859+ and 3.3.3. See http://bugs.python.org/issue4147 for details.
860+ .
861+ This patch updates DocutilsXMLTestCase to cope with these changes.
862+Origin: backport, http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/test/test_writers/test_docutils_xml.py?r1=7221&r2=7226
863+Bug: http://sourceforge.net/tracker/?func=detail&aid=3423983&group_id=38414&atid=422030
864+Bug-Debian: http://bugs.debian.org/645369
865+Last-Update: 2011-12-31
866+
867+--- a/test/test_writers/test_docutils_xml.py
868++++ b/test/test_writers/test_docutils_xml.py
869+@@ -10,6 +10,7 @@
870+
871+ from __init__ import DocutilsTestSupport
872+
873++import sys
874+ import docutils
875+ import docutils.core
876+ from docutils._compat import b
877+@@ -29,6 +30,13 @@
878+ bodynormal = b('<document source="&lt;string&gt;"><paragraph>Test</paragraph><transition/><paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph></document>')
879+ bodynewlines = b("""\
880+ <document source="&lt;string&gt;">
881++<paragraph>Test</paragraph>
882++<transition/>
883++<paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph>
884++</document>
885++""")
886++ bodynewlines_old = b("""\
887++<document source="&lt;string&gt;">
888+ <paragraph>
889+ Test
890+ </paragraph>
891+@@ -40,6 +48,13 @@
892+ """)
893+ bodyindents = b("""\
894+ <document source="&lt;string&gt;">
895++ <paragraph>Test</paragraph>
896++ <transition/>
897++ <paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph>
898++</document>
899++""")
900++ bodyindents_old = b("""\
901++<document source="&lt;string&gt;">
902+ <paragraph>
903+ Test
904+ </paragraph>
905+@@ -79,6 +94,13 @@
906+ settings_overrides=settings),
907+ expected)
908+
909++ # New formatting introduced in versions 2.7.3 and 3.2.3 on 2011-11-18
910++ # to fix http://bugs.python.org/issue4147
911++ if (sys.version_info < (2, 7, 3) or
912++ sys.version_info[0] == 3 and sys.version_info < (3, 2, 3)):
913++ bodynewlines = bodynewlines_old
914++ bodyindents = bodyindents_old
915++
916+
917+ if __name__ == '__main__':
918+ import unittest
919
920=== modified file 'debian/patches/fix-error-reporting-encoding-issues.diff'
921--- debian/patches/fix-error-reporting-encoding-issues.diff 2011-10-23 22:59:02 +0000
922+++ debian/patches/fix-error-reporting-encoding-issues.diff 2012-08-19 07:58:22 +0000
923@@ -1,6 +1,6 @@
924 Description: Fix encoding issues in error reporting for Python 3.
925-Origin: upstream, http://svn.berlios.de/viewvc/docutils/trunk/docutils/docutils/error_reporting.py?r1=7073&r2=7196
926-Last-Update: 2011-10-23
927+Origin: upstream, http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/docutils/error_reporting.py?r1=7073&r2=7196
928+Last-Update: 2011-12-31
929
930 --- a/docutils/error_reporting.py
931 +++ b/docutils/error_reporting.py
932
933=== modified file 'debian/patches/fix-io-encoding-issues.diff'
934--- debian/patches/fix-io-encoding-issues.diff 2011-10-23 22:59:02 +0000
935+++ debian/patches/fix-io-encoding-issues.diff 2012-08-19 07:58:22 +0000
936@@ -1,7 +1,7 @@
937 Description: Fix encoding issues in file I/O for Python 3.
938 Bug: http://sourceforge.net/tracker/?func=detail&aid=3395948&group_id=38414&atid=422030
939-Origin: upstream, http://svn.berlios.de/viewvc/docutils/trunk/docutils/docutils/io.py?r1=7073&r2=7196
940-Last-Update: 2011-10-23
941+Origin: upstream, http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/docutils/io.py?r1=7073&r2=7196
942+Last-Update: 2011-12-31
943
944 --- a/docutils/io.py
945 +++ b/docutils/io.py
946
947=== added file 'debian/patches/no-test-skipping.diff'
948--- debian/patches/no-test-skipping.diff 1970-01-01 00:00:00 +0000
949+++ debian/patches/no-test-skipping.diff 2012-08-19 07:58:22 +0000
950@@ -0,0 +1,17 @@
951+Description: Do not skip tests.
952+ If Build-Depends are satisfied, importing ElementTree should not fail. If it
953+ does, it's better to fail than to skip the test silently.
954+Author: Jakub Wilk <jwilk@debian.org>
955+Forwarded: not-needed
956+Last-Update: 2012-03-02
957+
958+--- a/test/test_writers/test_odt.py
959++++ b/test/test_writers/test_odt.py
960+@@ -74,6 +74,7 @@
961+ from elementtree import ElementTree as etree
962+ WhichElementTree = 'elementtree'
963+ except ImportError, e:
964++ raise
965+ s1 = '\nSkipped test of odf_odt writer. ' \
966+ 'In order to test odf_odt writer ' \
967+ 'must install either a version of Python containing ' \
968
969=== modified file 'debian/patches/series'
970--- debian/patches/series 2011-12-17 14:11:08 +0000
971+++ debian/patches/series 2012-08-19 07:58:22 +0000
972@@ -9,5 +9,7 @@
973 add-missing-import.diff
974 fix-error-reporting-encoding-issues.diff
975 fix-io-encoding-issues.diff
976+fix-docutilsxmltestcase.diff
977+fix-docutilsxmltestcase-debian.diff
978+no-test-skipping.diff
979 move-data-to-usr-share.diff
980-disable-DocutilsXMLTestCase.diff
981
982=== modified file 'debian/patches/testall-no-stdout-stderr-redirect.diff'
983--- debian/patches/testall-no-stdout-stderr-redirect.diff 2011-10-23 22:59:02 +0000
984+++ debian/patches/testall-no-stdout-stderr-redirect.diff 2012-08-19 07:58:22 +0000
985@@ -1,6 +1,6 @@
986 Description: Don't copy test suite output to a log.
987 When running the test suite, don't copy stdout and stderr output to a log
988- file, as this would break under LC_ALL=C, PYTHONWARNING=d and python3.X.
989+ file, as this would break under LC_ALL=C, PYTHONWARNINGS=d and python3.X.
990 Author: Jakub Wilk <jwilk@debian.org>
991 Forwarded: not-needed
992 Last-Update: 2011-09-18
993
994=== modified file 'debian/python-docutils.postinst'
995--- debian/python-docutils.postinst 2011-06-28 20:43:04 +0000
996+++ debian/python-docutils.postinst 2012-08-19 07:58:22 +0000
997@@ -1,19 +1,6 @@
998 #!/bin/sh
999 set -e
1000
1001-# python-support prior to 1.0.14 doesn't correctly handle replacing directory
1002-# with a regular file. The following snippet works around this bug:
1003-if [ "$1" = configure ]
1004-then
1005- for pydir in /usr/lib/pymodules/python2.*/
1006- do
1007- if [ -d $pydir/docutils-0.7.egg-info/ ]
1008- then
1009- rm -rf $pydir/docutils-0.7.egg-info/
1010- fi
1011- done
1012-fi
1013-
1014 if [ "$1" = configure ]
1015 then
1016 for exe in /usr/share/docutils/scripts/python2/*
1017
1018=== removed file 'debian/rst2odt_prepstyles.sgml'
1019--- debian/rst2odt_prepstyles.sgml 2009-12-13 19:54:12 +0000
1020+++ debian/rst2odt_prepstyles.sgml 1970-01-01 00:00:00 +0000
1021@@ -1,62 +0,0 @@
1022-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.5//EN">
1023-<refentry id="rst2odt_prepstyles">
1024- <refmeta>
1025- <refentrytitle>rst2odt_prepstyles</refentrytitle>
1026- <manvolnum>1</manvolnum>
1027- <refmiscinfo class="date">July 2008</refmiscinfo>
1028- <refmiscinfo class="source"></refmiscinfo>
1029- <refmiscinfo class="title">odtwriter</refmiscinfo>
1030- </refmeta>
1031-
1032- <refnamediv>
1033- <refname>rst2odt_prepstyles</refname>
1034- <refpurpose>strip paper size specifications off of rst2odt stylesheets</refpurpose>
1035- </refnamediv>
1036-
1037- <refsynopsisdiv>
1038- <cmdsynopsis>
1039- <command>rst2odt_prepstyles</command>
1040- <arg choice="req"><replaceable>FILE</replaceable></arg>
1041- </cmdsynopsis>
1042- </refsynopsisdiv>
1043-
1044- <refsect1>
1045- <title>DESCRIPTION</title>
1046-
1047- <para>
1048- <command>rst2odt(1)</command> uses a stylesheet file as a template
1049- for the ODT files it creates. The stock
1050- <filename>styles.odt</filename> file shipped with it comes without
1051- page dimensions. When <command>rst2odt</command> is run and
1052- detects that there no paper size is given in the stylesheet, it is
1053- automatically determined using <command>paperconf(1)</command>.
1054- </para>
1055-
1056- <para>
1057- When editing stylesheets with OpenOffice.org Writer (or similar
1058- programs), the resulting files always carry a page size.
1059- <command>rst2odt</command> respects this setting and ensures that
1060- documents processed with custom stylesheets look the same
1061- regardless of the host it is running on. If you want to get the
1062- original behavior, i.e. a system-dependent paper size, you can run
1063- <command>rst2odt_prepstyles</command> over your custom stylesheet.
1064- Remember to re-run the command whenever you change the file with a
1065- word processor.
1066- </para>
1067- </refsect1>
1068-
1069- <refsect1>
1070- <title>AUTHOR</title>
1071-
1072- <para>
1073- odtwriter is Copyright &copy; 2006-2008 Dave Kuhlman
1074- &lt;<email>dkuhlman@rexx.com</email>&gt;
1075- </para>
1076-
1077- <para>
1078- This manual page was written by Michael Schutte for the Debian
1079- GNU/Linux system (but may be used by others).
1080- </para>
1081- </refsect1>
1082-</refentry>
1083-<!-- vim: set sw=2 sts=2 et tw=72: -->
1084
1085=== added file 'debian/rst2odt_prepstyles.txt'
1086--- debian/rst2odt_prepstyles.txt 1970-01-01 00:00:00 +0000
1087+++ debian/rst2odt_prepstyles.txt 2012-08-19 07:58:22 +0000
1088@@ -0,0 +1,38 @@
1089+==================
1090+rst2odt_prepstyles
1091+==================
1092+
1093+----------------------------------------------------------
1094+strip paper size specifications off of rst2odt stylesheets
1095+----------------------------------------------------------
1096+
1097+:Manual section: 1
1098+:Manual group: text processing
1099+
1100+Synopsis
1101+========
1102+**rst2odt_prepstyles** *FILE*
1103+
1104+Description
1105+===========
1106+
1107+**rst2odt**\(1) uses a stylesheet file as a template for the ODT files it
1108+creates. The stock **styles.odt** file shipped with it comes without page
1109+dimensions. When **rst2odt** is run and detects that there no paper size is
1110+given in the stylesheet, it is automatically determined using
1111+**paperconf**\(1).
1112+
1113+When editing stylesheets with OpenOffice.org Writer (or similar programs), the
1114+resulting files always carry a page size. **rst2odt** respects this setting
1115+and ensures that documents processed with custom stylesheets look the same
1116+regardless of the host it is running on. If you want to get the original
1117+behavior, i.e. a system-dependent paper size, you can run
1118+**rst2odt_prepstyles** over your custom stylesheet. Remember to re-run the
1119+command whenever you change the file with a word processor.
1120+
1121+Author
1122+======
1123+odtwriter is Copyright © 2006-2008 Dave Kuhlman <dkuhlman@rexx.com>
1124+
1125+This manual page was written by Michael Schutte for the Debian GNU/Linux system
1126+(but may be used by others).
1127
1128=== modified file 'debian/rules'
1129--- debian/rules 2011-12-17 14:11:08 +0000
1130+++ debian/rules 2012-08-19 07:58:22 +0000
1131@@ -20,11 +20,14 @@
1132 pre_strip_images2 = 's,<img alt="([^"]*)"[^>]*\bsrc="http://[^"]+"[^>]*>,$$1,g;'
1133 pre_strip_images = $(pre_strip_images1)$(pre_strip_images2)
1134
1135+python_all = pyversions -r $(CURDIR)/debian/control | tr ' ' '\n' | xargs -t -I {} env {}
1136+python3_all = $(patsubst py%,py3%,$(python_all))
1137+
1138 build build-indep: build-stamp
1139 build-stamp:
1140 dh_testdir
1141 # Check if move-data-to-usr-share.diff is up-to-date
1142- if grep -r __file__ docutils/ | grep -vw _datadir; then \
1143+ if grep -r __file__ --include='*.py' docutils/ | grep -vw _datadir; then \
1144 echo "Error: Some uses of __file__ are not guarded by _datadir()." \
1145 "Is move-data-to-usr-share.diff up-to-date?"; \
1146 exit 1; \
1147@@ -35,15 +38,9 @@
1148 python3 setup.py build --build-lib=build/py3/
1149 ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
1150 # Run test suite for Python 2.X:
1151- set -ex && cd build/py2/ && \
1152- for python in $(shell pyversions -r); do \
1153- $$python ../../test/alltests.py; \
1154- done
1155+ cd build/py2/ && $(python_all) ../../test/alltests.py --verbose
1156 # Run test suite for Python 3.X:
1157- set -ex && cd build/py3/ && \
1158- for python in $(shell py3versions -r); do \
1159- $$python test/alltests.py; \
1160- done
1161+ cd build/py3/ && $(python3_all) test/alltests.py --verbose
1162 endif
1163 # Build documentation:
1164 PYTHONPATH=.:extras python tools/buildhtml.py \
1165@@ -58,7 +55,6 @@
1166
1167 clean:
1168 dh_testdir
1169- dh_testroot
1170 rm -f build-stamp
1171 rm -rf build/
1172 find -name '*.py[co]' -delete
1173@@ -104,13 +100,20 @@
1174 PYTHONPATH=.:extras; \
1175 export PYTHONPATH; \
1176 cp debian/$$exe.txt debian/tmp/man/$$exe.txt; \
1177- python debian/tmp/usr/share/docutils/scripts/python2/$$exe --help \
1178+ python debian/tmp/usr/share/docutils/scripts/python2/$$exe --help | \
1179+ sed \
1180+ -e '1 s/^Usage$$/Synopsis/' \
1181+ -e 's/^=/====/' \
1182+ -e '3 s/^ //' \
1183+ -e '4 a Description' \
1184+ -e '4 a ===========' \
1185 >> debian/tmp/man/$$exe.txt;\
1186 python tools/rst2man.py debian/tmp/man/$$exe.txt \
1187 debian/tmp/man/$$exe.1; \
1188 done
1189- docbook-to-man debian/rst2odt_prepstyles.sgml > \
1190+ PYTHONPATH=.:extras python tools/rst2man.py debian/rst2odt_prepstyles.txt \
1191 debian/tmp/man/rst2odt_prepstyles.1
1192+ sed -i -e 's,"\(docutils/writers/\),"/usr/share/\1,g' debian/tmp/man/*
1193
1194 # Build architecture-independent files here.
1195 binary-indep: build install
1196
1197=== added file 'test/test_writers/test_docutils_xml.py'
1198--- test/test_writers/test_docutils_xml.py 1970-01-01 00:00:00 +0000
1199+++ test/test_writers/test_docutils_xml.py 2012-08-19 07:58:22 +0000
1200@@ -0,0 +1,115 @@
1201+#!/usr/bin/env python
1202+
1203+# $Id: test_docutils_xml.py 5889 2009-04-01 20:00:21Z gbrandl $
1204+# Author: Lea Wiemann <LeWiemann@gmail.com>
1205+# Copyright: This module has been placed in the public domain.
1206+
1207+"""
1208+Test for docutils XML writer.
1209+"""
1210+
1211+from __init__ import DocutilsTestSupport
1212+
1213+import sys
1214+import docutils
1215+import docutils.core
1216+from docutils._compat import b
1217+
1218+if sys.version_info[:3] in [(2, 7, 2), (3, 2, 2)]:
1219+ import xml.dom.minidom as minidom
1220+ if minidom.parseString('<x><y>z</y></x>').toprettyxml() == '<?xml version="1.0" ?>\n<x>\n\t<y>z</y>\n</x>\n':
1221+ sys_version_info = sys.version_info[:2] + (3, 'candidate', 0)
1222+ class sys:
1223+ version_info = sys_version_info
1224+ del sys_version_info
1225+ del minidom
1226+
1227+class DocutilsXMLTestCase(DocutilsTestSupport.StandardTestCase):
1228+
1229+ input = b("""\
1230+Test
1231+
1232+----------
1233+
1234+Test. \xc3\xa4\xc3\xb6\xc3\xbc\xe2\x82\xac""")
1235+ xmldecl = b('<?xml version="1.0" encoding="iso-8859-1"?>\n')
1236+ doctypedecl = b('<!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" "http://docutils.sourceforge.net/docs/ref/docutils.dtd">\n')
1237+ generatedby = b('<!-- Generated by Docutils %s -->\n' % docutils.__version__)
1238+ bodynormal = b('<document source="&lt;string&gt;"><paragraph>Test</paragraph><transition/><paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph></document>')
1239+ bodynewlines = b("""\
1240+<document source="&lt;string&gt;">
1241+<paragraph>Test</paragraph>
1242+<transition/>
1243+<paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph>
1244+</document>
1245+""")
1246+ bodynewlines_old = b("""\
1247+<document source="&lt;string&gt;">
1248+<paragraph>
1249+Test
1250+</paragraph>
1251+<transition/>
1252+<paragraph>
1253+Test. \xe4\xf6\xfc&#8364;
1254+</paragraph>
1255+</document>
1256+""")
1257+ bodyindents = b("""\
1258+<document source="&lt;string&gt;">
1259+ <paragraph>Test</paragraph>
1260+ <transition/>
1261+ <paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph>
1262+</document>
1263+""")
1264+ bodyindents_old = b("""\
1265+<document source="&lt;string&gt;">
1266+ <paragraph>
1267+ Test
1268+ </paragraph>
1269+ <transition/>
1270+ <paragraph>
1271+ Test. \xe4\xf6\xfc&#8364;
1272+ </paragraph>
1273+</document>
1274+""")
1275+
1276+ def test_publish(self):
1277+ settings = {'input_encoding': 'utf8',
1278+ 'output_encoding': 'iso-8859-1',
1279+ '_disable_config': 1}
1280+ for settings['newlines'] in 0, 1:
1281+ for settings['indents'] in 0, 1:
1282+ for settings['xml_declaration'] in 0, 1:
1283+ for settings['doctype_declaration'] in 0, 1:
1284+
1285+ expected = b('')
1286+ if settings['xml_declaration']:
1287+ expected += self.xmldecl
1288+ if settings['doctype_declaration']:
1289+ expected += self.doctypedecl
1290+ expected += self.generatedby
1291+ if settings['indents']:
1292+ expected += self.bodyindents
1293+ elif settings['newlines']:
1294+ expected += self.bodynewlines
1295+ else:
1296+ expected += self.bodynormal
1297+
1298+ self.assertEqual(docutils.core.publish_string
1299+ (source=self.input,
1300+ reader_name='standalone',
1301+ writer_name='docutils_xml',
1302+ settings_overrides=settings),
1303+ expected)
1304+
1305+ # New formatting introduced in versions 2.7.3 and 3.2.3 on 2011-11-18
1306+ # to fix http://bugs.python.org/issue4147
1307+ if (sys.version_info < (2, 7, 3) or
1308+ sys.version_info[0] == 3 and sys.version_info < (3, 2, 3)):
1309+ bodynewlines = bodynewlines_old
1310+ bodyindents = bodyindents_old
1311+
1312+
1313+if __name__ == '__main__':
1314+ import unittest
1315+ unittest.main()
1316
1317=== modified file 'test/test_writers/test_odt.py'
1318--- test/test_writers/test_odt.py 2011-08-22 18:50:14 +0000
1319+++ test/test_writers/test_odt.py 2012-08-19 07:58:22 +0000
1320@@ -74,6 +74,7 @@
1321 from elementtree import ElementTree as etree
1322 WhichElementTree = 'elementtree'
1323 except ImportError, e:
1324+ raise
1325 s1 = '\nSkipped test of odf_odt writer. ' \
1326 'In order to test odf_odt writer ' \
1327 'must install either a version of Python containing ' \

Subscribers

People subscribed via source and target branches