SILENT KILLERPanel

Current Path: > > lib > python2.7 > site-packages > pip > _vendor > cachecontrol > caches


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 ]

Files and Folders in: //lib/python2.7/site-packages/pip/_vendor/cachecontrol/caches

NameTypeSizeLast ModifiedActions
__init__.py File 369 bytes April 21 2022 18:08:21.
__init__.pyc File 614 bytes April 21 2022 18:08:34.
__init__.pyo File 614 bytes April 21 2022 18:08:34.
file_cache.py File 3532 bytes April 21 2022 18:08:21.
file_cache.pyc File 3839 bytes April 21 2022 18:08:34.
file_cache.pyo File 3839 bytes April 21 2022 18:08:34.
redis_cache.py File 973 bytes April 21 2022 18:08:21.
redis_cache.pyc File 2393 bytes April 21 2022 18:08:34.
redis_cache.pyo File 2393 bytes April 21 2022 18:08:34.

Reading File: //lib/python2.7/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py

from __future__ import division

from datetime import datetime


def total_seconds(td):
    """Python 2.6 compatability"""
    if hasattr(td, 'total_seconds'):
        return td.total_seconds()

    ms = td.microseconds
    secs = (td.seconds + td.days * 24 * 3600)
    return (ms + secs * 10**6) / 10**6


class RedisCache(object):

    def __init__(self, conn):
        self.conn = conn

    def get(self, key):
        return self.conn.get(key)

    def set(self, key, value, expires=None):
        if not expires:
            self.conn.set(key, value)
        else:
            expires = expires - datetime.now()
            self.conn.setex(key, total_seconds(expires), value)

    def delete(self, key):
        self.conn.delete(key)

    def clear(self):
        """Helper for clearing all the keys in a database. Use with
        caution!"""
        for key in self.conn.keys():
            self.conn.delete(key)

    def close(self):
        self.conn.disconnect()

SILENT KILLER Tool