-
Notifications
You must be signed in to change notification settings - Fork 14
/
search.cgi
85 lines (79 loc) · 3.46 KB
/
search.cgi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/python2
# -*- coding: utf-8 -*-
import sqlite3 as lite
import re
import cgi, cgitb
import os
from helper import wrap
cgitb.enable()
print("Content-type: text/html\n")
if __name__ == "__main__":
search_page = """
<form id="search" action="results.cgi" method="GET" accept-charset="UTF-8">
<table>
<tr>
<td>
Coptic Word: </td><td><input type="text" name="coptic" id="coptic" class="keyboardInput" lang="cop">
</td></tr>
<tr>
<td>Dialect:</td>
<td><select name="dialect" id="dialect_select" class="search_dropdown">
<option value="any">Any</option>
<option value="A">A: Akhmimic</option>
<option value="K">Ak: Old Coptic</option>
<option value="B">B: Bohairic</option>
<option value="F">F: Fayyumic</option>
<option value="M">M: Mesokemic</option>
<option value="L">L: Lycopolitan</option>
<option value="P">P: Proto-Theban</option>
<option value="S">S: Sahidic</option>
<option value="V">V: South Fayyumic Greek</option>
<option value="W">W: Crypto-Mesokemic Greek</option>
<option value="?">?: Greek (usage unclear)</option>
</select>
</td></tr>
<tr><td>Scriptorium tag:</td>
<td><select name="pos" class="search_dropdown" id="pos_select">
<option value="any">Any</option>
<option value="A">A</option>
<option value="ART">ART</option>
<option value="C">C</option>
<option value="CONJ">CONJ</option>
<option value="N">N</option>
<option value="NEG">NEG</option>
<option value="NUM">NUM</option>
<option value="PDEM">PDEM</option>
<option value="PINT">PINT</option>
<option value="PPER">PPER</option>
<option value="PPERO">PPERO</option>
<option value="PPOS">PPOS</option>
<option value="PREP">PREP</option>
<option value="PTC">PTC</option>
<option value="V">V</option>
<option value="VBD">VBD</option>
<option value="VSTAT">VSTAT</option>
</select>
</td></tr>
<tr><td>Definition:</td><td> <input type="text" name="definition" id="definition"></td></tr>
<tr><td> </td><td><div>Definition text:
<div> <input type="radio" name="def_search_type" value="exact sequence" checked>exact sequence</input><br/>
<input type="radio" name="def_search_type" value="all words">contains all words</input></div></div>
<div>Definition language:<br>
<select name="lang" class="search_dropdown" id="lang">
<option value="any">Any</option>
<option value="en">English</option>
<option value="fr">French</option>
<option value="de">German</option>
</select>
</div>
</td></tr></table>
<input type="submit" value="Search" class="search_button" id="search_submit">
</form>
"""
wrapped = wrap(search_page)
kbd_include = """
<script type="text/javascript" src="js/keyboard.js" charset="UTF-8"></script>
<link rel="stylesheet" type="text/css" href="css/keyboard.css?version=2">
"""
wrapped = wrapped.replace("<head>\n","<head>"+kbd_include)
print(wrapped)