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.

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(func)

Bases: loadable

Decorator class to indicate that a loadable must be cached.

foo(obj, *args, **kwargs)
foo_setter(obj, value, *args, **kwargs) None
class cached_property(fget=None, fset=None, fdel=None, doc=None)

Bases: property

Decorator class to indicate that a property must be cached.

classmethod clear_cache(exclude=[]) None[source]
clear_cached_metadata(fields=[]) None[source]
classmethod close_cached_metadata() None[source]
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]
property global_cached_metadata: OOBTree
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: NoReturn[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.

solidipes.loaders.cached_metadata._default_cached_attributes = {}

List of @cached_property and @cached_loadable in the class

class solidipes.loaders.cached_metadata.cached_loadable(func)[source]

Bases: loadable

Decorator class to indicate that a loadable must be cached.

foo(obj, *args, **kwargs)[source]
foo_setter(obj, value, *args, **kwargs) None[source]
class solidipes.loaders.cached_metadata.cached_property(fget=None, fset=None, fdel=None, doc=None)[source]

Bases: property

Decorator class to indicate that a property must be cached.