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)
| 43 | |
| 44 | |
| 45 | def 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 | |
| 56 | class SettingsAttribute: |
no outgoing calls