diff options
author | Alexandre Flament <alex@al-f.net> | 2021-01-11 11:49:06 +0100 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2021-01-11 22:59:52 +0100 |
commit | 424e6abc7e26c3e3be71678d00f88cf09d6c0a7e (patch) | |
tree | dd7b86fab43086d386ec0b886ad0767a450d187d /searx/__init__.py | |
parent | d5882147e0a56303e5a324e2afad5297727d0048 (diff) | |
download | searxng-424e6abc7e26c3e3be71678d00f88cf09d6c0a7e.tar.gz searxng-424e6abc7e26c3e3be71678d00f88cf09d6c0a7e.zip |
[mod] settings.yml: move brand settings to a dedicated section
Diffstat (limited to 'searx/__init__.py')
-rw-r--r-- | searx/__init__.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/searx/__init__.py b/searx/__init__.py index 7f76022e1..11adbba73 100644 --- a/searx/__init__.py +++ b/searx/__init__.py @@ -66,43 +66,43 @@ class _brand_namespace: @classmethod def get_val(cls, group, name, default=''): - return settings[group].get(name, False) or '' + return settings.get(group, {}).get(name) or default @property def SEARX_URL(self): return self.get_val('server', 'base_url') @property + def CONTACT_URL(self): + return self.get_val('general', 'contact_url') + + @property def GIT_URL(self): - return self.get_val('general', 'git_url') + return self.get_val('brand', 'git_url') @property def GIT_BRANCH(self): - return self.get_val('general', 'git_branch') + return self.get_val('brand', 'git_branch') @property def ISSUE_URL(self): - return self.get_val('general', 'issue_url') + return self.get_val('brand', 'issue_url') @property def DOCS_URL(self): - return self.get_val('general', 'docs_url') + return self.get_val('brand', 'docs_url') @property def PUBLIC_INSTANCES(self): - return self.get_val('general', 'public_instances') - - @property - def CONTACT_URL(self): - return self.get_val('general', 'contact_url') + return self.get_val('brand', 'public_instances') @property def WIKI_URL(self): - return self.get_val('general', 'wiki_url') + return self.get_val('brand', 'wiki_url') @property def TWITTER_URL(self): - return self.get_val('general', 'twitter_url') + return self.get_val('brand', 'twitter_url') brand = _brand_namespace() |