.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

Function Documentation

◆ init()

searx.favicons.init ( )

Definition at line 20 of file __init__.py.

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

References searx.favicons.is_active().

+ Here is the call graph for this function:

◆ is_active()

searx.favicons.is_active ( )

Definition at line 16 of file __init__.py.

16def is_active():
17 return bool(get_setting("search.favicon_resolver", False))
18
19

Referenced by searx.favicons.init().

+ Here is the caller graph for this function:

Variable Documentation

◆ __all__

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

Definition at line 6 of file __init__.py.

◆ logger

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

Definition at line 13 of file __init__.py.