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