예제 #1
0
파일: funcs.py 프로젝트: gap-system/GapWWW
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
예제 #2
0
파일: funcs.py 프로젝트: markuspf/GapWWW
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
예제 #3
0
파일: funcs.py 프로젝트: gap-system/GapWWW
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")
예제 #4
0
파일: funcs.py 프로젝트: gap-system/Mixer
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' )
예제 #5
0
파일: funcs.py 프로젝트: gap-system/GapWWW
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
예제 #6
0
파일: funcs.py 프로젝트: gap-system/Mixer
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