Bug#256848: html2xml.py does not close <sub>
Richard Cohen
Richard Cohen <richard@daijobu.co.uk>, 256848@bugs.debian.org
Tue, 29 Jun 2004 14:36:18 +0100
This is a multi-part message in MIME format.
--------------080304020409090804000505
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Package: devhelp
Version: 0.9-5
Severity: normal
Tags: patch
The script html2xml.py doesn't close the <sub> tag if it has no
sub-<sub>s and devhelp will complain
For example,
$ cd /usr/share/doc/
$ python devhelp/tools/html2xml.py libgtk2.0-doc/gtk-faq
...
<sub name="GTK+ FAQ Contributions, Maintainers and Copyright"
link="c958.html"></chapters>
</book>
Patch is mostly re-indenting
-- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (990, 'testing'), (101, 'experimental'), (101, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.7
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8
Versions of packages devhelp depends on:
ii libatk1.0-0 1.6.1-2 The ATK accessibility toolkit
ii libc6 2.3.2.ds1-13 GNU C Library: Shared
libraries an
ii libdevhelp-1-0 0.9-5 Library providing
documentation br
ii libglib2.0-0 2.4.2-1 The GLib library of C routines
ii libgnome2-0 2.6.1-5 The GNOME 2 library -
runtime file
ii libgnomeui-0 2.6.1.1-2 The GNOME 2 libraries (User
Interf
ii libgtk2.0-0 2.4.3-1 The GTK+ graphical user
interface
ii libpango1.0-0 1.4.0-4 Layout and rendering of
internatio
ii libxml2 2.6.10-3 GNOME XML library
-- no debconf information
--------------080304020409090804000505
Content-Type: text/x-patch;
name="html2xml.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="html2xml.diff"
--- html2xml.py 2004-04-20 19:55:14.000000000 +0100
+++ html2xml.py 2004-06-29 14:33:56.000000000 +0100
@@ -131,17 +131,17 @@
print '<chapters>'
for chap in dict['order']:
print ' <sub name="%s" link="%s">' % (chap, dict[chap]['link'])
- if not dict[chap].has_key ('order'):
- continue
- for sub in dict[chap]['order']:
- if not does_dict_have_keys (dict[chap][sub], ['link']):
- print ' <sub name="%s" link="%s">' % (sub, dict[chap][sub]['link'])
+ if dict[chap].has_key ('order'):
+ for sub in dict[chap]['order']:
+ if not does_dict_have_keys (dict[chap][sub], ['link']):
+ print ' <sub name="%s" link="%s">' % (sub, dict[chap][sub]['link'])
- for sub2 in dict[chap][sub]['order']:
- print ' <sub name="%s" link="%s"/>' % (sub2, dict[chap][sub][sub2]['link'])
- print ' </sub>'
- else:
- print ' <sub name="%s" link="%s"/>' % (sub, dict[chap][sub]['link'])
+ for sub2 in dict[chap][sub]['order']:
+ print ' <sub name="%s" link="%s"/>' % (sub2, dict[chap][sub][sub2]['link'])
+ print ' </sub>'
+ else:
+ print ' <sub name="%s" link="%s"/>' % (sub, dict[chap][sub]['link'])
+
print ' </sub>'
print
--------------080304020409090804000505--