summaryrefslogtreecommitdiff
path: root/searx/webutils.py
AgeCommit message (Collapse)Author
2023-03-24[mod] replace engines_languages.json by engines_traits.jsonMarkus Heiser
Implementations of the *traits* of the engines. Engine's traits are fetched from the origin engine and stored in a JSON file in the *data folder*. Most often traits are languages and region codes and their mapping from SearXNG's representation to the representation in the origin search engine. To load traits from the persistence:: searx.enginelib.traits.EngineTraitsMap.from_data() For new traits new properties can be added to the class:: searx.enginelib.traits.EngineTraits .. hint:: Implementation is downward compatible to the deprecated *supported_languages method* from the vintage implementation. The vintage code is tagged as *deprecated* an can be removed when all engines has been ported to the *traits method*. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2023-03-17[fix] server side error: escape backslashes in the query highlight_contentSolirs
Any backslash escapes in the replacement are processed [1], backslashes should be escaped [2]. [1] https://docs.python.org/3/library/re.html#re.sub [2] https://docs.python.org/3/library/re.html#re.escape closes: - https://github.com/searxng/searxng/issues/2256 - https://github.com/searxng/searxng/issues/2250
2023-01-15A little fix and modified the testing for content highlightahmad-alkadri
2023-01-14Perso branch - added cjk check and enclosementahmad-alkadri
2022-09-27[fix] typos / reported by @kianmeng in searx PR-3366Markus Heiser
[PR-3366] https://github.com/searx/searx/pull/3366 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-09-23[mod] science category: various update of about PR 1705Alexandre Flament
2022-09-23Add searx.webutils.searxng_format_dateAlexandre FLAMENT
* Move the datetime to str code from searx.webapp.search to searx.webutils.searxng_format_date * When the month, day, hour, day and second are zero, the function returns only the year.
2022-05-07theme: remove __common__Alexandre Flament
2022-03-05[mod] URL for the static file contains the sha1Alexandre Flament
* allow to cache the static file forever * avoid bugs when the static files are updated but not reloaded
2022-01-05[enh] change categories_as_tabs from a list to a dictMartin Fischer
The tab icon names are currently hard coded in the templates. This commit lets us introduce an icon property in the future, e.g: categories_as_tabs: general: icon: search-outline
2022-01-05[refactor] make group_engines_in_tab more readableMartin Fischer
2022-01-05[mod] improve variable nameMartin Fischer
2022-01-05[mod] move group_engines_in_tab to searx.webutilsMartin Fischer
2021-12-28[mod] implement is_hmac_of() in webutils / close to new_hmac()Markus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>, Alexandre Flament
2021-12-28[mod] webutils.py: remove dead codeAlexandre Flament
secret_key can't be bytes (see settings_default.py)
2021-12-27[format.python] initial formatting of the python codeMarkus Heiser
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-06-01[mod] move all default settings into searx.settings_defaultsAlexandre Flament
2021-02-08Updated webutils.highlight_content to ignore double-quotes when highlighting ↵Daniel Hones
query parts
2020-10-05Merge pull request #2237 from dalf/mod-engines-initAlexandre Flament
Mod engines init
2020-10-05[mod] webapp.py: update engines initialization conditionAlexandre Flament
Always call initialize engines except on the first run of werkzeug with the reload feature. the reload feature is activated when: * searx_debug is True (SEARX_DEBUG environment variable or settings.yml) * FLASK_APP=searx/webapp.py FLASK_ENV=development flask run (see https://flask.palletsprojects.com/en/1.1.x/cli/ ) Fix SEARX_DEBUG=0 make docs docs/admin/engines.rst : engines are initialized See https://github.com/searx/searx/issues/2204#issuecomment-701373438
2020-10-01[mod] preferences.py: check language setting with a regex instead of ↵Alexandre Flament
match_language
2020-09-22[mod] add searx/webutils.pyAlexandre Flament
contains utility functions and classes used only by webapp.py