.oO SearXNG Developer Documentation Oo.
|
Public Member Functions | |
None | __init__ (self) |
int | __hash__ (self) |
__eq__ (self, other) | |
bool | init (self, flask.Flask app) |
bool | pre_search (self, SXNG_Request request, "SearchWithPlugins" search) |
bool | on_result (self, SXNG_Request request, "SearchWithPlugins" search, Result result) |
None|typing.Sequence[Result] | post_search (self, SXNG_Request request, "SearchWithPlugins" search) |
Static Public Attributes | |
typing | id .ClassVar[str] |
typing | default_on .ClassVar[bool] |
list | keywords = [] |
logging | log .Logger |
None searx.plugins._core.Plugin.__init__ | ( | self | ) |
Definition at line 94 of file _core.py.
References __init__(), id, and log.
Referenced by __init__().
searx.plugins._core.Plugin.__eq__ | ( | self, | |
other ) |
int searx.plugins._core.Plugin.__hash__ | ( | self | ) |
The hash value is used in :py:obj:`set`, for example, when an object is added to the set. The hash value is also used in other contexts, e.g. when checking for equality to identify identical plugins from different sources (name collisions).
Definition at line 106 of file _core.py.
References id.
bool searx.plugins._core.Plugin.init | ( | self, | |
flask.Flask | app ) |
Initialization of the plugin, the return value decides whether this plugin is active or not. Initialization only takes place once, at the time the WEB application is set up. The base methode always returns ``True``, the methode can be overwritten in the inheritances, - ``True`` plugin is active - ``False`` plugin is inactive
Reimplemented in searx.plugins._core.ModulePlugin.
Definition at line 120 of file _core.py.
Referenced by searx.sqlitedb.SQLiteAppl.connect().
bool searx.plugins._core.Plugin.on_result | ( | self, | |
SXNG_Request | request, | ||
"SearchWithPlugins" | search, | ||
Result | result ) |
Runs for each result of each engine and returns a boolean: - ``True`` to keep the result - ``False`` to remove the result from the result list The ``result`` can be modified to the needs. .. hint:: If :py:obj:`Result.url` is modified, :py:obj:`Result.parsed_url` must be changed accordingly: .. code:: python result["parsed_url"] = urlparse(result["url"])
Reimplemented in searx.plugins._core.ModulePlugin.
Definition at line 140 of file _core.py.
None | typing.Sequence[Result] searx.plugins._core.Plugin.post_search | ( | self, | |
SXNG_Request | request, | ||
"SearchWithPlugins" | search ) |
Runs AFTER the search request. Can return a list of :py:obj:`Result` objects to be added to the final result list.
Reimplemented in searx.plugins._core.ModulePlugin, searx.plugins.hash_plugin.SXNGPlugin, and searx.plugins.self_info.SXNGPlugin.
Definition at line 159 of file _core.py.
bool searx.plugins._core.Plugin.pre_search | ( | self, | |
SXNG_Request | request, | ||
"SearchWithPlugins" | search ) |
Runs BEFORE the search request and returns a boolean: - ``True`` to continue the search - ``False`` to stop the search
Reimplemented in searx.plugins._core.ModulePlugin.
Definition at line 132 of file _core.py.
|
static |
|
static |
Definition at line 75 of file _core.py.
Referenced by __hash__(), and __init__().
|
static |
Definition at line 87 of file _core.py.
Referenced by __init__().