index.py

 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
from mod_python import apache
from route import get_route
def handler(req):
req.log_error('handler')
# req.content_type = 'text/plain'
req.content_type = 'text/html'
req.send_http_header()
pr = get_route(req)
if pr == '1':
s_bs = '<option selected value="1">Бизнессвязь</option>'
s_tekko = '<option value="2">Текко</option>'
elif pr == '2':
s_bs = '<option value="1">Бизнессвязь</option>'
s_tekko = '<option selected value="2">Текко</option>'
else:
s_bs = '<option value="1">Бизнессвязь</option>'
s_tekko = '<option value="2">Текко</option>'
s = """\
<html>
<form action="route.py/set_route" method="POST">
Провайдер по умолчанию:
<select id="where" name="prov">
%s
%s
</select>
<input type="submit">
</form>
</html>
""" % (s_bs, s_tekko)
req.write(s)
return apache.OK