blob: 59217525c3638f97f14926fa8072eba850a67e4f (
plain)
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
|
#main url mapper
import sys
sys.path.append("../py-bin")
from utils import BasicHandler, process_request, set_logging_defaults
from jabberman import JabberManager
from login import LoginMixIn
from mail_auth import MailAuthMixIn
from setup import SetupMixIn
set_logging_defaults()
class MainHandler(BasicHandler, MailAuthMixIn, LoginMixIn, SetupMixIn):
def do_process(self, req):
command = req.params.get("cmd", "")
if command == "":
self.login_form(req)
else:
if hasattr(self, command):
method = getattr(self, command)
if hasattr(method, 'web_callable') and method.web_callable:
self.jman = JabberManager(self.session)
method(req)
else:
self.invalid_page(req)
else:
self.invalid_page(req)
def invalid_page(self, req):
self.error_page(req, "Ungueltiger Request.")
process_request(MainHandler)
|