summaryrefslogtreecommitdiff
path: root/utils/build_env.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2020-12-27 14:39:48 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2021-01-11 22:12:38 +0100
commit9e53470b4cf533b890a2f57debd2f2b4198b4dd1 (patch)
tree5e041304488451cba4548fd386d625dd0cabec3a /utils/build_env.py
parent9485179064b4eb28f2813eba3c295edca3b0db7f (diff)
downloadsearxng-9e53470b4cf533b890a2f57debd2f2b4198b4dd1.tar.gz
searxng-9e53470b4cf533b890a2f57debd2f2b4198b4dd1.zip
[mod] get rid of searx/brand.py
Removes module searx/brand.py and creates a namespace at searx.brand. This patch is a first 'proof of concept'. Later we can decide to remove the brand namespace entirely or not. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'utils/build_env.py')
-rw-r--r--utils/build_env.py36
1 files changed, 12 insertions, 24 deletions
diff --git a/utils/build_env.py b/utils/build_env.py
index 0a210e8de..e7077dece 100644
--- a/utils/build_env.py
+++ b/utils/build_env.py
@@ -8,35 +8,23 @@ from os.path import realpath, dirname, join, sep
repo_root = realpath(dirname(realpath(__file__)) + sep + '..')
sys.path.insert(0, repo_root)
-from searx.settings_loader import load_settings
-
-settings, settings_load_message = load_settings()
-print(settings_load_message)
-
-brand_env = 'utils' + sep + 'brand.env'
-brand_py = 'searx' + sep + 'brand.py'
-
-def get_val(group, name, default=''):
- return settings[group].get(name, False) or ''
+from searx import brand
name_val = [
- ('SEARX_URL' , get_val('server', 'base_url')),
- ('GIT_URL' , get_val('general','git_url')),
- ('GIT_BRANCH' , get_val('general','git_branch')),
- ('ISSUE_URL' , get_val('general','issue_url')),
- ('DOCS_URL' , get_val('general','docs_url')),
- ('PUBLIC_INSTANCES' , get_val('general','public_instances')),
- ('CONTACT_URL' , get_val('general','contact_url')),
- ('WIKI_URL' , get_val('general','wiki_url')),
- ('TWITTER_URL' , get_val('general','twitter_url')),
+ ('SEARX_URL' , brand.SEARX_URL),
+ ('GIT_URL' , brand.GIT_URL),
+ ('GIT_BRANCH' , brand.GIT_BRANCH),
+ ('ISSUE_URL' , brand.ISSUE_URL),
+ ('DOCS_URL' , brand.DOCS_URL),
+ ('PUBLIC_INSTANCES' , brand.PUBLIC_INSTANCES),
+ ('CONTACT_URL' , brand.CONTACT_URL),
+ ('WIKI_URL' , brand.WIKI_URL),
+ ('TWITTER_URL' , brand.TWITTER_URL),
]
+brand_env = 'utils' + sep + 'brand.env'
+
print('build %s' % brand_env)
with open(repo_root + sep + brand_env, 'w', encoding='utf-8') as f:
for name, val in name_val:
print("export %s='%s'" % (name, val), file=f)
-
-print('build %s' % brand_py)
-with open(repo_root + sep + brand_py, 'w', encoding='utf-8') as f:
- for name, val in name_val:
- print("%s = '%s'" % (name, val), file=f)