MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / _exists_on_disk

Method _exists_on_disk

src/commoncode/resource.py:849–857  ·  view source on GitHub ↗

Return True if Resource `path` exists in the codebase disk cache.

(self, path)

Source from the content-addressed store, hash-verified

847 return isinstance(self.resources_by_path.get(path), Resource)
848
849 def _exists_on_disk(self, path):
850 """
851 Return True if Resource `path` exists in the codebase disk cache.
852 """
853 path = clean_path(path)
854 if not self._exists_in_memory(path):
855 cache_location = self._get_resource_cache_location(path, create_dirs=False)
856 if cache_location:
857 return exists(cache_location)
858
859 # FIXME: the PATH SHOULD NOT INCLUDE THE ROOT NAME
860 def get_resource(self, path):

Calls 3

_exists_in_memoryMethod · 0.95
clean_pathFunction · 0.85