MCPcopy
hub / github.com/scrapy/scrapy / get_settings_priority

Function get_settings_priority

scrapy/settings/__init__.py:45–53  ·  view source on GitHub ↗

Small helper function that looks up a given string priority in the :attr:`~scrapy.settings.SETTINGS_PRIORITIES` dictionary and returns its numerical value, or directly returns a given numerical priority.

(priority: int | str)

Source from the content-addressed store, hash-verified

43
44
45def get_settings_priority(priority: int | str) -> int:
46 """
47 Small helper function that looks up a given string priority in the
48 :attr:`~scrapy.settings.SETTINGS_PRIORITIES` dictionary and returns its
49 numerical value, or directly returns a given numerical priority.
50 """
51 if isinstance(priority, str):
52 return SETTINGS_PRIORITIES[priority]
53 return priority
54
55
56class SettingsAttribute:

Callers 4

maxpriorityMethod · 0.85
setMethod · 0.85
deleteMethod · 0.85

Calls

no outgoing calls

Tested by 1