From 5c8382c1ba46ddef8d58c01b7517a156b305635c Mon Sep 17 00:00:00 2001 From: asciimoo Date: Sun, 1 Dec 2013 23:52:49 +0100 Subject: [PATCH] [enh] favicon added --- searx/static/img/favicon.png | Bin 0 -> 495 bytes searx/templates/base.html | 1 + searx/webapp.py | 17 +++++++++++------ 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 searx/static/img/favicon.png diff --git a/searx/static/img/favicon.png b/searx/static/img/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..0e3863cd08101853e875fea9e9dc88af2f382774 GIT binary patch literal 495 zcmVJq0eneB zK~y-)jg!kOMNt&Sf9GD0y7E69-3%1sW*||E+A?5bK*_*Z_UVRpl> zT9g1Mat<_7-tK`8uX>RVMArETXfoe5Z~#05tw48>Uk}`bDk^~9pm@ux4u>6_$Pln; z&pEF;7{)WeWYXEI4m**s7_Yho%$ut}JwgWPGJF7hTaqmoU>kS`DxF9^O;Bz4iQnx7 z_%vLTCb%?QNMxr*z`jm}xv$a$D~5ZV$Uq`HxQ|+3$#Rap>TB2}1FQp&_TF_OGe8^A z>_kR@5|Fd_$&WiQsRiIT@W0v2m1Xv^;8mv*g;@iod>n5Bb#^QnAZrC@z#-6Jr0w}Q z&Uw{+C-Uu-lbN$Xi^)Fqst*?5OWnb$R~?J^!@?iPi7W!+rX&Jp|0F1*a19tW_eb`> l1h>UvLb8*O<99%S=`Z {% block title %}{% endblock %}searx + {% block styles %} {% endblock %} {% block head %} diff --git a/searx/webapp.py b/searx/webapp.py index deb99995e..bd1528390 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -17,10 +17,10 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >. (C) 2013- by Adam Tauber, ''' +import os if __name__ == "__main__": from sys import path - from os.path import realpath, dirname - path.append(realpath(dirname(realpath(__file__))+'/../')) + path.append(os.path.realpath(os.path.dirname(os.path.realpath(__file__))+'/../')) from flask import Flask, request, render_template, url_for, Response, make_response from searx.engines import search, categories, engines, get_engines_stats @@ -28,6 +28,8 @@ from searx import settings import json import cStringIO from searx.utils import UnicodeWriter +from flask import send_from_directory + app = Flask(__name__) @@ -133,10 +135,6 @@ def index(): return resp -@app.route('/favicon.ico', methods=['GET']) -def fav(): - return '' - @app.route('/about', methods=['GET']) def about(): global categories @@ -172,6 +170,13 @@ def opensearch(): mimetype="application/xml") return resp +@app.route('/favicon.ico') +def favicon(): + print os.path.join(app.root_path, 'static/img'), 'asdf' + return send_from_directory(os.path.join(app.root_path, 'static/img'), + 'favicon.png', mimetype='image/vnd.microsoft.icon') + + if __name__ == "__main__": from gevent import monkey monkey.patch_all()