.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 27 of file __init__.py.

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

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

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 13 of file __init__.py.

◆ logger

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

Definition at line 20 of file __init__.py.