1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-08-13 16:53:54 -04:00
SickRage/lib/cachecontrol/wrapper.py
echel0n 05410e2aa0 Switched TVDB/TVRage CacheHandlers to CacheControl.
Replaced urllib2 with requests for both TVDB and TVRage.
Updated cache cleanup code to process both TVDB and TVRage cache folders.
2014-03-14 10:15:39 -07:00

11 lines
301 B
Python

from cachecontrol.adapter import CacheControlAdapter
from cachecontrol.cache import DictCache
def CacheControl(sess, cache=None, cache_etags=True):
cache = cache or DictCache()
adapter = CacheControlAdapter(cache, cache_etags=cache_etags)
sess.mount('http://', adapter)
return sess