.oO SearXNG Developer Documentation Oo.
|
Public Member Functions | |
save_data (self) | |
'EngineTraitsMap' | from_data (cls) |
'EngineTraitsMap' | fetch_traits (cls, Callable log) |
set_traits (self, Engine|types.ModuleType engine) | |
Public Member Functions inherited from searx.enginelib.traits.EngineTraits | |
get_language (self, str searxng_locale, default=None) | |
get_region (self, str searxng_locale, default=None) | |
bool | is_locale_supported (self, str searxng_locale) |
copy (self) | |
Static Public Attributes | |
tuple | ENGINE_TRAITS_FILE = (data_dir / 'engine_traits.json').resolve() |
Static Public Attributes inherited from searx.enginelib.traits.EngineTraits | |
Dict | regions = dataclasses.field(default_factory=dict) |
Dict | languages = dataclasses.field(default_factory=dict) |
Optional | all_locale = None |
Literal | data_type = 'traits_v1' |
Dict | custom = dataclasses.field(default_factory=dict) |
Additional Inherited Members | |
Public Attributes inherited from searx.enginelib.traits.EngineTraits | |
str | data_type = 'traits_v1': |
Protected Member Functions inherited from searx.enginelib.traits.EngineTraits | |
_set_traits_v1 (self, Engine engine) | |
A python dictionary to map :class:`EngineTraits` by engine name.
'EngineTraitsMap' searx.enginelib.traits.EngineTraitsMap.fetch_traits | ( | cls, | |
Callable | engine ) |
Call a function ``fetch_traits(engine_traits)`` from engines namespace to fetch and set properties from the origin engine in the object ``engine_traits``. If function does not exists, ``None`` is returned.
Reimplemented from searx.enginelib.traits.EngineTraits.
Definition at line 213 of file traits.py.
'EngineTraitsMap' searx.enginelib.traits.EngineTraitsMap.from_data | ( | cls | ) |
Instantiate :class:`EngineTraitsMap` object from :py:obj:`ENGINE_TRAITS`
Definition at line 205 of file traits.py.
searx.enginelib.traits.EngineTraitsMap.save_data | ( | self | ) |
Store EngineTraitsMap in in file :py:obj:`self.ENGINE_TRAITS_FILE`
Definition at line 199 of file traits.py.
References searx.enginelib.traits.EngineTraitsMap.ENGINE_TRAITS_FILE.
searx.enginelib.traits.EngineTraitsMap.set_traits | ( | self, | |
Engine | types.ModuleType | engine ) |
Set traits in a :py:obj:`Engine` namespace. :param engine: engine instance build by :py:func:`searx.engines.load_engine`
Reimplemented from searx.enginelib.traits.EngineTraits.
Definition at line 231 of file traits.py.
|
static |
Definition at line 196 of file traits.py.
Referenced by searx.enginelib.traits.EngineTraitsMap.save_data().