[Python-checkins] python/dist/src/Doc/tools buildindex.py,1.13,1.13.12.1 mkmodindex,1.15,1.15.12.1
fdrake@users.sourceforge.net
fdrake@users.sourceforge.net
Mon, 21 Jul 2003 23:44:36 -0700
Update of /cvsroot/python/python/dist/src/Doc/tools
In directory sc8-pr-cvs1:/tmp/cvs-serv28811/tools
Modified Files:
Tag: indexing-cleanup-branch
buildindex.py mkmodindex
Log Message:
First step in trying to clean up some of the support for index generation:
Make the data files slightly less irregular.
Start removing some of the formating from the data as well.
(There is a loong way to go!)
Index: buildindex.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tools/buildindex.py,v
retrieving revision 1.13
retrieving revision 1.13.12.1
diff -C2 -d -r1.13 -r1.13.12.1
*** buildindex.py 16 Oct 2002 15:27:01 -0000 1.13
--- buildindex.py 22 Jul 2003 06:44:34 -0000 1.13.12.1
***************
*** 48,57 ****
return bang_join(self.key)
- def dump(self):
- return "%s\1%s###%s\n" \
- % ("\1".join(self.links),
- bang_join(self.text),
- self.seqno)
-
def cmp_part(s1, s2):
--- 48,51 ----
***************
*** 102,109 ****
def split_entry_text(str):
- if '<' in str:
- m = _rmtt.match(str)
- if m:
- str = null_join(m.group(1, 2, 3))
return split_entry(str, 1)
--- 96,99 ----
***************
*** 111,123 ****
def load(fp):
nodes = []
- rx = re.compile("(.*)\1(.*)###(.*)$")
while 1:
line = fp.readline()
if not line:
break
! m = rx.match(line)
! if m:
! link, str, seqno = m.group(1, 2, 3)
! nodes.append(Node(link, str, seqno))
return nodes
--- 101,111 ----
def load(fp):
nodes = []
while 1:
line = fp.readline()
if not line:
break
! parts = line.split("\1", 2)
! if len(parts) == 3:
! nodes.append(Node(*parts))
return nodes
***************
*** 245,252 ****
append("\n<dt>%s%s\n<dd>\n%s<dl compact>"
% (term, extra, level * DL_LEVEL_INDENT))
! append("\n%s<dt>%s%s</a>"
% (level * DL_LEVEL_INDENT, node.links[0], node.text[-1]))
for link in node.links[1:]:
! append(",\n%s %s[Link]</a>" % (level * DL_LEVEL_INDENT, link))
previous = current
append("\n")
--- 233,241 ----
append("\n<dt>%s%s\n<dd>\n%s<dl compact>"
% (term, extra, level * DL_LEVEL_INDENT))
! append('\n%s<dt><a href="%s">%s</a>'
% (level * DL_LEVEL_INDENT, node.links[0], node.text[-1]))
for link in node.links[1:]:
! append(',\n%s <a href="%s">[Link]</a>'
! % (level * DL_LEVEL_INDENT, link))
previous = current
append("\n")
***************
*** 320,328 ****
i = i + 1
prev = node
-
-
- def dump(nodes, fp):
- for node in nodes:
- fp.write(node.dump())
--- 309,312 ----
Index: mkmodindex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tools/mkmodindex,v
retrieving revision 1.15
retrieving revision 1.15.12.1
diff -C2 -d -r1.15 -r1.15.12.1
*** mkmodindex 30 Oct 2002 21:32:39 -0000 1.15
--- mkmodindex 22 Jul 2003 06:44:34 -0000 1.15.12.1
***************
*** 123,127 ****
has_plat_flag = has_plat_flag or platinfo
linkfile = os.path.join(dirname, basename)
! nodes.append(Node('<a href="%s">' % linkfile, modname,
len(nodes), platinfo))
ifp.close()
--- 123,127 ----
has_plat_flag = has_plat_flag or platinfo
linkfile = os.path.join(dirname, basename)
! nodes.append(Node(linkfile, modname,
len(nodes), platinfo))
ifp.close()