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