summaryrefslogtreecommitdiff
path: root/searx/_settings.py
blob: 0db62474c15ff28d08139cd8408b845669e1ec60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Implementation of the :py:obj:`preference <searx.preference>` settings."""
# pylint: disable = too-few-public-methods

import typing as t
import msgspec


class SettingsPref(msgspec.Struct, kw_only=True, forbid_unknown_fields=True):
    """Options for configuring the preferences

    .. code:: yaml

       preferences:
         lock:
           - favicon_resolver
           - image_proxy
           - method
       # ...

    """

    lock: set[
        t.Literal[
            "categories",
            "language",
            "locale",
            "autocomplete",
            "favicon_resolver",
            "image_proxy",
            "method",
            "safesearch",
            "theme",
            "results_on_new_tab",
            "doi_resolver",
            "simple_style",
            "center_alignment",
            "query_in_title",
            "search_on_category_select",
        ]
    ] = set()
    """Lock arbitrary settings on the preferences page."""