MCPcopy
hub / github.com/scrapy/scrapy / start_exporting

Method start_exporting

scrapy/extensions/feedexport.py:400–425  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

398 self._fileloaded: bool = False
399
400 def start_exporting(self) -> None:
401 if not self._fileloaded:
402 self.file = self.storage.open(self.spider)
403 if "postprocessing" in self.feed_options:
404 self.file = cast(
405 "IO[bytes]",
406 PostProcessingManager(
407 self.feed_options["postprocessing"],
408 self.file,
409 self.feed_options,
410 ),
411 )
412 self.exporter = self._get_exporter(
413 file=self.file,
414 format_=self.feed_options["format"],
415 fields_to_export=self.feed_options["fields"],
416 encoding=self.feed_options["encoding"],
417 indent=self.feed_options["indent"],
418 **self.feed_options["item_export_kwargs"],
419 )
420 self._fileloaded = True
421
422 if not self._exporting:
423 assert self.exporter
424 self.exporter.start_exporting()
425 self._exporting = True
426
427 def _get_exporter(
428 self, file: IO[bytes], format_: str, *args: Any, **kwargs: Any

Callers 2

_close_slotMethod · 0.45
item_scrapedMethod · 0.45

Calls 3

_get_exporterMethod · 0.95
openMethod · 0.45

Tested by

no test coverage detected