Example #1
0
File: index.py Project: jperla/weby
def index(p):
    with p(html.html()):
        with p(html.body({'style':'width:600px'})):
            p(html.h1('Weby'))
            p(templates())
            p(apps())
            p(urls())
Example #2
0
def template_index(p, query, results):
    with p(html.html()):
        with p(html.head()):
            p(html.title('%s - WordNet' % query))
        with p(html.body()):
            #p(html.a(html.h1('WordNet'), {'href':'/', 'style':'text-decoration:none;color:black;'}))
            with p(html.form({'action':'', 'method':'GET'})):
                p(html.input_text('query', query))
                p(html.input_submit(value='Search WordNet'))
            if not results == None:
                if results == []:
                    p(html.p('No synsets found'))
                else:
                    for result, synonyms, definition, relations, images in results:
                        p(partial_result(query, result, synonyms, definition, relations, images))
Example #3
0
def page_layout(p, title, inside):
    with p(html.html()):
        with p(html.head()):
            p(html.title(title))
        with p(html.body()):
            p(inside)