solidipes.loaders.cached_metadata module

class solidipes.loaders.cached_metadata.CachedMetadata(**kwargs)[source]

Bases: DataContainer

classmethod _cancel_scheduled_commit() None[source]

Cancel scheduled commit.

classmethod _commit() None[source]

Update cached metadata database.

_get_default_cached_attributes() set[source]

Build the list of cached fields from the class description.

classmethod _get_zodb_file_storage(path: str) FileStorage[source]
_global_cached_metadata = None
classmethod _init_cached_metadata(initial_path='.') None[source]
classmethod _populate_cached_metadata_from_yaml(initial_path='.') None[source]

Populate cached metadata from YAML file.

_read_only = False
classmethod _schedule_commit() None[source]

Schedule later update of metadata database.

_scheduled_commit = None
_scheduler = <sched.scheduler object>
_storage = None
_transaction_manager = <transaction._manager.TransactionManager object>
classmethod _write_cached_metadata_to_yaml(initial_path='.') None[source]

Write cached metadata to YAML file.

class cached_loadable(fget, *args, **kwargs)

Bases: loadable

Decorator for loadables that are saved to cache.

wrapped_fset(obj, value) None
classmethod clear_cache(exclude=[]) None[source]
clear_cached_metadata(fields=[]) None[source]
classmethod close_cached_metadata() None[source]
classmethod commit_if_scheduled() None[source]

Commit if a commit is scheduled.

disable_validator(name: str) None[source]

Disable a specific validator.

enable_validator(name: str) None[source]

Enable a specific validator.

static force_unlock() None[source]
get_cached_metadata()[source]
static get_global_cached_metadata() OOBTree[source]
static get_read_write_file(path)[source]
property global_cached_metadata: OOBTree
invalidate()[source]
static is_cache_database_locked() bool[source]
is_cache_invalid()[source]
load_cached_metadata()[source]

Load cached metadata and put in _data_collection (as attributes).

property modified_time[source]
save_field_to_cache(key) None[source]
set_cached_metadata_entry(key, value) None[source]
update_cached_metadata() None[source]

Update cached metadata with instance’s fields listed in cached_attributes.

classmethod update_global_cached_metadata(unique_identifier=None) None[source]

Update cached metadata dictionary.

property validator_enabled[source]

Dictionary of validator names and enabled status.

class solidipes.loaders.cached_metadata.ObservableDict(data: dict | DataContainer, callback=<built-in function callable>)[source]

Bases: object

clear() None[source]
items()[source]
keys()[source]
pop(key)[source]
replace(data) None[source]

Replace the dictionary with a new one.

update(data) None[source]
solidipes.loaders.cached_metadata._default_cached_attributes = {}

List of @cached_loadable in the class

class solidipes.loaders.cached_metadata.cached_loadable(fget, *args, **kwargs)[source]

Bases: loadable

Decorator for loadables that are saved to cache.

wrapped_fset(obj, value) None[source]