changeset 57:999825a029ee

Found a second multiline 00-INDEX entry (first in powerpc, second in networking), so teach the script to handle those.
author Rob Landley <rob@landley.net>
date Sun, 30 Sep 2007 23:30:38 -0500
parents 7fa04e9d3e4b
children 8f5d75ee17f2
files make/docdiridx.py
diffstat 1 files changed, 9 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/make/docdiridx.py	Sat Sep 29 22:39:28 2007 -0500
+++ b/make/docdiridx.py	Sun Sep 30 23:30:38 2007 -0500
@@ -17,15 +17,14 @@
   lines = lines.split("00-INDEX",1)
   if lines[0]: out.write("<pre>%s</pre>\n" % lines[0])
   lines = lines[1].split("\n")
-  lines = map(lambda a: a.strip(), lines)
   lines[0] = "00-INDEX"
 
-  idx = 0
-  while idx<len(lines):
-    if not lines[idx]:
-      idx += 1
-      continue
-    out.write('<li><a href="%s">%s</a> %s</li>\n' % (lines[idx], lines[idx], lines[idx+1]))
-    idx += 2
-  out.write("</ul>\n</body>\n</html>\n")
-
+  close = 0
+  for idx in range(len(lines)):
+    if not lines[idx]: continue
+    if not lines[idx][0].isspace():
+      if close: out.write('</li>\n')
+      out.write('<li><a href="%s">%s</a>' % (lines[idx].strip(), lines[idx].strip()))
+      close = 1
+    else: out.write(" %s" % lines[idx].strip())
+  out.write("</li>\n</ul>\n</body>\n</html>\n")