Exemplo n.º 1
0
def get_tilley_file():
    ents = bfiles.SimpleFile('src/credits.dat')
    mans = {}
    for ent in ents:
        if ent[0] == 'c' and ent[2] == 'DT' and ent[1].startswith('man/'):
            mans.setdefault(ent[1][4:], list())
            mans[ent[1][4:]].append(ent[3])
    return mans
Exemplo n.º 2
0
def get_credit_file():
    ents = bfiles.SimpleFile('src/credits.dat')
    dirs = {}
    for ent in ents:
        if ent[0] == 'c':
            dirs.setdefault(ent[1], dict())
            dirs[ent[1]][ent[3]] = ent[2]
    return dirs
Exemplo n.º 3
0
def blister(pif):
    pif.render.print_html()
    #global pagename
    #pagename = pif.form.get_str('page', 'blister')

    dblist = bfiles.SimpleFile(
        useful.relpath(config.SRC_DIR, pif.page_name + '.dat'))

    print pif.render.format_head()
    useful.header_done()
    print do_tree_page(pif, dblist)
    print pif.render.format_tail()
Exemplo n.º 4
0
def calendar(pif):
    pif.render.hierarchy_append('/', 'Home')
    pif.render.hierarchy_append(pif.request_uri, 'Calendar')
    pif.render.print_html()

    dblist = bfiles.SimpleFile(
        os.path.join(config.SRC_DIR, pif.page_name + '.dat'))

    lrange = None
    lsection = dict(columns=list(), headers=dict(), range=list(), note='')
    llistix = dict(section=[lsection])

    for llist in dblist:

        cmd = llist.get_arg()

        if (cmd == 'h'):
            for iarg in range(1, llist.args()):
                arg = llist.get_arg(' ')
                lsection['columns'].append(arg)
                lsection['headers'][arg] = arg

        elif (cmd == 'm'):
            lrange['entry'].append(
                dict(zip(lsection['columns'], event(pif, 'meet', llist))))

        elif (cmd == 's'):
            lrange['entry'].append(
                dict(zip(lsection['columns'], event(pif, 'show', llist))))

        elif (cmd == 'n'):
            if lrange:
                lsection['range'].append(lrange)
            lrange = dict(entry=list(), name=llist.get_arg(' ', 1))

        elif (cmd == 'e'):
            if lrange:
                lsection['range'].append(lrange)
            lrange = None

    if lrange:
        lsection['range'].append(lrange)

    return pif.render.format_template('simplelistix.html', llineup=llistix)
Exemplo n.º 5
0
def blister_things(pif):
    dblist = bfiles.SimpleFile(useful.relpath(config.SRC_DIR, 'blister.dat'))
    for llist in dblist:
        if llist[0] == 'm':
            if llist[1].endswith('p'):
                print llist[3]