]> jfr.im git - irc/quakenet/qwebirc.git/blame - qwebirc/root.py
Add QTicket support!
[irc/quakenet/qwebirc.git] / qwebirc / root.py
CommitLineData
9e769c12 1from ajaxengine import AJAXEngine
f065bc69 2from authgateengine import AuthgateEngine
28c8008e 3import mimetypes
9e769c12
CP
4from twisted.web import resource, server, static
5
6class RootResource(resource.Resource):
d65fe45f
CP
7 def getChild(self, name, request):
8 if name == "":
2b8e1a88 9 name = "qui.html"
d65fe45f
CP
10 return self.primaryChild.getChild(name, request)
11
9e769c12
CP
12class RootSite(server.Site):
13 def __init__(self, path, *args, **kwargs):
d65fe45f 14 root = RootResource()
9e769c12 15 server.Site.__init__(self, root, *args, **kwargs)
d65fe45f
CP
16
17 root.primaryChild = static.File(path)
9e769c12 18 root.putChild("e", AJAXEngine("/e"))
f065bc69 19 root.putChild("auth", AuthgateEngine("/auth"))
28c8008e
CP
20
21mimetypes.types_map[".ico"] = "image/vnd.microsoft.icon"
22