Esempio n. 1
0
class StaticEngine(static.File):
    isLeaf = False
    hit = util.HitCounter()

    def __init__(self, *args, **kwargs):
        static.File.__init__(self, *args, **kwargs)

    def render(self, request):
        self.hit(request)
        request = apply_gzip(request)
        return static.File.render(self, request)

    @property
    def adminEngine(self):
        return {
            #"GZip cache": [
            #("Contents: %s" % pprint.pformat(list(cache.keys())),)# AdminEngineAction("clear", d))
            #],
            "Hits": [
                (self.hit, ),
            ]
        }

    def directoryListing(self):
        return error.ForbiddenResource()
Esempio n. 2
0
class StaticEngine(static.File):
    isLeaf = False
    hit = util.HitCounter()

    def __init__(self, *args, **kwargs):
        static.File.__init__(self, *args, **kwargs)

    def render(self, request):
        self.hit(request)
        # temporarily disabled -- seems to eat big pages
        #        if GZIP_ENCODER:
        #            request._encoder = GZIP_ENCODER.encoderForRequest(request) # HACK
        return static.File.render(self, request)

    @property
    def adminEngine(self):
        return {
            #  "GZip cache": [
            #    ("Contents: %s" % pprint.pformat(list(cache.keys())),)# AdminEngineAction("clear", d))
            #  ],
            "Hits": [
                (self.hit, ),
            ]
        }

    def directoryListing(self):
        return resource.ForbiddenResource()
Esempio n. 3
0
 def __init__(self, prefix):
   self.prefix = prefix
   self.__hit = util.HitCounter()