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