diff options
author | Adam Tauber <asciimoo@gmail.com> | 2014-12-24 20:34:08 +0100 |
---|---|---|
committer | Adam Tauber <asciimoo@gmail.com> | 2014-12-24 20:34:08 +0100 |
commit | ada01cb367fbb226397c0542ca30684581e38568 (patch) | |
tree | c3ec0192d58fbd4e80b0be37af8825937d1bf339 /searx/webapp.py | |
parent | 5857141e498e80c1528ac13091ae374e807cbf75 (diff) | |
parent | 83d6f366596829f2140f84c73b684bd7f783e93c (diff) | |
download | searxng-ada01cb367fbb226397c0542ca30684581e38568.tar.gz searxng-ada01cb367fbb226397c0542ca30684581e38568.zip |
Merge branch 'Detect-favicons' of https://github.com/Cqoicebordel/searx into Cqoicebordel-Detect-favicons
Conflicts:
searx/templates/courgette/result_templates/default.html
searx/templates/courgette/result_templates/map.html
searx/templates/courgette/result_templates/videos.html
searx/templates/default/result_templates/default.html
searx/templates/default/result_templates/map.html
searx/templates/default/result_templates/videos.html
searx/webapp.py
Diffstat (limited to 'searx/webapp.py')
-rw-r--r-- | searx/webapp.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/searx/webapp.py b/searx/webapp.py index 915fb3564..8d1676808 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -65,9 +65,12 @@ app.secret_key = settings['server']['secret_key'] babel = Babel(app) -#TODO configurable via settings.yml -favicons = ['wikipedia', 'youtube', 'vimeo', 'dailymotion', 'soundcloud', - 'twitter', 'stackoverflow', 'github', 'deviantart', 'kickass'] +global_favicons = [] +for indice, theme in enumerate(themes): + global_favicons.append([]) + theme_img_path = searx_dir+"/static/"+theme+"/img/" + for (dirpath, dirnames, filenames) in os.walk(theme_img_path): + global_favicons[indice].extend(filenames) cookie_max_age = 60 * 60 * 24 * 365 * 23 # 23 years @@ -233,10 +236,6 @@ def index(): else: result['pretty_url'] = result['url'] - for engine in result['engines']: - if engine in favicons: - result['favicon'] = engine - # TODO, check if timezone is calculated right if 'publishedDate' in result: result['pubdate'] = result['publishedDate'].strftime('%Y-%m-%d %H:%M:%S%z') @@ -289,7 +288,8 @@ def index(): suggestions=search.suggestions, answers=search.answers, infoboxes=search.infoboxes, - theme=get_current_theme_name() + theme=get_current_theme_name(), + favicons=global_favicons[themes.index(get_current_theme_name())] ) |