Current Path: > > usr > lib > python2.7 > > site-packages > pip > _vendor > cachecontrol
Operation : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 Software : Apache Server IP : 162.0.232.56 | Your IP: 216.73.216.111 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
caches | Directory | - | - | |
__init__.py | File | 302 bytes | April 21 2022 18:08:21. | |
__init__.pyc | File | 583 bytes | April 21 2022 18:08:34. | |
__init__.pyo | File | 583 bytes | April 21 2022 18:08:34. | |
_cmd.py | File | 1320 bytes | April 21 2022 18:08:21. | |
_cmd.pyc | File | 2059 bytes | April 21 2022 18:08:34. | |
_cmd.pyo | File | 2059 bytes | April 21 2022 18:08:34. | |
adapter.py | File | 4608 bytes | April 21 2022 18:08:21. | |
adapter.pyc | File | 3523 bytes | April 21 2022 18:08:34. | |
adapter.pyo | File | 3523 bytes | April 21 2022 18:08:34. | |
cache.py | File | 790 bytes | April 21 2022 18:08:21. | |
cache.pyc | File | 2401 bytes | April 21 2022 18:08:34. | |
cache.pyo | File | 2401 bytes | April 21 2022 18:08:34. | |
compat.py | File | 380 bytes | April 21 2022 18:08:21. | |
compat.pyc | File | 618 bytes | April 21 2022 18:08:34. | |
compat.pyo | File | 618 bytes | April 21 2022 18:08:34. | |
controller.py | File | 13024 bytes | April 21 2022 18:08:21. | |
controller.pyc | File | 9078 bytes | April 21 2022 18:08:34. | |
controller.pyo | File | 9078 bytes | April 21 2022 18:08:34. | |
filewrapper.py | File | 2531 bytes | April 21 2022 18:08:21. | |
filewrapper.pyc | File | 2667 bytes | April 21 2022 18:08:34. | |
filewrapper.pyo | File | 2667 bytes | April 21 2022 18:08:34. | |
heuristics.py | File | 4141 bytes | April 21 2022 18:08:21. | |
heuristics.pyc | File | 5937 bytes | April 21 2022 18:08:34. | |
heuristics.pyo | File | 5937 bytes | April 21 2022 18:08:34. | |
serialize.py | File | 6536 bytes | April 21 2022 18:08:21. | |
serialize.pyc | File | 6096 bytes | April 21 2022 18:08:34. | |
serialize.pyo | File | 6096 bytes | April 21 2022 18:08:34. | |
wrapper.py | File | 498 bytes | April 21 2022 18:08:21. | |
wrapper.pyc | File | 696 bytes | April 21 2022 18:08:34. | |
wrapper.pyo | File | 696 bytes | April 21 2022 18:08:34. |
import logging from pip._vendor import requests from pip._vendor.cachecontrol.adapter import CacheControlAdapter from pip._vendor.cachecontrol.cache import DictCache from pip._vendor.cachecontrol.controller import logger from argparse import ArgumentParser def setup_logging(): logger.setLevel(logging.DEBUG) handler = logging.StreamHandler() logger.addHandler(handler) def get_session(): adapter = CacheControlAdapter( DictCache(), cache_etags=True, serializer=None, heuristic=None, ) sess = requests.Session() sess.mount('http://', adapter) sess.mount('https://', adapter) sess.cache_controller = adapter.controller return sess def get_args(): parser = ArgumentParser() parser.add_argument('url', help='The URL to try and cache') return parser.parse_args() def main(args=None): args = get_args() sess = get_session() # Make a request to get a response resp = sess.get(args.url) # Turn on logging setup_logging() # try setting the cache sess.cache_controller.cache_response(resp.request, resp.raw) # Now try to get it if sess.cache_controller.cached_request(resp.request): print('Cached!') else: print('Not cached :(') if __name__ == '__main__': main()
SILENT KILLER Tool