PaferaPy Async 0.1
ASGI framework focused on simplicity and efficiency
|
Simple filesystem cache implementation for storing binary objects. More...
Public Member Functions | |
def | __init__ (self, cachedir='cache', timeout=10, keepcharacters=['_']) |
Creates an instance of the cache. More... | |
def | Load (self, path) |
Returns a binary object stored in the system, or an empty string if the object has expired. More... | |
def | SanitizePath (self, path) |
Turns path from the application identifier into a name suitable for the file system. More... | |
def | Store (self, path, data) |
Stores data as a binary object into the system. More... | |
Public Attributes | |
cachedir | |
keepcharacters | |
timeout | |
Simple filesystem cache implementation for storing binary objects.
Simply call cache.Store() to save the object and cache.Load() to get the object back. path identifies the object while timeout determines how long the object will be saved before timeout.
def pafera.cache.Cache.__init__ | ( | self, | |
cachedir = 'cache' , |
|||
timeout = 10 , |
|||
keepcharacters = ['_'] |
|||
) |
def pafera.cache.Cache.Load | ( | self, | |
path | |||
) |
def pafera.cache.Cache.SanitizePath | ( | self, | |
path | |||
) |
def pafera.cache.Cache.Store | ( | self, | |
path, | |||
data | |||
) |