diff --git a/Doc/tools/mkmodindex b/Doc/tools/mkmodindex index 5f2da0ebc16..23a200e7eb3 100755 --- a/Doc/tools/mkmodindex +++ b/Doc/tools/mkmodindex @@ -49,26 +49,30 @@ class IndexOptions(support.Options): class Node(buildindex.Node): - annotation = "" - - def __init__(self, link, str, seqno): - parts = string.split(str, None, 1) - if parts[0][-5:] == "": - self.modname = parts[0][:-5] - else: - self.modname = parts[0] - if len(parts) == 2: - self.annotation = parts[1] + def __init__(self, link, str, seqno, platinfo): + self.annotation = platinfo or None + if str[0][-5:] == "": + str = str[:-5] + self.modname = str buildindex.Node.__init__(self, link, self.modname, seqno) + if platinfo: + s = '%s %s' \ + % (self.modname, self.annotation) + else: + s = '%s' % str + self.text = [s] def __str__(self): - return '%s %s' \ - % (self.modname, self.annotation) + if self.annotation: + return '%s %s' \ + % (self.modname, self.annotation) + else: + return '%s' % self.modname _rx = re.compile( - "