[Python-checkins] CVS: python/dist/src/Doc/tools mkmodindex,1.8,1.9

Fred L. Drake python-dev@python.org
Tue, 28 Nov 2000 08:20:55 -0800


Update of /cvsroot/python/python/dist/src/Doc/tools
In directory slayer.i.sourceforge.net:/tmp/cvs-serv21012/tools

Modified Files:
	mkmodindex 
Log Message:

Use a subclass of buildindex.Node to clean up the HTML and get the
ordering fixed up (this makes sure that "xml.dom" comes before
"xml.dom.minidom" in the Module Index, which was not true before because
some HTML cruft crept into the data structures).


Index: mkmodindex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkmodindex,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** mkmodindex	2000/10/05 05:14:26	1.8
--- mkmodindex	2000/11/28 16:20:50	1.9
***************
*** 49,52 ****
--- 49,69 ----
  
  
+ class Node(buildindex.Node):
+     annotation = ""
+ 
+     def __init__(self, link, str, seqno):
+         parts = str.split(None, 1)
+         if parts[0].endswith("</tt>"):
+             self.modname = parts[0][:-5]
+         else:
+             self.modname = parts[0]
+         if len(parts) == 2:
+             self.annotation = parts[1]
+         buildindex.Node.__init__(self, link, self.modname, seqno)
+ 
+     def __str__(self):
+         return '<tt class="module">%s</tt> %s' \
+                % (self.modname, self.annotation)
+ 
  _rx = re.compile(
      "<dt><a href='(module-.*\.html)#l2h-\d+'><tt class='module'>"
***************
*** 84,91 ****
                  has_plat_flag = has_plat_flag or m.group(3)
                  linkfile = os.path.join(dirname, basename)
!                 nodes.append(buildindex.Node(
!                     '<a href="%s">' % linkfile,
!                     "<tt class=module>%s</tt>" % modname,
!                     seqno))
                  seqno = seqno + 1
          ifp.close()
--- 101,105 ----
                  has_plat_flag = has_plat_flag or m.group(3)
                  linkfile = os.path.join(dirname, basename)
!                 nodes.append(Node('<a href="%s">' % linkfile, modname, seqno))
                  seqno = seqno + 1
          ifp.close()