MCPcopy
hub / github.com/scrapy/scrapy / getwithbase

Method getwithbase

scrapy/settings/__init__.py:325–342  ·  view source on GitHub ↗

Get a composition of a dictionary-like setting and its ``_BASE`` counterpart. Use :meth:`~scrapy.settings.BaseSettings.get_component_priority_dict_with_base` instead if the setting is a :ref:`component priority dictionary <component-priority-dictionaries>`.

(self, name: _SettingsKey)

Source from the content-addressed store, hash-verified

323 return copy.deepcopy(value)
324
325 def getwithbase(self, name: _SettingsKey) -> BaseSettings:
326 """Get a composition of a dictionary-like setting and its ``_BASE``
327 counterpart.
328
329 Use
330 :meth:`~scrapy.settings.BaseSettings.get_component_priority_dict_with_base`
331 instead if the setting is a :ref:`component priority dictionary
332 <component-priority-dictionaries>`.
333
334 :param name: name of the dictionary-like setting
335 :type name: str
336 """
337 if not isinstance(name, str):
338 raise ValueError(f"Base setting key must be a string, got {name}")
339 compbs = BaseSettings()
340 compbs.update(self[name + "_BASE"])
341 compbs.update(self[name])
342 return compbs
343
344 def get_component_priority_dict_with_base(self, name: _SettingsKey) -> BaseSettings:
345 """Get a composition of a component priority dictionary setting and

Callers 9

test_getwithbaseMethod · 0.95
__init__Method · 0.80
__init__Method · 0.80
_load_componentsMethod · 0.80
__init__Method · 0.80

Calls 2

updateMethod · 0.95
BaseSettingsClass · 0.85