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
=== added file '.pc/.quilt_patches'
--- .pc/.quilt_patches 1970-01-01 00:00:00 +0000
+++ .pc/.quilt_patches 2012-08-19 07:58:22 +0000
@@ -0,0 +1,1 @@
1debian/patches
02
=== added file '.pc/.quilt_series'
--- .pc/.quilt_series 1970-01-01 00:00:00 +0000
+++ .pc/.quilt_series 2012-08-19 07:58:22 +0000
@@ -0,0 +1,1 @@
1series
02
=== modified file '.pc/applied-patches'
--- .pc/applied-patches 2011-12-17 14:11:08 +0000
+++ .pc/applied-patches 2012-08-19 07:58:22 +0000
@@ -9,5 +9,7 @@
9add-missing-import.diff9add-missing-import.diff
10fix-error-reporting-encoding-issues.diff10fix-error-reporting-encoding-issues.diff
11fix-io-encoding-issues.diff11fix-io-encoding-issues.diff
12fix-docutilsxmltestcase.diff
13fix-docutilsxmltestcase-debian.diff
14no-test-skipping.diff
12move-data-to-usr-share.diff15move-data-to-usr-share.diff
13disable-DocutilsXMLTestCase.diff
1416
=== removed directory '.pc/disable-DocutilsXMLTestCase.diff'
=== removed directory '.pc/disable-DocutilsXMLTestCase.diff/test'
=== removed directory '.pc/disable-DocutilsXMLTestCase.diff/test/test_writers'
=== removed file '.pc/disable-DocutilsXMLTestCase.diff/test/test_writers/test_docutils_xml.py'
--- .pc/disable-DocutilsXMLTestCase.diff/test/test_writers/test_docutils_xml.py 2011-12-17 14:11:08 +0000
+++ .pc/disable-DocutilsXMLTestCase.diff/test/test_writers/test_docutils_xml.py 1970-01-01 00:00:00 +0000
@@ -1,85 +0,0 @@
1#!/usr/bin/env python
2
3# $Id: test_docutils_xml.py 5889 2009-04-01 20:00:21Z gbrandl $
4# Author: Lea Wiemann <LeWiemann@gmail.com>
5# Copyright: This module has been placed in the public domain.
6
7"""
8Test for docutils XML writer.
9"""
10
11from __init__ import DocutilsTestSupport
12
13import docutils
14import docutils.core
15from docutils._compat import b
16
17
18class DocutilsXMLTestCase(DocutilsTestSupport.StandardTestCase):
19
20 input = b("""\
21Test
22
23----------
24
25Test. \xc3\xa4\xc3\xb6\xc3\xbc\xe2\x82\xac""")
26 xmldecl = b('<?xml version="1.0" encoding="iso-8859-1"?>\n')
27 doctypedecl = b('<!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" "http://docutils.sourceforge.net/docs/ref/docutils.dtd">\n')
28 generatedby = b('<!-- Generated by Docutils %s -->\n' % docutils.__version__)
29 bodynormal = b('<document source="&lt;string&gt;"><paragraph>Test</paragraph><transition/><paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph></document>')
30 bodynewlines = b("""\
31<document source="&lt;string&gt;">
32<paragraph>
33Test
34</paragraph>
35<transition/>
36<paragraph>
37Test. \xe4\xf6\xfc&#8364;
38</paragraph>
39</document>
40""")
41 bodyindents = b("""\
42<document source="&lt;string&gt;">
43 <paragraph>
44 Test
45 </paragraph>
46 <transition/>
47 <paragraph>
48 Test. \xe4\xf6\xfc&#8364;
49 </paragraph>
50</document>
51""")
52
53 def test_publish(self):
54 settings = {'input_encoding': 'utf8',
55 'output_encoding': 'iso-8859-1',
56 '_disable_config': 1}
57 for settings['newlines'] in 0, 1:
58 for settings['indents'] in 0, 1:
59 for settings['xml_declaration'] in 0, 1:
60 for settings['doctype_declaration'] in 0, 1:
61
62 expected = b('')
63 if settings['xml_declaration']:
64 expected += self.xmldecl
65 if settings['doctype_declaration']:
66 expected += self.doctypedecl
67 expected += self.generatedby
68 if settings['indents']:
69 expected += self.bodyindents
70 elif settings['newlines']:
71 expected += self.bodynewlines
72 else:
73 expected += self.bodynormal
74
75 self.assertEqual(docutils.core.publish_string
76 (source=self.input,
77 reader_name='standalone',
78 writer_name='docutils_xml',
79 settings_overrides=settings),
80 expected)
81
82
83if __name__ == '__main__':
84 import unittest
85 unittest.main()
860
=== added directory '.pc/fix-docutilsxmltestcase-debian.diff'
=== added directory '.pc/fix-docutilsxmltestcase-debian.diff/test'
=== added directory '.pc/fix-docutilsxmltestcase-debian.diff/test/test_writers'
=== added file '.pc/fix-docutilsxmltestcase-debian.diff/test/test_writers/test_docutils_xml.py'
--- .pc/fix-docutilsxmltestcase-debian.diff/test/test_writers/test_docutils_xml.py 1970-01-01 00:00:00 +0000
+++ .pc/fix-docutilsxmltestcase-debian.diff/test/test_writers/test_docutils_xml.py 2012-08-19 07:58:22 +0000
@@ -0,0 +1,107 @@
1#!/usr/bin/env python
2
3# $Id: test_docutils_xml.py 5889 2009-04-01 20:00:21Z gbrandl $
4# Author: Lea Wiemann <LeWiemann@gmail.com>
5# Copyright: This module has been placed in the public domain.
6
7"""
8Test for docutils XML writer.
9"""
10
11from __init__ import DocutilsTestSupport
12
13import sys
14import docutils
15import docutils.core
16from docutils._compat import b
17
18
19class DocutilsXMLTestCase(DocutilsTestSupport.StandardTestCase):
20
21 input = b("""\
22Test
23
24----------
25
26Test. \xc3\xa4\xc3\xb6\xc3\xbc\xe2\x82\xac""")
27 xmldecl = b('<?xml version="1.0" encoding="iso-8859-1"?>\n')
28 doctypedecl = b('<!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" "http://docutils.sourceforge.net/docs/ref/docutils.dtd">\n')
29 generatedby = b('<!-- Generated by Docutils %s -->\n' % docutils.__version__)
30 bodynormal = b('<document source="&lt;string&gt;"><paragraph>Test</paragraph><transition/><paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph></document>')
31 bodynewlines = b("""\
32<document source="&lt;string&gt;">
33<paragraph>Test</paragraph>
34<transition/>
35<paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph>
36</document>
37""")
38 bodynewlines_old = b("""\
39<document source="&lt;string&gt;">
40<paragraph>
41Test
42</paragraph>
43<transition/>
44<paragraph>
45Test. \xe4\xf6\xfc&#8364;
46</paragraph>
47</document>
48""")
49 bodyindents = b("""\
50<document source="&lt;string&gt;">
51 <paragraph>Test</paragraph>
52 <transition/>
53 <paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph>
54</document>
55""")
56 bodyindents_old = b("""\
57<document source="&lt;string&gt;">
58 <paragraph>
59 Test
60 </paragraph>
61 <transition/>
62 <paragraph>
63 Test. \xe4\xf6\xfc&#8364;
64 </paragraph>
65</document>
66""")
67
68 def test_publish(self):
69 settings = {'input_encoding': 'utf8',
70 'output_encoding': 'iso-8859-1',
71 '_disable_config': 1}
72 for settings['newlines'] in 0, 1:
73 for settings['indents'] in 0, 1:
74 for settings['xml_declaration'] in 0, 1:
75 for settings['doctype_declaration'] in 0, 1:
76
77 expected = b('')
78 if settings['xml_declaration']:
79 expected += self.xmldecl
80 if settings['doctype_declaration']:
81 expected += self.doctypedecl
82 expected += self.generatedby
83 if settings['indents']:
84 expected += self.bodyindents
85 elif settings['newlines']:
86 expected += self.bodynewlines
87 else:
88 expected += self.bodynormal
89
90 self.assertEqual(docutils.core.publish_string
91 (source=self.input,
92 reader_name='standalone',
93 writer_name='docutils_xml',
94 settings_overrides=settings),
95 expected)
96
97 # New formatting introduced in versions 2.7.3 and 3.2.3 on 2011-11-18
98 # to fix http://bugs.python.org/issue4147
99 if (sys.version_info < (2, 7, 3) or
100 sys.version_info[0] == 3 and sys.version_info < (3, 2, 3)):
101 bodynewlines = bodynewlines_old
102 bodyindents = bodyindents_old
103
104
105if __name__ == '__main__':
106 import unittest
107 unittest.main()
0108
=== added directory '.pc/fix-docutilsxmltestcase.diff'
=== added directory '.pc/fix-docutilsxmltestcase.diff/test'
=== added directory '.pc/fix-docutilsxmltestcase.diff/test/test_writers'
=== added file '.pc/fix-docutilsxmltestcase.diff/test/test_writers/test_docutils_xml.py'
--- .pc/fix-docutilsxmltestcase.diff/test/test_writers/test_docutils_xml.py 1970-01-01 00:00:00 +0000
+++ .pc/fix-docutilsxmltestcase.diff/test/test_writers/test_docutils_xml.py 2012-08-19 07:58:22 +0000
@@ -0,0 +1,85 @@
1#!/usr/bin/env python
2
3# $Id: test_docutils_xml.py 5889 2009-04-01 20:00:21Z gbrandl $
4# Author: Lea Wiemann <LeWiemann@gmail.com>
5# Copyright: This module has been placed in the public domain.
6
7"""
8Test for docutils XML writer.
9"""
10
11from __init__ import DocutilsTestSupport
12
13import docutils
14import docutils.core
15from docutils._compat import b
16
17
18class DocutilsXMLTestCase(DocutilsTestSupport.StandardTestCase):
19
20 input = b("""\
21Test
22
23----------
24
25Test. \xc3\xa4\xc3\xb6\xc3\xbc\xe2\x82\xac""")
26 xmldecl = b('<?xml version="1.0" encoding="iso-8859-1"?>\n')
27 doctypedecl = b('<!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" "http://docutils.sourceforge.net/docs/ref/docutils.dtd">\n')
28 generatedby = b('<!-- Generated by Docutils %s -->\n' % docutils.__version__)
29 bodynormal = b('<document source="&lt;string&gt;"><paragraph>Test</paragraph><transition/><paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph></document>')
30 bodynewlines = b("""\
31<document source="&lt;string&gt;">
32<paragraph>
33Test
34</paragraph>
35<transition/>
36<paragraph>
37Test. \xe4\xf6\xfc&#8364;
38</paragraph>
39</document>
40""")
41 bodyindents = b("""\
42<document source="&lt;string&gt;">
43 <paragraph>
44 Test
45 </paragraph>
46 <transition/>
47 <paragraph>
48 Test. \xe4\xf6\xfc&#8364;
49 </paragraph>
50</document>
51""")
52
53 def test_publish(self):
54 settings = {'input_encoding': 'utf8',
55 'output_encoding': 'iso-8859-1',
56 '_disable_config': 1}
57 for settings['newlines'] in 0, 1:
58 for settings['indents'] in 0, 1:
59 for settings['xml_declaration'] in 0, 1:
60 for settings['doctype_declaration'] in 0, 1:
61
62 expected = b('')
63 if settings['xml_declaration']:
64 expected += self.xmldecl
65 if settings['doctype_declaration']:
66 expected += self.doctypedecl
67 expected += self.generatedby
68 if settings['indents']:
69 expected += self.bodyindents
70 elif settings['newlines']:
71 expected += self.bodynewlines
72 else:
73 expected += self.bodynormal
74
75 self.assertEqual(docutils.core.publish_string
76 (source=self.input,
77 reader_name='standalone',
78 writer_name='docutils_xml',
79 settings_overrides=settings),
80 expected)
81
82
83if __name__ == '__main__':
84 import unittest
85 unittest.main()
086
=== added directory '.pc/no-test-skipping.diff'
=== added directory '.pc/no-test-skipping.diff/test'
=== added directory '.pc/no-test-skipping.diff/test/test_writers'
=== added file '.pc/no-test-skipping.diff/test/test_writers/test_odt.py'
--- .pc/no-test-skipping.diff/test/test_writers/test_odt.py 1970-01-01 00:00:00 +0000
+++ .pc/no-test-skipping.diff/test/test_writers/test_odt.py 2012-08-19 07:58:22 +0000
@@ -0,0 +1,185 @@
1#!/usr/bin/env python
2
3# $Id: test_odt.py 6989 2011-03-04 23:44:32Z dkuhlman $
4# Author: Dave Kuhlman <dkuhlman@rexx.com>
5# Copyright: This module has been placed in the public domain.
6
7"""
8Tests for docutils odtwriter.
9
10Instructions for adding a new test:
11
121. Add a new method to class DocutilsOdtTestCase (below) named
13 test_odt_xxxx, where xxxx describes your new feature. See
14 test_odt_basic for an example.
15
162. Add a new input reST (.txt) file in test/functional/input. This
17 file should contain the smallest amount of reST that tests your
18 new feature. Name this file odt_xxxx.txt.
19
203. Convert your input reST (.txt) file to an ODF (.odt) file using
21 rst2odt.py. Place this ODF (.odt) file in
22 test/functional/expected. Name this file odt_xxxx.odt.
23 You can also pass parameter save_output_name='filename' to method
24 process_test() in order to produce expected output.
25 See and modify variable TEMP_FILE_PATH for destination.
26
274. Run your test. Your new test should pass.
28
295. If any other tests fail, that's a possible regression.
30
31"""
32
33import sys
34import os
35import StringIO
36import zipfile
37from xml.dom import minidom
38import tempfile
39
40from __init__ import DocutilsTestSupport
41
42import docutils
43import docutils.core
44from docutils._compat import BytesIO
45
46#
47# Globals
48TEMP_FILE_PATH = '/tmp'
49INPUT_PATH = 'functional/input/'
50EXPECTED_PATH = 'functional/expected/'
51
52
53class DocutilsOdtTestCase(DocutilsTestSupport.StandardTestCase):
54
55 #
56 # Check to see if we can import the needed XML library.
57 # Report failure if we cannot.
58 def check_import(self):
59 WhichElementTree = ''
60 try:
61 # 1. Try to use lxml.
62 #from lxml import etree
63 #WhichElementTree = 'lxml'
64 raise ImportError('Ignoring lxml')
65 except ImportError, e:
66 try:
67 # 2. Try to use ElementTree from the Python standard library.
68 from xml.etree import ElementTree as etree
69 WhichElementTree = 'elementtree'
70 except ImportError, e:
71 try:
72 # 3. Try to use a version of ElementTree installed as a separate
73 # product.
74 from elementtree import ElementTree as etree
75 WhichElementTree = 'elementtree'
76 except ImportError, e:
77 s1 = '\nSkipped test of odf_odt writer. ' \
78 'In order to test odf_odt writer ' \
79 'must install either a version of Python containing ' \
80 'ElementTree (Python version >=2.5) or ' \
81 'install ElementTree.\n\n'
82 #self.fail(s1)
83 sys.stderr.write(s1)
84 return WhichElementTree
85
86 def process_test(self, input_filename, expected_filename,
87 save_output_name=None, settings_overrides=None):
88 if not self.check_import():
89 return
90 # Test that xmlcharrefreplace is the default output encoding
91 # error handler.
92 input_file = open(INPUT_PATH + input_filename, 'rb')
93 expected_file = open(EXPECTED_PATH + expected_filename, 'rb')
94 input = input_file.read()
95 expected = expected_file.read()
96 input_file.close()
97 expected_file.close()
98 if settings_overrides is None:
99 settings_overrides={ }
100 result = docutils.core.publish_string(
101 source=input,
102 reader_name='standalone',
103 writer_name='odf_odt',
104 settings_overrides=settings_overrides)
105## msg = 'file length not equal: expected length: %d actual length: %d' % (
106## len(expected), len(result), )
107## self.assertEqual(str(len(result)), str(len(expected)))
108 if save_output_name:
109 filename = '%s%s%s' % (TEMP_FILE_PATH, os.sep, save_output_name,)
110 outfile = open(filename, 'w')
111 outfile.write(result)
112 outfile.close()
113 content1 = self.extract_file(result, 'content.xml')
114 content2 = self.extract_file(expected, 'content.xml')
115 msg = 'content.xml not equal: expected len: %d actual len: %d' % (
116 len(content2), len(content1), )
117 self.assertEqual(content1, content2, msg)
118
119 def extract_file(self, payload, filename):
120 payloadfile = BytesIO()
121 payloadfile.write(payload)
122 payloadfile.seek(0)
123 zfile = zipfile.ZipFile(payloadfile, 'r')
124 content1 = zfile.read(filename)
125 doc = minidom.parseString(content1)
126 #content2 = doc.toprettyxml(indent=' ')
127 content2 = doc.toxml()
128 return content2
129
130 def assertEqual(self, first, second, msg=None):
131 if msg is None:
132 msg2 = msg
133 else:
134 sep = '+' * 60
135 msg1 = '\n%s\nresult:\n%s\n%s\nexpected:\n%s\n%s' % (
136 sep, first, sep, second, sep, )
137 #msg2 = '%s\n%s' % (msg1, msg, )
138 msg2 = '%s' % (msg, )
139 DocutilsTestSupport.StandardTestCase.failUnlessEqual(self,
140 first, second, msg2)
141
142 #
143 # Unit test methods
144 #
145 # All test methods should be named "test_odt_xxxx", where
146 # xxxx is replaced with a name for the new test.
147 # See instructions above in module doc-string.
148 #
149
150 def test_odt_basic(self):
151 self.process_test('odt_basic.txt', 'odt_basic.odt',
152 #save_output_name='odt_basic.odt'
153 )
154
155 def test_odt_tables1(self):
156 self.process_test('odt_tables1.txt', 'odt_tables1.odt',
157 #save_output_name='odt_tables1.odt'
158 )
159
160 def test_odt_custom_headfoot(self):
161 settings_overrides = {
162 'custom_header': 'Page %p% of %P%',
163 'custom_footer': 'Title: %t% Date: %d3% Time: %t4%',
164 }
165 self.process_test('odt_custom_headfoot.txt', 'odt_custom_headfoot.odt',
166 settings_overrides=settings_overrides,
167 #save_output_name='odt_custom_headfoot.odt'
168 )
169
170 #
171 # Template for new tests.
172 # Also add functional/input/odt_xxxx.txt and
173 # functional/expected/odt_xxxx.odt
174 # Replace all xxxx with name of your test.
175 #
176## def test_odt_xxxx(self):
177## self.process_test('odt_xxxx.txt', 'odt_xxxx.odt')
178
179
180# -----------------------------------------------------------------
181
182
183if __name__ == '__main__':
184 import unittest
185 unittest.main()
0186
=== modified file 'debian/changelog'
--- debian/changelog 2011-12-17 14:11:08 +0000
+++ debian/changelog 2012-08-19 07:58:22 +0000
@@ -1,3 +1,74 @@
1python-docutils (0.8.1-8ubuntu1) quantal; urgency=low
2
3 * Resynchronize with Debian unstable (LP: #1038470), remaining change:
4 - Use dh_python2 instead of dh_pysupport
5
6 -- Dmitry Shachnev <mitya57@gmail.com> Sat, 18 Aug 2012 20:16:07 +0400
7
8python-docutils (0.8.1-8) unstable; urgency=low
9
10 * Install all DTD files (really closes: #531170).
11
12 -- Jakub Wilk <jwilk@debian.org> Wed, 04 Jul 2012 14:07:30 +0200
13
14python-docutils (0.8.1-7) unstable; urgency=low
15
16 * Rebuild against debhelper (>= 9.20120528) to fix postinst that
17 unconditionally overwrites files in /etc (see: #477751, closes: #675489).
18 Thanks to Helmut Grohne for the bug report.
19
20 -- Jakub Wilk <jwilk@debian.org> Fri, 01 Jun 2012 18:20:46 +0200
21
22python-docutils (0.8.1-6) unstable; urgency=low
23
24 * Fix a typo in a patch description.
25 * Bump standards version to 3.9.3 (no changes needed).
26 * Don't mention “Dive Into Python” in python*-roman package descriptions
27 (closes: #661555). Thanks to Konrad Schöbel for the bug report.
28 * Remove references to http://diveintopython.org/ from debian/copyright.
29 * Do not skip tests because of failed imports, as they should never happen.
30 (no-test-skipping.diff)
31 * Check only *.py files when looking for unguarded use of __file__.
32 * Fix paths in the auto-generated manual pages.
33 * Split section “Usage” into “Synopsis” and “Description” in the manual
34 pages.
35 * Fool DocutilsXMLTestCase into thinking that Python version is 2.7.3/3.2.3
36 when it's in fact 2.7.2/3.2.2 with patched
37 xml.dom.minidom.Document.toprettyxml() method (closes: #645369).
38 (fix-docutilsxmltestcase.diff).
39
40 -- Jakub Wilk <jwilk@debian.org> Sat, 03 Mar 2012 01:40:35 +0100
41
42python-docutils (0.8.1-5) unstable; urgency=low
43
44 [ Simon McVittie ]
45 * Remove myself from Uploaders
46
47 [ Jakub Wilk ]
48 * Backport upstream patch to follow the changes in the
49 xml.dom.minidom.Document.toprettyxml method
50 (fix-docutilsxmltestcase.diff).
51 * Drop postinst snippet to deal with a python-support bug (it cannot replace
52 directory with a regular file). It was needed only for 0.7 upgrades.
53 * Suggest fonts-linuxlibertine as an alternative to ttf-linux-libertine.
54 * Update David Goodger's e-mail address in debian/copyright
55 (closes: #653769). Thanks to Jari Aalto for the bug report.
56 * Update Subversion repository URLs in patch headers (so that they point to
57 SourceForge rather than BerliOS).
58 * Use xargs to iterate over all Python versions.
59 * Convert rst2odt_prepstyles manpage source from DocBook to
60 reStructuredText.
61 + Remove docbook-to-man from Build-Depends-Indep.
62 + Update debian/rules.
63 * Don't run dh_testroot in the clean target. There's a good chance that root
64 privileges are not needed (e.g. because binary target was run under
65 fakeroot), and even if they are actually needed, the target will fail
66 quickly.
67 * Drop obsolete virtual package: docutils-writer-manpage (closes: #631066).
68 * Run tests with --verbose.
69
70 -- Jakub Wilk <jwilk@debian.org> Wed, 15 Feb 2012 19:21:26 +0100
71
1python-docutils (0.8.1-4ubuntu1) precise; urgency=low72python-docutils (0.8.1-4ubuntu1) precise; urgency=low
273
3 * Build using dh_python274 * Build using dh_python2
@@ -9,7 +80,7 @@
9python-docutils (0.8.1-4) unstable; urgency=low80python-docutils (0.8.1-4) unstable; urgency=low
1081
11 * When running the test suite, don't copy stdout and stderr output to a log82 * When running the test suite, don't copy stdout and stderr output to a log
12 file, as this would break under LC_ALL=C, PYTHONWARNING=d and python3.X83 file, as this would break under LC_ALL=C, PYTHONWARNINGS=d and python3.X
13 (testall-no-stdout-stderr-redirect.diff).84 (testall-no-stdout-stderr-redirect.diff).
14 * Use build/py2 and build/py3 for build directories.85 * Use build/py2 and build/py3 for build directories.
15 * Remove excessive whitespace from debian/control.86 * Remove excessive whitespace from debian/control.
1687
=== modified file 'debian/control'
--- debian/control 2011-12-17 14:11:08 +0000
+++ debian/control 2012-08-19 07:58:22 +0000
@@ -1,26 +1,24 @@
1Source: python-docutils1Source: python-docutils
2Section: python2Section: python
3Priority: optional3Priority: optional
4Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5XSBC-Original-Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
5Uploaders: Jakub Wilk <jwilk@debian.org>,6Uploaders: Jakub Wilk <jwilk@debian.org>,
6 martin f. krafft <madduck@debian.org>,7 martin f. krafft <madduck@debian.org>,
7 Simon McVittie <smcv@debian.org>,
8 Michael Schutte <michi@uiae.at>,8 Michael Schutte <michi@uiae.at>,
9 Ben Finney <ben+debian@benfinney.id.au>9 Ben Finney <ben+debian@benfinney.id.au>
10Build-Depends: debhelper (>= 7)10Build-Depends: debhelper (>= 7)
11Build-Depends-Indep: python-all (>= 2.6.6-3~),11Build-Depends-Indep: python-all (>= 2.6.6-3~),
12 python3-all (>= 3.1.2-7~),12 python3-all (>= 3.1.2-7~),
13 docbook-to-man,
14 xml-core13 xml-core
15Standards-Version: 3.9.214Standards-Version: 3.9.3
16X-Python-Version: >= 2.315X-Python-Version: >= 2.3
17Vcs-Svn: svn://svn.debian.org/python-modules/packages/python-docutils/trunk/16Vcs-Svn: svn://svn.debian.org/python-modules/packages/python-docutils/trunk/
18Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/python-docutils/trunk/17Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/python-docutils/trunk/
19Homepage: http://docutils.sourceforge.net/18Homepage: http://docutils.sourceforge.net/
2019
21Package: python-docutils20Package: python-docutils
22Provides: docutils,21Provides: docutils
23 docutils-writer-manpage
24Architecture: all22Architecture: all
25Depends: ${misc:Depends}, ${python:Depends},23Depends: ${misc:Depends}, ${python:Depends},
26 python-roman,24 python-roman,
@@ -30,7 +28,7 @@
30 libpaper-utils,28 libpaper-utils,
31 python-lxml, 29 python-lxml,
32 docutils-doc (= ${source:Version})30 docutils-doc (= ${source:Version})
33Suggests: texlive-latex-recommended, texlive-latex-base, texlive-lang-french, ttf-linux-libertine31Suggests: texlive-latex-recommended, texlive-latex-base, texlive-lang-french, fonts-linuxlibertine | ttf-linux-libertine
34Conflicts: python-odtwriter,32Conflicts: python-odtwriter,
35 docutils-writer-odt33 docutils-writer-odt
36Replaces: python-odtwriter,34Replaces: python-odtwriter,
@@ -61,7 +59,7 @@
61Conflicts: python-docutils (<< 0.7-3~),59Conflicts: python-docutils (<< 0.7-3~),
62 python-odtwriter,60 python-odtwriter,
63 docutils-writer-odt61 docutils-writer-odt
64Suggests: texlive-latex-recommended, texlive-latex-base, texlive-lang-french, docutils-doc, ttf-linux-libertine62Suggests: texlive-latex-recommended, texlive-latex-base, texlive-lang-french, fonts-linuxlibertine | ttf-linux-libertine, docutils-doc
65Description: text processing system for reStructuredText (implemented in Python 3)63Description: text processing system for reStructuredText (implemented in Python 3)
66 reStructuredText is an easy-to-read, what-you-see-is-what-you-get plaintext64 reStructuredText is an easy-to-read, what-you-see-is-what-you-get plaintext
67 markup syntax and parser system. It is useful for in-line program documentation65 markup syntax and parser system. It is useful for in-line program documentation
@@ -122,10 +120,6 @@
122 from 1 to 4999 and understands the common shortcuts (IX == 9), but not120 from 1 to 4999 and understands the common shortcuts (IX == 9), but not
123 illegal ones (MIM == 1999).121 illegal ones (MIM == 1999).
124 .122 .
125 This module is part of "Dive Into Python", a free Python tutorial for
126 experienced programmers. Visit http://diveintopython.org/ for the
127 latest version.
128 .
129 This package includes Python 2 modules.123 This package includes Python 2 modules.
130124
131Package: python3-roman125Package: python3-roman
@@ -136,8 +130,4 @@
136 from 1 to 4999 and understands the common shortcuts (IX == 9), but not130 from 1 to 4999 and understands the common shortcuts (IX == 9), but not
137 illegal ones (MIM == 1999).131 illegal ones (MIM == 1999).
138 .132 .
139 This module is part of "Dive Into Python", a free Python tutorial for
140 experienced programmers. Visit http://diveintopython.org/ for the
141 latest version.
142 .
143 This package includes Python 3 modules.133 This package includes Python 3 modules.
144134
=== modified file 'debian/copyright'
--- debian/copyright 2011-09-03 01:32:29 +0000
+++ debian/copyright 2012-08-19 07:58:22 +0000
@@ -11,7 +11,7 @@
1111
12It was downloaded from http://docutils.sourceforge.net/12It was downloaded from http://docutils.sourceforge.net/
1313
14Upstream Author: David Goodger <goodger@users.sourceforge.net>14Upstream Author: David Goodger <goodger@python.org>
1515
16Most of the files included in this project have been placed in the public16Most of the files included in this project have been placed in the public
17domain, and therefore have no license requirements and no restrictions on17domain, and therefore have no license requirements and no restrictions on
@@ -146,8 +146,7 @@
146 Copyright © 2001 Mark Pilgrim146 Copyright © 2001 Mark Pilgrim
147147
148 This program is part of "Dive Into Python", a free Python tutorial for148 This program is part of "Dive Into Python", a free Python tutorial for
149 experienced programmers. Visit http://diveintopython.org/ for the149 experienced programmers.
150 latest version.
151150
152 This program is free software; you can redistribute it and/or modify151 This program is free software; you can redistribute it and/or modify
153 it under the terms of the Python 2.1.1 license, available at152 it under the terms of the Python 2.1.1 license, available at
154153
=== modified file 'debian/docutils-common.install'
--- debian/docutils-common.install 2011-08-22 18:50:14 +0000
+++ debian/docutils-common.install 2012-08-19 07:58:22 +0000
@@ -1,4 +1,4 @@
1/usr/share/docutils/1/usr/share/docutils/
2tools/editors/emacs/rst.el usr/share/emacs/site-lisp2tools/editors/emacs/rst.el usr/share/emacs/site-lisp
3debian/50python-docutils.el etc/emacs/site-start.d3debian/50python-docutils.el etc/emacs/site-start.d
4docs/ref/docutils.dtd usr/share/xml/docutils/4docs/ref/*.dtd usr/share/xml/docutils/
55
=== modified file 'debian/patches/add-missing-import.diff'
--- debian/patches/add-missing-import.diff 2011-10-23 22:59:02 +0000
+++ debian/patches/add-missing-import.diff 2012-08-19 07:58:22 +0000
@@ -1,6 +1,6 @@
1Description: Add missing import.1Description: Add missing import.
2Origin: upstream, http://svn.berlios.de/viewvc/docutils/trunk/docutils/docutils/frontend.py?r1=7071&r2=71962Origin: upstream, http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/docutils/frontend.py?r1=7071&r2=7196
3Last-Update: 2011-10-233Last-Update: 2011-12-31
44
5--- a/docutils/frontend.py5--- a/docutils/frontend.py
6+++ b/docutils/frontend.py6+++ b/docutils/frontend.py
77
=== removed file 'debian/patches/disable-DocutilsXMLTestCase.diff'
--- debian/patches/disable-DocutilsXMLTestCase.diff 2011-12-17 14:11:08 +0000
+++ debian/patches/disable-DocutilsXMLTestCase.diff 1970-01-01 00:00:00 +0000
@@ -1,90 +0,0 @@
1Index: python-docutils-0.8.1/test/test_writers/test_docutils_xml.py
2===================================================================
3--- python-docutils-0.8.1.orig/test/test_writers/test_docutils_xml.py 2009-04-01 20:00:21.000000000 +0000
4+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
5@@ -1,85 +0,0 @@
6-#!/usr/bin/env python
7-
8-# $Id: test_docutils_xml.py 5889 2009-04-01 20:00:21Z gbrandl $
9-# Author: Lea Wiemann <LeWiemann@gmail.com>
10-# Copyright: This module has been placed in the public domain.
11-
12-"""
13-Test for docutils XML writer.
14-"""
15-
16-from __init__ import DocutilsTestSupport
17-
18-import docutils
19-import docutils.core
20-from docutils._compat import b
21-
22-
23-class DocutilsXMLTestCase(DocutilsTestSupport.StandardTestCase):
24-
25- input = b("""\
26-Test
27-
28-----------
29-
30-Test. \xc3\xa4\xc3\xb6\xc3\xbc\xe2\x82\xac""")
31- xmldecl = b('<?xml version="1.0" encoding="iso-8859-1"?>\n')
32- doctypedecl = b('<!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" "http://docutils.sourceforge.net/docs/ref/docutils.dtd">\n')
33- generatedby = b('<!-- Generated by Docutils %s -->\n' % docutils.__version__)
34- bodynormal = b('<document source="&lt;string&gt;"><paragraph>Test</paragraph><transition/><paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph></document>')
35- bodynewlines = b("""\
36-<document source="&lt;string&gt;">
37-<paragraph>
38-Test
39-</paragraph>
40-<transition/>
41-<paragraph>
42-Test. \xe4\xf6\xfc&#8364;
43-</paragraph>
44-</document>
45-""")
46- bodyindents = b("""\
47-<document source="&lt;string&gt;">
48- <paragraph>
49- Test
50- </paragraph>
51- <transition/>
52- <paragraph>
53- Test. \xe4\xf6\xfc&#8364;
54- </paragraph>
55-</document>
56-""")
57-
58- def test_publish(self):
59- settings = {'input_encoding': 'utf8',
60- 'output_encoding': 'iso-8859-1',
61- '_disable_config': 1}
62- for settings['newlines'] in 0, 1:
63- for settings['indents'] in 0, 1:
64- for settings['xml_declaration'] in 0, 1:
65- for settings['doctype_declaration'] in 0, 1:
66-
67- expected = b('')
68- if settings['xml_declaration']:
69- expected += self.xmldecl
70- if settings['doctype_declaration']:
71- expected += self.doctypedecl
72- expected += self.generatedby
73- if settings['indents']:
74- expected += self.bodyindents
75- elif settings['newlines']:
76- expected += self.bodynewlines
77- else:
78- expected += self.bodynormal
79-
80- self.assertEqual(docutils.core.publish_string
81- (source=self.input,
82- reader_name='standalone',
83- writer_name='docutils_xml',
84- settings_overrides=settings),
85- expected)
86-
87-
88-if __name__ == '__main__':
89- import unittest
90- unittest.main()
910
=== added file 'debian/patches/fix-docutilsxmltestcase-debian.diff'
--- debian/patches/fix-docutilsxmltestcase-debian.diff 1970-01-01 00:00:00 +0000
+++ debian/patches/fix-docutilsxmltestcase-debian.diff 2012-08-19 07:58:22 +0000
@@ -0,0 +1,26 @@
1Description: Forge sys.version_info for DocutilsXMLTestCase.
2 Fool DocutilsXMLTestCase into thinking that Python version is 2.7.3/3.2.3 when
3 it's in fact 2.7.2/3.2.2 with patched xml.dom.minidom.Document.toprettyxml()
4 method.
5Author: Jakub Wilk <jwilk@debian.org>
6Bug-Debian: http://bugs.debian.org/645369
7Forwarded: not-needed
8Last-Update: 2012-03-03
9
10--- a/test/test_writers/test_docutils_xml.py
11+++ b/test/test_writers/test_docutils_xml.py
12@@ -15,6 +15,14 @@
13 import docutils.core
14 from docutils._compat import b
15
16+if sys.version_info[:3] in [(2, 7, 2), (3, 2, 2)]:
17+ import xml.dom.minidom as minidom
18+ if minidom.parseString('<x><y>z</y></x>').toprettyxml() == '<?xml version="1.0" ?>\n<x>\n\t<y>z</y>\n</x>\n':
19+ sys_version_info = sys.version_info[:2] + (3, 'candidate', 0)
20+ class sys:
21+ version_info = sys_version_info
22+ del sys_version_info
23+ del minidom
24
25 class DocutilsXMLTestCase(DocutilsTestSupport.StandardTestCase):
26
027
=== added file 'debian/patches/fix-docutilsxmltestcase.diff'
--- debian/patches/fix-docutilsxmltestcase.diff 1970-01-01 00:00:00 +0000
+++ debian/patches/fix-docutilsxmltestcase.diff 2012-08-19 07:58:22 +0000
@@ -0,0 +1,62 @@
1Description: Follow the changes in xml.dom.minidom.Document.toprettyxml().
2 xml.dom.minidom.Document.toprettyxml() has change behaviour in Python 2.7.3
3 and 3.3.3. See http://bugs.python.org/issue4147 for details.
4 .
5 This patch updates DocutilsXMLTestCase to cope with these changes.
6Origin: backport, http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/test/test_writers/test_docutils_xml.py?r1=7221&r2=7226
7Bug: http://sourceforge.net/tracker/?func=detail&aid=3423983&group_id=38414&atid=422030
8Bug-Debian: http://bugs.debian.org/645369
9Last-Update: 2011-12-31
10
11--- a/test/test_writers/test_docutils_xml.py
12+++ b/test/test_writers/test_docutils_xml.py
13@@ -10,6 +10,7 @@
14
15 from __init__ import DocutilsTestSupport
16
17+import sys
18 import docutils
19 import docutils.core
20 from docutils._compat import b
21@@ -29,6 +30,13 @@
22 bodynormal = b('<document source="&lt;string&gt;"><paragraph>Test</paragraph><transition/><paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph></document>')
23 bodynewlines = b("""\
24 <document source="&lt;string&gt;">
25+<paragraph>Test</paragraph>
26+<transition/>
27+<paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph>
28+</document>
29+""")
30+ bodynewlines_old = b("""\
31+<document source="&lt;string&gt;">
32 <paragraph>
33 Test
34 </paragraph>
35@@ -40,6 +48,13 @@
36 """)
37 bodyindents = b("""\
38 <document source="&lt;string&gt;">
39+ <paragraph>Test</paragraph>
40+ <transition/>
41+ <paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph>
42+</document>
43+""")
44+ bodyindents_old = b("""\
45+<document source="&lt;string&gt;">
46 <paragraph>
47 Test
48 </paragraph>
49@@ -79,6 +94,13 @@
50 settings_overrides=settings),
51 expected)
52
53+ # New formatting introduced in versions 2.7.3 and 3.2.3 on 2011-11-18
54+ # to fix http://bugs.python.org/issue4147
55+ if (sys.version_info < (2, 7, 3) or
56+ sys.version_info[0] == 3 and sys.version_info < (3, 2, 3)):
57+ bodynewlines = bodynewlines_old
58+ bodyindents = bodyindents_old
59+
60
61 if __name__ == '__main__':
62 import unittest
063
=== modified file 'debian/patches/fix-error-reporting-encoding-issues.diff'
--- debian/patches/fix-error-reporting-encoding-issues.diff 2011-10-23 22:59:02 +0000
+++ debian/patches/fix-error-reporting-encoding-issues.diff 2012-08-19 07:58:22 +0000
@@ -1,6 +1,6 @@
1Description: Fix encoding issues in error reporting for Python 3.1Description: Fix encoding issues in error reporting for Python 3.
2Origin: upstream, http://svn.berlios.de/viewvc/docutils/trunk/docutils/docutils/error_reporting.py?r1=7073&r2=71962Origin: upstream, http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/docutils/error_reporting.py?r1=7073&r2=7196
3Last-Update: 2011-10-233Last-Update: 2011-12-31
44
5--- a/docutils/error_reporting.py5--- a/docutils/error_reporting.py
6+++ b/docutils/error_reporting.py6+++ b/docutils/error_reporting.py
77
=== modified file 'debian/patches/fix-io-encoding-issues.diff'
--- debian/patches/fix-io-encoding-issues.diff 2011-10-23 22:59:02 +0000
+++ debian/patches/fix-io-encoding-issues.diff 2012-08-19 07:58:22 +0000
@@ -1,7 +1,7 @@
1Description: Fix encoding issues in file I/O for Python 3.1Description: Fix encoding issues in file I/O for Python 3.
2Bug: http://sourceforge.net/tracker/?func=detail&aid=3395948&group_id=38414&atid=4220302Bug: http://sourceforge.net/tracker/?func=detail&aid=3395948&group_id=38414&atid=422030
3Origin: upstream, http://svn.berlios.de/viewvc/docutils/trunk/docutils/docutils/io.py?r1=7073&r2=71963Origin: upstream, http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/docutils/io.py?r1=7073&r2=7196
4Last-Update: 2011-10-234Last-Update: 2011-12-31
55
6--- a/docutils/io.py6--- a/docutils/io.py
7+++ b/docutils/io.py7+++ b/docutils/io.py
88
=== added file 'debian/patches/no-test-skipping.diff'
--- debian/patches/no-test-skipping.diff 1970-01-01 00:00:00 +0000
+++ debian/patches/no-test-skipping.diff 2012-08-19 07:58:22 +0000
@@ -0,0 +1,17 @@
1Description: Do not skip tests.
2 If Build-Depends are satisfied, importing ElementTree should not fail. If it
3 does, it's better to fail than to skip the test silently.
4Author: Jakub Wilk <jwilk@debian.org>
5Forwarded: not-needed
6Last-Update: 2012-03-02
7
8--- a/test/test_writers/test_odt.py
9+++ b/test/test_writers/test_odt.py
10@@ -74,6 +74,7 @@
11 from elementtree import ElementTree as etree
12 WhichElementTree = 'elementtree'
13 except ImportError, e:
14+ raise
15 s1 = '\nSkipped test of odf_odt writer. ' \
16 'In order to test odf_odt writer ' \
17 'must install either a version of Python containing ' \
018
=== modified file 'debian/patches/series'
--- debian/patches/series 2011-12-17 14:11:08 +0000
+++ debian/patches/series 2012-08-19 07:58:22 +0000
@@ -9,5 +9,7 @@
9add-missing-import.diff9add-missing-import.diff
10fix-error-reporting-encoding-issues.diff10fix-error-reporting-encoding-issues.diff
11fix-io-encoding-issues.diff11fix-io-encoding-issues.diff
12fix-docutilsxmltestcase.diff
13fix-docutilsxmltestcase-debian.diff
14no-test-skipping.diff
12move-data-to-usr-share.diff15move-data-to-usr-share.diff
13disable-DocutilsXMLTestCase.diff
1416
=== modified file 'debian/patches/testall-no-stdout-stderr-redirect.diff'
--- debian/patches/testall-no-stdout-stderr-redirect.diff 2011-10-23 22:59:02 +0000
+++ debian/patches/testall-no-stdout-stderr-redirect.diff 2012-08-19 07:58:22 +0000
@@ -1,6 +1,6 @@
1Description: Don't copy test suite output to a log.1Description: Don't copy test suite output to a log.
2 When running the test suite, don't copy stdout and stderr output to a log2 When running the test suite, don't copy stdout and stderr output to a log
3 file, as this would break under LC_ALL=C, PYTHONWARNING=d and python3.X.3 file, as this would break under LC_ALL=C, PYTHONWARNINGS=d and python3.X.
4Author: Jakub Wilk <jwilk@debian.org>4Author: Jakub Wilk <jwilk@debian.org>
5Forwarded: not-needed5Forwarded: not-needed
6Last-Update: 2011-09-186Last-Update: 2011-09-18
77
=== modified file 'debian/python-docutils.postinst'
--- debian/python-docutils.postinst 2011-06-28 20:43:04 +0000
+++ debian/python-docutils.postinst 2012-08-19 07:58:22 +0000
@@ -1,19 +1,6 @@
1#!/bin/sh1#!/bin/sh
2set -e2set -e
33
4# python-support prior to 1.0.14 doesn't correctly handle replacing directory
5# with a regular file. The following snippet works around this bug:
6if [ "$1" = configure ]
7then
8 for pydir in /usr/lib/pymodules/python2.*/
9 do
10 if [ -d $pydir/docutils-0.7.egg-info/ ]
11 then
12 rm -rf $pydir/docutils-0.7.egg-info/
13 fi
14 done
15fi
16
17if [ "$1" = configure ]4if [ "$1" = configure ]
18then5then
19 for exe in /usr/share/docutils/scripts/python2/*6 for exe in /usr/share/docutils/scripts/python2/*
207
=== removed file 'debian/rst2odt_prepstyles.sgml'
--- debian/rst2odt_prepstyles.sgml 2009-12-13 19:54:12 +0000
+++ debian/rst2odt_prepstyles.sgml 1970-01-01 00:00:00 +0000
@@ -1,62 +0,0 @@
1<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.5//EN">
2<refentry id="rst2odt_prepstyles">
3 <refmeta>
4 <refentrytitle>rst2odt_prepstyles</refentrytitle>
5 <manvolnum>1</manvolnum>
6 <refmiscinfo class="date">July 2008</refmiscinfo>
7 <refmiscinfo class="source"></refmiscinfo>
8 <refmiscinfo class="title">odtwriter</refmiscinfo>
9 </refmeta>
10
11 <refnamediv>
12 <refname>rst2odt_prepstyles</refname>
13 <refpurpose>strip paper size specifications off of rst2odt stylesheets</refpurpose>
14 </refnamediv>
15
16 <refsynopsisdiv>
17 <cmdsynopsis>
18 <command>rst2odt_prepstyles</command>
19 <arg choice="req"><replaceable>FILE</replaceable></arg>
20 </cmdsynopsis>
21 </refsynopsisdiv>
22
23 <refsect1>
24 <title>DESCRIPTION</title>
25
26 <para>
27 <command>rst2odt(1)</command> uses a stylesheet file as a template
28 for the ODT files it creates. The stock
29 <filename>styles.odt</filename> file shipped with it comes without
30 page dimensions. When <command>rst2odt</command> is run and
31 detects that there no paper size is given in the stylesheet, it is
32 automatically determined using <command>paperconf(1)</command>.
33 </para>
34
35 <para>
36 When editing stylesheets with OpenOffice.org Writer (or similar
37 programs), the resulting files always carry a page size.
38 <command>rst2odt</command> respects this setting and ensures that
39 documents processed with custom stylesheets look the same
40 regardless of the host it is running on. If you want to get the
41 original behavior, i.e. a system-dependent paper size, you can run
42 <command>rst2odt_prepstyles</command> over your custom stylesheet.
43 Remember to re-run the command whenever you change the file with a
44 word processor.
45 </para>
46 </refsect1>
47
48 <refsect1>
49 <title>AUTHOR</title>
50
51 <para>
52 odtwriter is Copyright &copy; 2006-2008 Dave Kuhlman
53 &lt;<email>dkuhlman@rexx.com</email>&gt;
54 </para>
55
56 <para>
57 This manual page was written by Michael Schutte for the Debian
58 GNU/Linux system (but may be used by others).
59 </para>
60 </refsect1>
61</refentry>
62<!-- vim: set sw=2 sts=2 et tw=72: -->
630
=== added file 'debian/rst2odt_prepstyles.txt'
--- debian/rst2odt_prepstyles.txt 1970-01-01 00:00:00 +0000
+++ debian/rst2odt_prepstyles.txt 2012-08-19 07:58:22 +0000
@@ -0,0 +1,38 @@
1==================
2rst2odt_prepstyles
3==================
4
5----------------------------------------------------------
6strip paper size specifications off of rst2odt stylesheets
7----------------------------------------------------------
8
9:Manual section: 1
10:Manual group: text processing
11
12Synopsis
13========
14**rst2odt_prepstyles** *FILE*
15
16Description
17===========
18
19**rst2odt**\(1) uses a stylesheet file as a template for the ODT files it
20creates. The stock **styles.odt** file shipped with it comes without page
21dimensions. When **rst2odt** is run and detects that there no paper size is
22given in the stylesheet, it is automatically determined using
23**paperconf**\(1).
24
25When editing stylesheets with OpenOffice.org Writer (or similar programs), the
26resulting files always carry a page size. **rst2odt** respects this setting
27and ensures that documents processed with custom stylesheets look the same
28regardless of the host it is running on. If you want to get the original
29behavior, i.e. a system-dependent paper size, you can run
30**rst2odt_prepstyles** over your custom stylesheet. Remember to re-run the
31command whenever you change the file with a word processor.
32
33Author
34======
35odtwriter is Copyright © 2006-2008 Dave Kuhlman <dkuhlman@rexx.com>
36
37This manual page was written by Michael Schutte for the Debian GNU/Linux system
38(but may be used by others).
039
=== modified file 'debian/rules'
--- debian/rules 2011-12-17 14:11:08 +0000
+++ debian/rules 2012-08-19 07:58:22 +0000
@@ -20,11 +20,14 @@
20pre_strip_images2 = 's,<img alt="([^"]*)"[^>]*\bsrc="http://[^"]+"[^>]*>,$$1,g;'20pre_strip_images2 = 's,<img alt="([^"]*)"[^>]*\bsrc="http://[^"]+"[^>]*>,$$1,g;'
21pre_strip_images = $(pre_strip_images1)$(pre_strip_images2)21pre_strip_images = $(pre_strip_images1)$(pre_strip_images2)
2222
23python_all = pyversions -r $(CURDIR)/debian/control | tr ' ' '\n' | xargs -t -I {} env {}
24python3_all = $(patsubst py%,py3%,$(python_all))
25
23build build-indep: build-stamp26build build-indep: build-stamp
24build-stamp:27build-stamp:
25 dh_testdir28 dh_testdir
26 # Check if move-data-to-usr-share.diff is up-to-date29 # Check if move-data-to-usr-share.diff is up-to-date
27 if grep -r __file__ docutils/ | grep -vw _datadir; then \30 if grep -r __file__ --include='*.py' docutils/ | grep -vw _datadir; then \
28 echo "Error: Some uses of __file__ are not guarded by _datadir()." \31 echo "Error: Some uses of __file__ are not guarded by _datadir()." \
29 "Is move-data-to-usr-share.diff up-to-date?"; \32 "Is move-data-to-usr-share.diff up-to-date?"; \
30 exit 1; \33 exit 1; \
@@ -35,15 +38,9 @@
35 python3 setup.py build --build-lib=build/py3/38 python3 setup.py build --build-lib=build/py3/
36ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)39ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
37 # Run test suite for Python 2.X:40 # Run test suite for Python 2.X:
38 set -ex && cd build/py2/ && \41 cd build/py2/ && $(python_all) ../../test/alltests.py --verbose
39 for python in $(shell pyversions -r); do \
40 $$python ../../test/alltests.py; \
41 done
42 # Run test suite for Python 3.X:42 # Run test suite for Python 3.X:
43 set -ex && cd build/py3/ && \43 cd build/py3/ && $(python3_all) test/alltests.py --verbose
44 for python in $(shell py3versions -r); do \
45 $$python test/alltests.py; \
46 done
47endif44endif
48 # Build documentation:45 # Build documentation:
49 PYTHONPATH=.:extras python tools/buildhtml.py \46 PYTHONPATH=.:extras python tools/buildhtml.py \
@@ -58,7 +55,6 @@
5855
59clean:56clean:
60 dh_testdir57 dh_testdir
61 dh_testroot
62 rm -f build-stamp58 rm -f build-stamp
63 rm -rf build/59 rm -rf build/
64 find -name '*.py[co]' -delete60 find -name '*.py[co]' -delete
@@ -104,13 +100,20 @@
104 PYTHONPATH=.:extras; \100 PYTHONPATH=.:extras; \
105 export PYTHONPATH; \101 export PYTHONPATH; \
106 cp debian/$$exe.txt debian/tmp/man/$$exe.txt; \102 cp debian/$$exe.txt debian/tmp/man/$$exe.txt; \
107 python debian/tmp/usr/share/docutils/scripts/python2/$$exe --help \103 python debian/tmp/usr/share/docutils/scripts/python2/$$exe --help | \
104 sed \
105 -e '1 s/^Usage$$/Synopsis/' \
106 -e 's/^=/====/' \
107 -e '3 s/^ //' \
108 -e '4 a Description' \
109 -e '4 a ===========' \
108 >> debian/tmp/man/$$exe.txt;\110 >> debian/tmp/man/$$exe.txt;\
109 python tools/rst2man.py debian/tmp/man/$$exe.txt \111 python tools/rst2man.py debian/tmp/man/$$exe.txt \
110 debian/tmp/man/$$exe.1; \112 debian/tmp/man/$$exe.1; \
111 done113 done
112 docbook-to-man debian/rst2odt_prepstyles.sgml > \114 PYTHONPATH=.:extras python tools/rst2man.py debian/rst2odt_prepstyles.txt \
113 debian/tmp/man/rst2odt_prepstyles.1115 debian/tmp/man/rst2odt_prepstyles.1
116 sed -i -e 's,"\(docutils/writers/\),"/usr/share/\1,g' debian/tmp/man/*
114117
115# Build architecture-independent files here.118# Build architecture-independent files here.
116binary-indep: build install119binary-indep: build install
117120
=== added file 'test/test_writers/test_docutils_xml.py'
--- test/test_writers/test_docutils_xml.py 1970-01-01 00:00:00 +0000
+++ test/test_writers/test_docutils_xml.py 2012-08-19 07:58:22 +0000
@@ -0,0 +1,115 @@
1#!/usr/bin/env python
2
3# $Id: test_docutils_xml.py 5889 2009-04-01 20:00:21Z gbrandl $
4# Author: Lea Wiemann <LeWiemann@gmail.com>
5# Copyright: This module has been placed in the public domain.
6
7"""
8Test for docutils XML writer.
9"""
10
11from __init__ import DocutilsTestSupport
12
13import sys
14import docutils
15import docutils.core
16from docutils._compat import b
17
18if sys.version_info[:3] in [(2, 7, 2), (3, 2, 2)]:
19 import xml.dom.minidom as minidom
20 if minidom.parseString('<x><y>z</y></x>').toprettyxml() == '<?xml version="1.0" ?>\n<x>\n\t<y>z</y>\n</x>\n':
21 sys_version_info = sys.version_info[:2] + (3, 'candidate', 0)
22 class sys:
23 version_info = sys_version_info
24 del sys_version_info
25 del minidom
26
27class DocutilsXMLTestCase(DocutilsTestSupport.StandardTestCase):
28
29 input = b("""\
30Test
31
32----------
33
34Test. \xc3\xa4\xc3\xb6\xc3\xbc\xe2\x82\xac""")
35 xmldecl = b('<?xml version="1.0" encoding="iso-8859-1"?>\n')
36 doctypedecl = b('<!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" "http://docutils.sourceforge.net/docs/ref/docutils.dtd">\n')
37 generatedby = b('<!-- Generated by Docutils %s -->\n' % docutils.__version__)
38 bodynormal = b('<document source="&lt;string&gt;"><paragraph>Test</paragraph><transition/><paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph></document>')
39 bodynewlines = b("""\
40<document source="&lt;string&gt;">
41<paragraph>Test</paragraph>
42<transition/>
43<paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph>
44</document>
45""")
46 bodynewlines_old = b("""\
47<document source="&lt;string&gt;">
48<paragraph>
49Test
50</paragraph>
51<transition/>
52<paragraph>
53Test. \xe4\xf6\xfc&#8364;
54</paragraph>
55</document>
56""")
57 bodyindents = b("""\
58<document source="&lt;string&gt;">
59 <paragraph>Test</paragraph>
60 <transition/>
61 <paragraph>Test. \xe4\xf6\xfc&#8364;</paragraph>
62</document>
63""")
64 bodyindents_old = b("""\
65<document source="&lt;string&gt;">
66 <paragraph>
67 Test
68 </paragraph>
69 <transition/>
70 <paragraph>
71 Test. \xe4\xf6\xfc&#8364;
72 </paragraph>
73</document>
74""")
75
76 def test_publish(self):
77 settings = {'input_encoding': 'utf8',
78 'output_encoding': 'iso-8859-1',
79 '_disable_config': 1}
80 for settings['newlines'] in 0, 1:
81 for settings['indents'] in 0, 1:
82 for settings['xml_declaration'] in 0, 1:
83 for settings['doctype_declaration'] in 0, 1:
84
85 expected = b('')
86 if settings['xml_declaration']:
87 expected += self.xmldecl
88 if settings['doctype_declaration']:
89 expected += self.doctypedecl
90 expected += self.generatedby
91 if settings['indents']:
92 expected += self.bodyindents
93 elif settings['newlines']:
94 expected += self.bodynewlines
95 else:
96 expected += self.bodynormal
97
98 self.assertEqual(docutils.core.publish_string
99 (source=self.input,
100 reader_name='standalone',
101 writer_name='docutils_xml',
102 settings_overrides=settings),
103 expected)
104
105 # New formatting introduced in versions 2.7.3 and 3.2.3 on 2011-11-18
106 # to fix http://bugs.python.org/issue4147
107 if (sys.version_info < (2, 7, 3) or
108 sys.version_info[0] == 3 and sys.version_info < (3, 2, 3)):
109 bodynewlines = bodynewlines_old
110 bodyindents = bodyindents_old
111
112
113if __name__ == '__main__':
114 import unittest
115 unittest.main()
0116
=== modified file 'test/test_writers/test_odt.py'
--- test/test_writers/test_odt.py 2011-08-22 18:50:14 +0000
+++ test/test_writers/test_odt.py 2012-08-19 07:58:22 +0000
@@ -74,6 +74,7 @@
74 from elementtree import ElementTree as etree74 from elementtree import ElementTree as etree
75 WhichElementTree = 'elementtree'75 WhichElementTree = 'elementtree'
76 except ImportError, e:76 except ImportError, e:
77 raise
77 s1 = '\nSkipped test of odf_odt writer. ' \78 s1 = '\nSkipped test of odf_odt writer. ' \
78 'In order to test odf_odt writer ' \79 'In order to test odf_odt writer ' \
79 'must install either a version of Python containing ' \80 'must install either a version of Python containing ' \

Subscribers

People subscribed via source and target branches