@@ -72,10 +72,11 @@ def load(self, location: ExternalLocation) -> Generator[Path]:
7272
7373 @property
7474 def _external_files (self ):
75- if not hasattr (self , "_external_files_cache" ):
76- from inline_snapshot ._global_state import state
75+ from inline_snapshot ._global_state import state
76+
77+ if not hasattr (state (), "_external_files_cache" ):
7778
78- self ._external_files_cache = {}
79+ state () ._external_files_cache = {}
7980
8081 base_folders = {file .parent for file in state ().files_with_snapshots }
8182
@@ -85,8 +86,8 @@ def _external_files(self):
8586
8687 for folder in base_folders :
8788 for file in folder .rglob ("????????-????-????-????-????????????.*" ):
88- self ._external_files_cache [file .name ] = file
89- return self ._external_files_cache
89+ state () ._external_files_cache [file .name ] = file
90+ return state () ._external_files_cache
9091
9192 def _lookup_path (self , location : ExternalLocation ):
9293 if location .filename and location .qualname :
@@ -248,12 +249,6 @@ def _lookup_path(self, name) -> Path:
248249 def lookup_all (self , name : str ) -> set [str ]:
249250 return {file .name for file in self .directory .glob (name )}
250251
251- def lookup_all_path (self , name : str ) -> set [Path ]:
252- return {file for file in self .directory .glob (name )}
253-
254- def remove (self , name ):
255- self ._lookup_path (name ).unlink ()
256-
257252
258253def default_storages (storage_dir : Path ):
259254 return {"hash" : HashStorage (storage_dir / "external" ), "uuid" : UuidStorage ()}
0 commit comments