mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
doc: Add and fix comment in get_favicon_or_logo()
This commit is contained in:
parent
214386d2c8
commit
3802f281dd
1 changed files with 2 additions and 1 deletions
|
@ -301,6 +301,7 @@ def get_result_template(theme_name: str, template_name: str):
|
||||||
def get_favicon_or_logo(imgtype: str, request):
|
def get_favicon_or_logo(imgtype: str, request):
|
||||||
# This method returns a favicon or regular image depending on the imgtype parameter
|
# This method returns a favicon or regular image depending on the imgtype parameter
|
||||||
# It is used to not repeat code for /favicon.ico and /logo
|
# It is used to not repeat code for /favicon.ico and /logo
|
||||||
|
# Called by logo() and favicon()
|
||||||
theme = request.preferences.get_value("theme")
|
theme = request.preferences.get_value("theme")
|
||||||
path = os.path.expanduser(settings.get("brand").get(imgtype))
|
path = os.path.expanduser(settings.get("brand").get(imgtype))
|
||||||
relpath = os.path.join(app.root_path, path)
|
relpath = os.path.join(app.root_path, path)
|
||||||
|
@ -317,7 +318,7 @@ def get_favicon_or_logo(imgtype: str, request):
|
||||||
# Otherwise we're good to go, send whatever is specified.
|
# Otherwise we're good to go, send whatever is specified.
|
||||||
filename = os.path.basename(path)
|
filename = os.path.basename(path)
|
||||||
path = os.path.dirname(path)
|
path = os.path.dirname(path)
|
||||||
# Works wih both relative and absolute.
|
# Works with both relative and absolute.
|
||||||
return send_from_directory(
|
return send_from_directory(
|
||||||
path,
|
path,
|
||||||
filename,
|
filename,
|
||||||
|
|
Loading…
Add table
Reference in a new issue