1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-06 01:15:05 -05:00
SickRage/lib/cachecontrol/wrapper.py
echel0n 94670f7f95 Updated our cache code.
Updated rsstorrents to not bother using requests sessions.
2014-04-22 23:24:08 -07:00

17 lines
470 B
Python

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