]>
jfr.im git - irc/quakenet/qwebirc.git/blob - qwebirc/engines/staticengine.py
1 from twisted
.web
import resource
, server
, static
, error
2 import qwebirc
.util
as util
4 from adminengine
import AdminEngineAction
6 from twisted
.web
.server
import GzipEncoderFactory
7 GZIP_ENCODER
= GzipEncoderFactory()
11 # TODO, cache gzip stuff
17 class StaticEngine(static
.File
):
19 hit
= util
.HitCounter()
21 def __init__(self
, *args
, **kwargs
):
22 static
.File
.__init
__(self
, *args
, **kwargs
)
24 def render(self
, request
):
26 # temporarily disabled -- seems to eat big pages
28 # request._encoder = GZIP_ENCODER.encoderForRequest(request) # HACK
29 return static
.File
.render(self
, request
)
32 def adminEngine(self
):
35 #("Contents: %s" % pprint.pformat(list(cache.keys())),)# AdminEngineAction("clear", d))
42 def directoryListing(self
):
43 return error
.ForbiddenResource()