.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.favicons Namespace Reference

Namespaces

namespace  __main__
namespace  cache
namespace  config
namespace  proxy
namespace  resolvers

Functions

 is_active ()
 init ()

Variables

list __all__ = ["init", "favicon_url", "favicon_proxy"]
 logger = logger.getChild('favicons')

Detailed Description

Implementations for providing the favicons in SearXNG.

There is a command line for developer purposes and for deeper analysis.  Here is
an example in which the command line is called in the development environment::

  $ ./manage pyenv.cmd bash --norc --noprofile
  (py3) python -m searx.favicons --help

Function Documentation

◆ init()

searx.favicons.init ( )

Definition at line 26 of file __init__.py.

26def init():
27
28 # pylint: disable=import-outside-toplevel
29
30 from . import config, cache, proxy
31 from .. import settings_loader
32
33 cfg_file = (settings_loader.get_user_cfg_folder() or pathlib.Path("/etc/searxng")) / "favicons.toml"
34 if not cfg_file.exists():
35 if is_active():
36 logger.error(f"missing favicon config: {cfg_file}")
37 cfg_file = config.DEFAULT_CFG_TOML_PATH
38
39 logger.debug(f"load favicon config: {cfg_file}")
40 cfg = config.FaviconConfig.from_toml_file(cfg_file, use_cache=True)
41 cache.init(cfg.cache)
42 proxy.init(cfg.proxy)
43
44 del cache, config, proxy, cfg, settings_loader

References is_active().

Here is the call graph for this function:

◆ is_active()

searx.favicons.is_active ( )

Definition at line 22 of file __init__.py.

22def is_active():
23 return bool(get_setting("search.favicon_resolver", False))
24
25

References searx.get_setting().

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ __all__

list searx.favicons.__all__ = ["init", "favicon_url", "favicon_proxy"]
private

Definition at line 12 of file __init__.py.

◆ logger

searx.favicons.logger = logger.getChild('favicons')

Definition at line 19 of file __init__.py.