solidipes.loaders.cached_metadata module

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

Bases: DataContainer

classmethod _cancel_scheduled_commit()[source]

Cancel scheduled commit

classmethod _commit()[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='.')[source]
classmethod _populate_cached_metadata_from_yaml(initial_path='.')[source]

Populate cached metadata from YAML file

classmethod _schedule_commit()[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='.')[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)
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()[source]
clear_cached_metadata(fields=[])[source]
classmethod close_cached_metadata()[source]
get_cached_metadata()[source]
static get_global_cached_metadata() OOBTree[source]
property global_cached_metadata: OOBTree
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)[source]
set_cached_metadata_entry(key, value)[source]
update_cached_metadata()[source]

Update cached metadata with instance’s fields listed in cached_attributes

classmethod update_global_cached_metadata(unique_identifier=None)[source]

Update cached metadata dictionary

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)[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