comparison env/lib/python3.9/site-packages/pip/_vendor/cachecontrol/wrapper.py @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4f3585e2f14b
1 from .adapter import CacheControlAdapter
2 from .cache import DictCache
3
4
5 def CacheControl(
6 sess,
7 cache=None,
8 cache_etags=True,
9 serializer=None,
10 heuristic=None,
11 controller_class=None,
12 adapter_class=None,
13 cacheable_methods=None,
14 ):
15
16 cache = DictCache() if cache is None else cache
17 adapter_class = adapter_class or CacheControlAdapter
18 adapter = adapter_class(
19 cache,
20 cache_etags=cache_etags,
21 serializer=serializer,
22 heuristic=heuristic,
23 controller_class=controller_class,
24 cacheable_methods=cacheable_methods,
25 )
26 sess.mount("http://", adapter)
27 sess.mount("https://", adapter)
28
29 return sess