.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.preferences Namespace Reference

Classes

class  BooleanChoices
 
class  BooleanSetting
 
class  ClientPref
 
class  EnginesSetting
 
class  EnumStringSetting
 
class  MapSetting
 
class  MultipleChoiceSetting
 
class  PluginsSetting
 
class  Preferences
 
class  SearchLanguageSetting
 
class  SetSetting
 
class  Setting
 
class  StringSetting
 
class  ValidationException
 

Functions

 is_locked (str setting_name)
 

Variables

int COOKIE_MAX_AGE = 60 * 60 * 24 * 365 * 5
 
 DOI_RESOLVERS = list(settings['doi_resolvers'])
 
Dict MAP_STR2BOOL
 

Detailed Description

Searx preferences implementation.

Function Documentation

◆ is_locked()

searx.preferences.is_locked ( str setting_name)
Checks if a given setting name is locked by settings.yml

Definition at line 596 of file preferences.py.

596def is_locked(setting_name: str):
597 """Checks if a given setting name is locked by settings.yml"""
598 if 'preferences' not in settings:
599 return False
600 if 'lock' not in settings['preferences']:
601 return False
602 return setting_name in settings['preferences']['lock']

Variable Documentation

◆ COOKIE_MAX_AGE

int searx.preferences.COOKIE_MAX_AGE = 60 * 60 * 24 * 365 * 5

Definition at line 24 of file preferences.py.

◆ DOI_RESOLVERS

searx.preferences.DOI_RESOLVERS = list(settings['doi_resolvers'])

Definition at line 25 of file preferences.py.

◆ MAP_STR2BOOL

Dict searx.preferences.MAP_STR2BOOL
Initial value:
1= OrderedDict(
2 [
3 ('0', False),
4 ('1', True),
5 ('on', True),
6 ('off', False),
7 ('True', True),
8 ('False', False),
9 ('none', False),
10 ]
11)

Definition at line 27 of file preferences.py.