MCPcopy
hub / github.com/scrapy/scrapy / from_crawler

Method from_crawler

scrapy/mail.py:87–97  ·  view source on GitHub ↗
(cls, crawler: Crawler)

Source from the content-addressed store, hash-verified

85
86 @classmethod
87 def from_crawler(cls, crawler: Crawler) -> Self: # pragma: no cover
88 settings = crawler.settings
89 return cls(
90 smtphost=settings["MAIL_HOST"],
91 mailfrom=settings["MAIL_FROM"],
92 smtpuser=settings["MAIL_USER"],
93 smtppass=settings["MAIL_PASS"],
94 smtpport=settings.getint("MAIL_PORT"),
95 smtptls=settings.getbool("MAIL_TLS"),
96 smtpssl=settings.getbool("MAIL_SSL"),
97 )
98
99 def send(
100 self,

Callers 2

_apply_settingsMethod · 0.45
_create_spiderMethod · 0.45

Calls 2

getintMethod · 0.80
getboolMethod · 0.45

Tested by

no test coverage detected