summaryrefslogtreecommitdiff
path: root/searx/preferences.py
AgeCommit message (Collapse)Author
2022-04-30[theme] peel out oscar from SearXNG developmentMarkus Heiser
This is the first step of removing oscar theme Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-02-20[mod] infinite_scroll as preferenceAlexandre Flament
* oscar theme: code from searx/plugins/infinite_scroll.py * simple theme: new implementation Co-authored-by: Markus Heiser <markus.heiser@darmarIT.de>
2022-01-13[fix] make BooleanChoices only set cookies that vary from the defaultMartin Fischer
The bug was inadvertently introduced by the refactor in 180d4d068b4c629ab99876b55046f98455b88149. Fixes #746.
2022-01-06[refactor] refactor SwitchableSettingMartin Fischer
The previous implementation used two hash sets and a list. ... that's not necessary ... a single hash map suffices. And it's also less error prone ... because the previous data structure allowed a setting to be enabled and disabled at the same time.
2022-01-06[refactor] stop SwitchableSetting from subclassing SettingMartin Fischer
Previously the default_value was abused for the cookie name. Having SwitchableSetting subclass Setting doesn't even make sense in the first place since none of the Setting methods apply.
2022-01-06[refactor] remove pointless tupleMartin Fischer
2022-01-06[refactor] add type hints & remove Setting._post_initMartin Fischer
Previously the Setting classes used a horrible _post_init hack that prevented proper type checking.
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[fix] stop setting superfluous cookies for "non tab categories"Martin Fischer
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-12-27[format.python] disable py code formatting for some hunks of codeMarkus Heiser
Disable the python code formatting from python-black, where the readability of code suffers by formatting. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-11-24Merge pull request #485 from dalf/pref_query_in_titleAlexandre Flament
[mod] new preference: query_in_title
2021-11-19[enh] simple theme: add "simple-style" preferencesAlexandre Flament
2021-11-08[mod] new preference: query_in_titleAlexandre Flament
* disable by default * settings.yml: ui.query_in_title * in /preferences: privacy tab when enabled, the result page's title contains the user query. previously: * oscar theme: the query was always included * simple theme: the query was included with the GET method
2021-10-26[enh] reduce the available language listAlexandre Flament
close #406 settings['search']['languages'] contains the languages codes and 'all'
2021-09-07[pylint] searx: drop no longer needed 'missing-function-docstring'Markus Heiser
Suggested-by: @dalf https://github.com/searxng/searxng/issues/102#issuecomment-914168470 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-08-31[pylint] Pylint 2.10 - fix use-list-literal & use-dict-literalMarkus Heiser
Pylint 2.10 added new default checks [1]: use-list-literal Emitted when list() is called with no arguments instead of using [] use-dict-literal Emitted when dict() is called with no arguments instead of using {} [1] https://pylint.pycqa.org/en/latest/whatsnew/2.10.html Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-08-03[mod] settings.yml: remove localesAlexandre Flament
There are detected from the searx/translations directory
2021-07-03[pylint] prepare for pylint v2.9.3 / fix some (new) pylint issuesMarkus Heiser
Upgrade from pylint v2.8.3 to 2.9.3 raise some new issues:: searx/search/checker/__main__.py:37:26: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) searx/search/checker/__main__.py:38:26: R1732: Consider using 'with' for resource-allocating operations (consider-using-with) searx/search/processors/__init__.py:20:0: R0402: Use 'from searx import engines' instead (consider-using-from-import) searx/preferences.py:182:19: C0207: Use data.split('-', maxsplit=1)[0] instead (use-maxsplit-arg) searx/preferences.py:506:15: R1733: Unnecessary dictionary index lookup, use 'user_setting' instead (unnecessary-dict-index-lookup) searx/webapp.py:436:0: C0206: Consider iterating with .items() (consider-using-dict-items) searx/webapp.py:950:4: C0206: Consider iterating with .items() (consider-using-dict-items) Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-26[fix] decoding of saved preferences in the URLMarkus Heiser
To compress saved preferences in the URL was introduced in 5f758b2d3 and slightly fixed in 8f4401462. But the main fail was not fixed; The decompress function returns a binary string and this binary should first be decoded to a string before it is passed to urllib.parse_qs. BTW: revert the hot-fix from 5973491 Related-to: https://github.com/searxng/searxng/issues/166 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-06-01[mod] move all default settings into searx.settings_defaultsAlexandre Flament
2021-04-26[pylint] tag PYLINT_FILES by comment `# lint: pylint`Markus Heiser
These py files are linted by `test.pylint`, all other files are linted by `test.pep8`. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-04-04[fix] default_doi_resolver in preferencesMarkus Heiser
Instead of a hard-coded `oadoi.org` default, use the default value from `settings.yml`. Fix an issue in the themes: The replacement 'current_doi_resolver' contains the doi_resolver_url, not the name of the DOI resolver. Compare return value of:: searx.plugins.oa_doi_rewrite.get_doi_resolver(...) Fix a typo in `get_doi_resolver(..)`: suggested by @kvch: *L32 should set doi_resolver not doi_resolvers* Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-11-23Patch advanced search preferencesrenyhp
2020-11-22Add preference for displaying advanced settingsrenyhp
2020-10-25Let admins lock user preferencesNoémi Ványi
2020-10-01[mod] preferences.py: check language setting with a regex instead of ↵Alexandre Flament
match_language
2020-09-10Drop Python 2 (3/n): objectsDalf
2020-09-10Drop Python 2 (1/n): remove unicode string and url_utilsDalf
2020-09-01Add key to settings.yml for opening result links in a new tabScott Wallace
Closes #1552 Closes #444
2020-08-27[fix] pylintAdam Tauber
2020-08-09Make default query submission method configurableMohamad Safadieh
Sending queries through POST, while better for privacy, breaks functionality with certain extensions (e.g. Firefox containers). Since Firefox does not send cookies when requesting `/opensearch.xml`, users cannot easily switch to GET on the client side unless they make a custom search engine. This commit allows admins to modify the default method on their side so they can set it to GET if needed.
2020-02-23preferences.py: implement defaults if unsetMarkus Heiser
Implemnts defaults for: - search.default_lang, search.autocomplete, search.safe_search, - ui.default_theme, ui.default_locale - server.image_proxy This fixes also: https://github.com/asciimoo/searx/pull/1860#issuecomment-590082955 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-02-23preferences.py: pylint, SPDX tag & docstrings (no functional change)Markus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-02-23fix default locale and language issuesMarc Abonce Seguin
2020-02-18[fix] allow settin custom locale from settins.ymlAdam Tauber
2020-02-08Merge commit 'refs/pull/1621/head' of https://github.com/asciimoo/searxMarkus Heiser
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2020-02-08[enh] introduce private enginesNoémi Ványi
This PR adds a new setting to engines named `tokens`. It expects a list of tokens which lets searx validate if the request should be accepted or not.
2019-07-17[fix] preference query parameter decoding (#1599)rachmadani haryono
Fix issue #1598
2019-06-17Fix locale and search languageNicolas Gelot
Locale and search language was always defined with english value. This patch inits the locale on `pre_request` in order to define the default value of locale and language preferences. Plus the `best_match` function provided by flask babel library did not work as expected. So the function `match_language` provided by searx is used to detect that the language from Accepted-Language header can be used in searx project.
2019-01-07Revert "remove 'all' option from search languages"Noémi Ványi
This reverts commit 4d1770398a6af8902e75c0bd885781584d39e796.
2018-08-19[enh] admin configurable suspend time of errored engines - closes #1266Adam Tauber
2018-08-19[enh] configurable default oscar styleAdam Tauber
2018-03-27refactor engine's search language handlingMarc Abonce Seguin
Add match_language function in utils to match any user given language code with a list of engine's supported languages. Also add language_aliases dict on each engine to translate standard language codes into the custom codes used by the engine.
2017-12-11[fix] do not save engine/plugin cookies as unknown settings options - fixes ↵Adam Tauber
#1110
2017-12-06Merge pull request #973 from MarcAbonce/languagesAdam Tauber
Remove 'all' option from search languages
2017-12-06remove 'all' option from search languagesmarc
2017-12-05[enh] make custom oscar option configurable from urlAdam Tauber
2017-11-21[fix] allow none as category in preferences - #1086Adam Tauber
2017-11-01minor fixes of doi resolverNoémi Ványi
Closes #1047