@@ -8,35 +8,23 @@ from os.path import realpath, dirname, join, sep
88repo_root = realpath(dirname(realpath(__file__)) + sep + '..')
99sys.path.insert(0, repo_root)
1010
11−from searx.settings_loader import load_settings
12−
13−settings, settings_load_message = load_settings()
14−print(settings_load_message)
15−
16−brand_env = 'utils' + sep + 'brand.env'
17−brand_py = 'searx' + sep + 'brand.py'
18−
19−def get_val(group, name, default=''):
20− return settings[group].get(name, False) or ''
11+from searx import brand
2112
2213name_val = [
23− ('SEARX_URL' , get_val('server', 'base_url')),
24− ('GIT_URL' , get_val('general','git_url')),
25− ('GIT_BRANCH' , get_val('general','git_branch')),
26− ('ISSUE_URL' , get_val('general','issue_url')),
27− ('DOCS_URL' , get_val('general','docs_url')),
28− ('PUBLIC_INSTANCES' , get_val('general','public_instances')),
29− ('CONTACT_URL' , get_val('general','contact_url')),
30− ('WIKI_URL' , get_val('general','wiki_url')),
31− ('TWITTER_URL' , get_val('general','twitter_url')),
14+ ('SEARX_URL' , brand.SEARX_URL),
15+ ('GIT_URL' , brand.GIT_URL),
16+ ('GIT_BRANCH' , brand.GIT_BRANCH),
17+ ('ISSUE_URL' , brand.ISSUE_URL),
18+ ('DOCS_URL' , brand.DOCS_URL),
19+ ('PUBLIC_INSTANCES' , brand.PUBLIC_INSTANCES),
20+ ('CONTACT_URL' , brand.CONTACT_URL),
21+ ('WIKI_URL' , brand.WIKI_URL),
22+ ('TWITTER_URL' , brand.TWITTER_URL),
3223]
3324
25+brand_env = 'utils' + sep + 'brand.env'
26+
3427print('build %s' % brand_env)
3528with open(repo_root + sep + brand_env, 'w', encoding='utf-8') as f:
3629 for name, val in name_val:
3730 print("export %s='%s'" % (name, val), file=f)
38−
39−print('build %s' % brand_py)
40−with open(repo_root + sep + brand_py, 'w', encoding='utf-8') as f:
41− for name, val in name_val:
42− print("%s = '%s'" % (name, val), file=f)