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