Markus Heiser
57b9673efb
[mod] addition of various type hints / tbc
...
- pyright configuration [1]_
- stub files: types-lxml [2]_
- addition of various type hints
- enable use of new type system features on older Python versions [3]_
- ``.tool-versions`` - set python to lowest version we support (3.10.18) [4]_:
Older versions typically lack some typing features found in newer Python
versions. Therefore, for local type checking (before commit), it is necessary
to use the older Python interpreter.
.. [1] https://docs.basedpyright.com/v1.20.0/configuration/config-files/
.. [2] https://pypi.org/project/types-lxml/
.. [3] https://typing-extensions.readthedocs.io/en/latest/#
.. [4] https://mise.jdx.dev/configuration.html#tool-versions
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de >
Format: reST
2025-09-03 13:37:36 +02:00
Markus Heiser
36a1ef1239
[refactor] typification of SearXNG / EngineResults
...
In [1] and [2] we discussed the need of a Result.results property and how we can
avoid unclear code. This patch implements a class for the reslut-lists of
engines::
searx.result_types.EngineResults
A simple example for the usage in engine development::
from searx.result_types import EngineResults
...
def response(resp) -> EngineResults:
res = EngineResults()
...
res.add( res.types.Answer(answer="lorem ipsum ..", url="https://example.org ") )
...
return res
[1] https://github.com/searxng/searxng/pull/4183#pullrequestreview-257400034
[2] https://github.com/searxng/searxng/pull/4183#issuecomment-2614301580
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de >
2025-01-28 07:07:08 +01:00
Markus Heiser
8205f170ff
[mod] pylint all engines without PYLINT_SEARXNG_DISABLE_OPTION
...
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de >
2024-03-11 14:55:38 +01:00
Bnyro
e76ab1a4b3
[refactor] images: add resolution, image format and filesize fields
...
Co-authored-by: Markus Heiser <markus.heiser@darmarit.de >
2024-02-25 16:22:37 +01:00
Markus Heiser
8df1f0c47e
[mod] add 'Accept-Language' HTTP header to online processores
...
Most engines that support languages (and regions) use the Accept-Language from
the WEB browser to build a response that fits to the language (and region).
- add new engine option: send_accept_language_header
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de >
2022-08-01 17:01:59 +02:00
Markus Heiser
0be0e63117
[fix] demo_online.py - fixed typo
...
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de >
2022-07-25 20:04:00 +02:00
Markus Heiser
3d96a9839a
[format.python] initial formatting of the python code
...
This patch was generated by black [1]::
make format.python
[1] https://github.com/psf/black
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de >
2021-12-27 09:26:22 +01:00
Markus Heiser
79cc82a4db
[docs] add engine "Demo Online Engine"
...
This engine just exists for documentation purpose.
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de >
2021-06-04 15:05:58 +02:00