def _load_wrapper(self):
self._threadLock.acquire()
paths_to_eval = tuple(
set(i._item_key for i in self._registry.object_to_eval.values()))
self._registry.object_to_eval = weakref.WeakValueDictionary()
new_items = self.load(paths_to_eval)
if isinstance(new_items, MutableMapping):
self._registry.evaluated_items.update(new_items)
self._threadLock.release()
else:
self._threadLock.release()
raise Exception(
"load method needs to return a dictionary of {path: value}")
评论列表
文章目录