116 setting_value = settings.get(plugin_id, {}).get(settings_key)
118 if not setting_value:
122 if isinstance(setting_value, str):
123 setting_value = get_yaml_cfg(setting_value)
125 if isinstance(setting_value, list):
126 return {re.compile(r)
for r
in setting_value}
128 if isinstance(setting_value, dict):
129 return {re.compile(p): r
for (p, r)
in setting_value.items()}
145 for pattern, replacement
in replacements.items():
148 result[parsed] = result[parsed]._replace(netloc=pattern.sub(replacement, result[parsed].netloc))
149 result[
'url'] = urlunparse(result[parsed])
152 for url_field
in _url_fields:
153 if not result.get(url_field):
156 url_src = urlparse(result[url_field])
157 if pattern.search(url_src.netloc):
158 url_src = url_src._replace(netloc=pattern.sub(replacement, url_src.netloc))
159 result[url_field] = urlunparse(url_src)
161 for pattern
in removables:
165 for url_field
in _url_fields:
166 if not result.get(url_field):
169 url_src = urlparse(result[url_field])
170 if pattern.search(url_src.netloc):
171 del result[url_field]
173 for pattern
in low_priority:
175 result[
'priority'] =
'low'
177 for pattern
in high_priority:
179 result[
'priority'] =
'high'