arcache package

Submodules

Module contents

init

class arcache.Cache(config_file: pathlib.Path = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/arcache/checkouts/latest/arcache/default.ini'), debug: bool = False)[source]

Bases: object

This provides the LRU cache logic.

cache_loaded = False
clear(persistent: bool = False)[source]

This allows us to clear the cache contents, if persistent is set to True the saved cache file will also be removed.

get()[source]

This fetches items from the cache.

keys() list[source]

Simulates a normal dictionary’s keys method.

load_cache_file()[source]

load the cache file.

load_image()[source]

This will load an image file into data and cleanup the file instance.

Take careful note of the image open, load, update, and close operations used here. If this process is improperly altered it will result in significant memory leakage.

log(*args, **kwargs)[source]

Really simple-ass logger.

put()[source]

This stores items into the cache.

refresh(resave: bool = False)[source]

Refreshes our cache contents.

param resave: If set to true this will force an update of the saved BIN file.

save_cache_file()[source]

In the event we are using a cached bin file, this will save / update it.

trim()[source]

resizes the cache to fit params.

update(kwargs: dict)[source]

Simulates a normal dictionary’s update method.