コード例 #1
0
ファイル: index.py プロジェクト: Weerel/Involve
html.header()

query = form.getvalue('q')
if not query:
    query = ''    

print """
<div/>
    <a href="index.py"><b>search</b></a>&nbsp;&nbsp;&nbsp;
    <a href="statistic.py">statistic</a>&nbsp;&nbsp;&nbsp;
    <a href="web.py">web model</a>
<div><br/>
<form method="post">
<input name="q" value="%s">
<input name="s" type="submit" value="search">
</form>
""" % query

try:
    index = IndexManager.get_proxy()
    if query:
        for url in index.lookup(query):
            print '<div>'
            html.a(url, url)
            print '</div>' 
except socket.error:
    html.div("can't connect to DataStorage")

html.footer()
コード例 #2
0
ファイル: web.py プロジェクト: Weerel/Involve
    s = './web.py'
    for i, x in enumerate(graph.dimensions()):
        if i == 0:
            s += '?'
        else:
            s += '&'
        s += 'd=' + str(x)
        
    for i, x in enumerate(graph.current()):
        s += '&v=' + str(x)
        
    return s

html.header()
print """
<table>
    <tr valign="top">
        <td><form action="index.py"><input name="s" type="submit" value="search"></form></td>
        <td><form action="statistic.py"><input name="s" type="submit" value="statistic"></form></td>
        <td><b>web model</b></td>
    </tr>
<table>"""
#show vector v and links to connected vectors
for i, x in enumerate(graph.current()):
    print '<div>'
    html.a(get_link(graph.prev(i)), '<<')
    print '%s (%s)' % (x, graph.dimensions()[i])
    html.a(get_link(graph.next(i)), '>>')
    print '</div>'
html.footer()
コード例 #3
0
ファイル: statistic.py プロジェクト: Weerel/Involve
def print_domains(index):
    html.div('<b>domains</b>')
    for h in index.hosts():
        print '<div>'
        html.a('http://'+h, h)
        print '</div>'