.oO SearXNG Developer Documentation Oo.
|
Public Member Functions | |
__init__ (self, List[str] themes, List[str] categories, Dict[str, Engine] engines, Iterable[Plugin] plugins, Optional[ClientPref] client=None) | |
get_as_url_params (self) | |
parse_encoded_data (self, str input_data) | |
parse_dict (self, Dict[str, str] input_data) | |
parse_form (self, Dict[str, str] input_data) | |
get_value (self, str user_setting_name) | |
save (self, flask.Response resp) | |
validate_token (self, engine) | |
Public Attributes | |
dict | key_value_settings |
engines = EnginesSetting('engines', engines=engines.values()) | |
plugins = PluginsSetting('plugins', plugins=plugins) | |
tokens = SetSetting('tokens') | |
client = client or ClientPref() | |
dict | unknown_params = {} |
str | key_value_settings = 'disabled_engines': |
Validates and saves preferences to cookies
Definition at line 373 of file preferences.py.
searx.preferences.Preferences.__init__ | ( | self, | |
List[str] | themes, | ||
List[str] | categories, | ||
Dict[str, Engine] | engines, | ||
Iterable[Plugin] | plugins, | ||
Optional[ClientPref] | client = None ) |
Definition at line 376 of file preferences.py.
References searx.preferences.Preferences.__init__().
Referenced by searx.preferences.Preferences.__init__().
searx.preferences.Preferences.get_as_url_params | ( | self | ) |
Return preferences as URL parameters
Definition at line 484 of file preferences.py.
References searx.preferences.Preferences.engines, searx.search.checker.background.CheckerOk.engines, searx.preferences.Preferences.key_value_settings, searx.plugins.PluginStore.plugins, searx.preferences.Preferences.plugins, searx.enginelib.Engine.tokens, and searx.preferences.Preferences.tokens.
searx.preferences.Preferences.get_value | ( | self, | |
str | user_setting_name ) |
Returns the value for ``user_setting_name``
Definition at line 561 of file preferences.py.
References searx.preferences.Preferences.get_value(), searx.preferences.Preferences.key_value_settings, and searx.preferences.Preferences.unknown_params.
Referenced by searx.preferences.Preferences.get_value().
searx.preferences.Preferences.parse_dict | ( | self, | |
Dict[str, str] | input_data ) |
parse preferences from request (``flask.request.form``)
Definition at line 513 of file preferences.py.
Referenced by searx.preferences.Preferences.parse_encoded_data().
searx.preferences.Preferences.parse_encoded_data | ( | self, | |
str | input_data ) |
parse (base64) preferences from request (``flask.request.form['preferences']``)
Definition at line 505 of file preferences.py.
References searx.preferences.Preferences.parse_dict().
searx.preferences.Preferences.parse_form | ( | self, | |
Dict[str, str] | input_data ) |
Parse formular (``<input>``) data from a ``flask.request.form``
Definition at line 531 of file preferences.py.
References searx.preferences.Preferences.engines, searx.search.checker.background.CheckerOk.engines, searx.preferences.Preferences.key_value_settings, searx.preferences.Preferences.parse_form(), searx.plugins.PluginStore.plugins, searx.preferences.Preferences.plugins, searx.enginelib.Engine.tokens, searx.preferences.Preferences.tokens, and searx.preferences.Preferences.unknown_params.
Referenced by searx.preferences.Preferences.parse_form().
searx.preferences.Preferences.save | ( | self, | |
flask.Response | resp ) |
Save cookie in the HTTP response object
Definition at line 570 of file preferences.py.
References searx.preferences.Preferences.engines, searx.search.checker.background.CheckerOk.engines, searx.preferences.Preferences.key_value_settings, searx.plugins.PluginStore.plugins, searx.preferences.Preferences.plugins, searx.preferences.Preferences.save(), searx.enginelib.Engine.tokens, searx.preferences.Preferences.tokens, and searx.preferences.Preferences.unknown_params.
Referenced by searx.preferences.Preferences.save().
searx.preferences.Preferences.validate_token | ( | self, | |
engine ) |
Definition at line 584 of file preferences.py.
References searx.enginelib.Engine.tokens, and searx.preferences.Preferences.tokens.
searx.preferences.Preferences.client = client or ClientPref() |
Definition at line 481 of file preferences.py.
searx.preferences.Preferences.engines = EnginesSetting('engines', engines=engines.values()) |
Definition at line 478 of file preferences.py.
Referenced by searx.preferences.Preferences.get_as_url_params(), searx.preferences.Preferences.parse_form(), and searx.preferences.Preferences.save().
dict searx.preferences.Preferences.key_value_settings |
Definition at line 387 of file preferences.py.
Referenced by searx.preferences.Preferences.get_as_url_params(), searx.preferences.Preferences.get_value(), searx.preferences.Preferences.parse_form(), and searx.preferences.Preferences.save().
str searx.preferences.Preferences.key_value_settings = 'disabled_engines': |
Definition at line 516 of file preferences.py.
Referenced by searx.preferences.Preferences.get_as_url_params(), searx.preferences.Preferences.get_value(), searx.preferences.Preferences.parse_form(), and searx.preferences.Preferences.save().
searx.preferences.Preferences.plugins = PluginsSetting('plugins', plugins=plugins) |
Definition at line 479 of file preferences.py.
Referenced by searx.plugins.PluginStore.__iter__(), searx.preferences.Preferences.get_as_url_params(), searx.preferences.Preferences.parse_form(), searx.plugins.PluginStore.register(), and searx.preferences.Preferences.save().
searx.preferences.Preferences.tokens = SetSetting('tokens') |
Definition at line 480 of file preferences.py.
Referenced by searx.preferences.Preferences.get_as_url_params(), searx.preferences.Preferences.parse_form(), searx.preferences.Preferences.save(), and searx.preferences.Preferences.validate_token().
dict searx.preferences.Preferences.unknown_params = {} |
Definition at line 482 of file preferences.py.
Referenced by searx.preferences.Preferences.get_value(), searx.preferences.Preferences.parse_form(), and searx.preferences.Preferences.save().