def setIndexLink(template, indexFilename):
    indexLinks = domhelpers.findElementsWithAttribute(template,
                                                      "class",
                                                      "index-link")
    for link in indexLinks:
        if indexFilename is None:
            link.parentNode.removeChild(link)
        else:
            link.nodeName = link.tagName = link.endTagName = 'a'
            for attrName in link.attributes.keys():
                link.removeAttribute(attrName)
            link.setAttribute('href', indexFilename)
Insert a link to an index document.
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/lore/tree.py/setIndexLink