pkgcheck.addons.caches module

Base cache support.

class pkgcheck.addons.caches.Cache[source]

Bases: object

Mixin for data caches.

class pkgcheck.addons.caches.CacheData(type: str, file: str, version: int)[source]

Bases: object

Cache registry data.

file: str
type: str
version: int
exception pkgcheck.addons.caches.CacheDisabled(cache)[source]

Bases: PkgcheckException

Exception flagging that a requested cache type is disabled.

class pkgcheck.addons.caches.CachedAddon(options, **kwargs)[source]

Bases: Addon

Mixin for addon classes that create/use data caches.

cache = None
cache_file(repo)[source]

Return the cache file for a given repository.

A unique token using the repo’s location is used so separate repos using the same identifier don’t use the same cache file.

caches = {<class 'pkgcheck.addons.eclass.EclassAddon'>: CacheData(type='eclass', file='eclass.pickle', version=5), <class 'pkgcheck.addons.git.GitAddon'>: CacheData(type='git', file='git.pickle', version=5), <class 'pkgcheck.addons.profiles.ProfileAddon'>: CacheData(type='profiles', file='profiles.pickle', version=2)}
existing_caches

Mapping of all existing cache types to file paths.

load_cache(path, fallback=None)[source]
remove_caches()[source]

Remove all or selected caches.

save_cache(data, path)[source]
update_cache(repo=None, force=False)[source]

Update related cache and push updates to disk.

class pkgcheck.addons.caches.DictCache(data, cache)[source]

Bases: UserDict, Cache

Dictionary-based cache that encapsulates data.