MCPcopy
hub / github.com/scrapy/scrapy / stat_file

Method stat_file

scrapy/pipelines/files.py:321–329  ·  view source on GitHub ↗
(
        self, path: str, info: MediaPipeline.SpiderInfo
    )

Source from the content-addressed store, hash-verified

319 return {}
320
321 def stat_file(
322 self, path: str, info: MediaPipeline.SpiderInfo
323 ) -> Deferred[StatInfo]:
324
325 blob_path = self._get_blob_path(path)
326 d: Deferred[Any] = deferred_from_coro(
327 run_in_thread(self.bucket.get_blob, blob_path)
328 )
329 return d.addCallback(self._onsuccess)
330
331 def _get_content_type(self, headers: dict[str, str] | None) -> str:
332 if headers and "Content-Type" in headers:

Callers 2

test_persistMethod · 0.95

Calls 3

_get_blob_pathMethod · 0.95
deferred_from_coroFunction · 0.90
run_in_threadFunction · 0.90

Tested by 2

test_persistMethod · 0.76