[devhelp] Make html2xml.py close <sub> (GNOME bug 587986)



commit 2bf98557060a7956c28437a37cf63f5cd591f760
Author: Richard Cohen <richard daijobu co uk>
Date:   Thu Aug 27 11:29:52 2009 +0200

    Make html2xml.py close <sub> (GNOME bug 587986)

 misc/html2xml.py |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/misc/html2xml.py b/misc/html2xml.py
index 07c20af..697c1cd 100755
--- a/misc/html2xml.py
+++ b/misc/html2xml.py
@@ -127,17 +127,17 @@ print '<book title="%s"\nname=""\nbase=""\nlink="%s">' % (dict['name'], os.path.
 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
     



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]