Пример #1
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))
Пример #2
0
def hello_template(p, name):
    with p(html.form({'action':'', 'method':'GET'})):
        p(u'Hello, %s! <br />' % name)
        p(u'Your name: %s' % html.input_text('name'))
        p(html.input_submit('name'))