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