mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-03 18:03:37 +00:00
9ac649444d
Added session handler to our cache handler so that we can pass in paramaters at the request level and use them for our cache handler to process features.
11 lines
405 B
Python
11 lines
405 B
Python
from cachecontrol.session import CacheControlSession
|
|
from cachecontrol.adapter import CacheControlAdapter
|
|
from cachecontrol.cache import DictCache
|
|
|
|
def CacheControl(sess=None, cache=None, cache_etags=True):
|
|
sess = sess or CacheControlSession()
|
|
cache = cache or DictCache()
|
|
adapter = CacheControlAdapter(sess, cache, cache_etags=cache_etags)
|
|
sess.mount('http://', adapter)
|
|
|
|
return sess
|