Example #1
0
def manual(MIXERROOT, path, filename, main, node):
    key = node.attr["manual"]
    l = len(key)
    result = []
    for i in range(len(GAPmanuals)):
        if GAPmanuals[i][0] == key:
            result.append(i)
    if len(result) == 0:
        err.write('Error: Unknown manual section: "' + key + '".\n')
        n = maxml.xmltree("a", {"href": "/gap.html"})
        if node.subs == None or len(node.subs) == 0:
            n.subs = ["EMPTY"]
        else:  # we inherit the subtree
            n.subs = node.subs
        return n
    if len(result) > 1:
        err.write('Warning: Manual section not unique: "' + key + '".\n')
    i = result[0]
    if GAPmanuals[i][1][0] == "/":
        n = maxml.xmltree("a", {"href": "{{GAPManualLink}}" + GAPmanuals[i][1]})
    else:
        n = maxml.xmltree("a", {"href": "{{GAPManualLink}}/" + GAPmanuals[i][1]})
    if node.subs == None or len(node.subs) == 0:  # empty element:
        n.subs = [GAPmanuals[i][2]]
    else:  # we inherit the subtree:
        n.subs = node.subs
    return n
Example #2
0
def manual(MIXERROOT, path, filename, main, node):
    key = node.attr['manual']
    l = len(key)
    result = []
    for i in range(len(GAPmanuals)):
        if GAPmanuals[i][0] == key:
            result.append(i)
    if len(result) == 0:
        err.write('Error: Unknown manual section: "' + key + '".\n')
        n = maxml.xmltree('a', {'href': '/gap.html'})
        if node.subs == None or len(node.subs) == 0:
            n.subs = ["EMPTY"]
        else:  # we inherit the subtree
            n.subs = node.subs
        return n
    if len(result) > 1:
        err.write('Warning: Manual section not unique: "' + key + '".\n')
    i = result[0]
    if GAPmanuals[i][1][0] == '/':
        n = maxml.xmltree('a',
                          {'href': '{{GAPManualLink}}' + GAPmanuals[i][1]})
    else:
        n = maxml.xmltree('a',
                          {'href': '{{GAPManualLink}}/' + GAPmanuals[i][1]})
    if node.subs == None or len(node.subs) == 0:  # empty element:
        n.subs = [GAPmanuals[i][2]]
    else:  # we inherit the subtree:
        n.subs = node.subs
    return n
Example #3
0
def makeentry(r, depth, text, link, a={}):
    r.append("<tr><td>")
    r.append("&nbsp;" * 2 * depth + "\n")
    # insert an anchor tag with href relative to MIXERROOT the text of
    # the link no meta information:
    n = maxml.xmltree("a", {"href": link}, None)
    n.add(text)
    n.attr.update(a)
    r.append(n)
    r.append("\n</td></tr>\n")
Example #4
0
def makeentry(r,depth,text,link,a = {}):
    r.append( '<tr><td>' )
    r.append( '&nbsp;' * 2 * depth + '\n' )
    # insert an anchor tag with href relative to MIXERROOT the text of
    # the link no meta information:
    n = maxml.xmltree('a',{'href':link},None)
    n.add(text)
    n.attr.update(a)
    r.append(n)
    r.append( '\n</td></tr>\n' )
Example #5
0
def maketop(MIXERROOT, path, filename, main, node):
    r = []
    for s in thetree.entnames:
        e = thetree.children[s]
        # insert an anchor tag with href relative to MIXERROOT the text
        # from the "tree" file, with no meta information:
        n = maxml.xmltree("a", {"href": "/" + e.path + e.file}, None)
        n.add(e.text)
        r.append(n)
        r.append("&nbsp;\n")
    return r
Example #6
0
def maketop(MIXERROOT,path,filename,main,node):
    r = []
    for s in thetree.entnames:
        e = thetree.children[s]
        # insert an anchor tag with href relative to MIXERROOT the text
        # from the "tree" file, with no meta information:
        n = maxml.xmltree('a',{'href':'/'+e.path+e.file},None)
        n.add(e.text)
        r.append(n)
        r.append('&nbsp;\n')
    return r