diff options
author | Bnyro <bnyro@tutanota.com> | 2024-05-05 23:17:35 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarIT.de> | 2024-06-07 14:42:52 +0200 |
commit | aa59bfbf60d75508fc1f91220ed2598bf8cf97ec (patch) | |
tree | 8b975458c723a86b4b38d5882320fa8c0283dcdf /searx/settings_loader.py | |
parent | 3bec04079c027b952dee95dab194f29ea12e12a5 (diff) | |
download | searxng-aa59bfbf60d75508fc1f91220ed2598bf8cf97ec.tar.gz searxng-aa59bfbf60d75508fc1f91220ed2598bf8cf97ec.zip |
[feat] hostname replace plugin: support for external list file
Diffstat (limited to 'searx/settings_loader.py')
-rw-r--r-- | searx/settings_loader.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/searx/settings_loader.py b/searx/settings_loader.py index fe2696cce..6bf3465f0 100644 --- a/searx/settings_loader.py +++ b/searx/settings_loader.py @@ -31,6 +31,14 @@ def load_yaml(file_name): raise SearxSettingsException(e, file_name) from e +def get_yaml_file(file_name): + path = existing_filename_or_none(join(searx_dir, file_name)) + if path is None: + raise FileNotFoundError(f"File {file_name} does not exist!") + + return load_yaml(path) + + def get_default_settings_path(): return existing_filename_or_none(join(searx_dir, 'settings.yml')) |