

def store(self, host, path, params, doc, obj):
    key = hash((host, path, frozenset(list(params.items()))))
    cachedFor = (obj.cachedUntil - obj.currentTime)
    if cachedFor:
        self.log(('%s: cached (%d seconds)' % (path, cachedFor)))
        cachedUntil = (time.time() + cachedFor)
        cached = self.cache[key] = (cachedUntil, doc)
        cacheFile = join(self.tempdir, (str(key) + '.cache'))
        f = open(cacheFile, 'wb')
        f.write(zlib.compress(pickle.dumps(cached, (- 1))))
        f.close()

dataset/ETHPy150Open ntt/eveapi/apitest.py MyCacheHandler.store/original