MCPcopy
hub / github.com/scrapy/scrapy / load_pre_crawler_settings

Method load_pre_crawler_settings

scrapy/addons.py:58–72  ·  view source on GitHub ↗

Update early settings that do not require a crawler instance, such as SPIDER_MODULES. Similar to the load_settings method, this loads each add-on configured in the ``ADDONS`` setting and calls their 'update_pre_crawler_settings' class method if present. This method doesn't h

(cls, settings: BaseSettings)

Source from the content-addressed store, hash-verified

56
57 @classmethod
58 def load_pre_crawler_settings(cls, settings: BaseSettings) -> None:
59 """Update early settings that do not require a crawler instance, such as SPIDER_MODULES.
60
61 Similar to the load_settings method, this loads each add-on configured in the
62 ``ADDONS`` setting and calls their 'update_pre_crawler_settings' class method if present.
63 This method doesn't have access to the crawler instance or the addons list.
64
65 :param settings: The :class:`~scrapy.settings.BaseSettings` object from \
66 which to read the early add-on configuration
67 :type settings: :class:`~scrapy.settings.Settings`
68 """
69 for clspath in build_component_list(settings["ADDONS"]):
70 addoncls = load_object(clspath)
71 if hasattr(addoncls, "update_pre_crawler_settings"):
72 addoncls.update_pre_crawler_settings(settings)

Callers 1

__init__Method · 0.80

Calls 3

build_component_listFunction · 0.90
load_objectFunction · 0.90

Tested by

no test coverage detected