.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.settings_defaults.SettingSublistValue Class Reference
+ Inheritance diagram for searx.settings_defaults.SettingSublistValue:
+ Collaboration diagram for searx.settings_defaults.SettingSublistValue:

Public Member Functions

typing.Any check_type_definition (self, typing.Any value)
 
- Public Member Functions inherited from searx.settings_defaults.SettingsValue
 __init__ (self, typing.Union[None, typing.Any, typing.Tuple[typing.Any]] type_definition=None, typing.Any default=None, str environ_name=None)
 
 type_definition_repr (self)
 
typing.Any __call__ (self, typing.Any value)
 

Public Attributes

 type_definition
 
- Public Attributes inherited from searx.settings_defaults.SettingsValue
tuple type_definition
 
 default = default
 
 environ_name = environ_name
 
 type_definition_repr
 

Detailed Description

Check the value is a sublist of type definition.

Definition at line 85 of file settings_defaults.py.

Member Function Documentation

◆ check_type_definition()

typing.Any searx.settings_defaults.SettingSublistValue.check_type_definition ( self,
typing.Any value )

Reimplemented from searx.settings_defaults.SettingsValue.

Definition at line 88 of file settings_defaults.py.

88 def check_type_definition(self, value: typing.Any) -> typing.Any:
89 if not isinstance(value, list):
90 raise ValueError('The value has to a list')
91 for item in value:
92 if not item in self.type_definition[0]:
93 raise ValueError('{} not in {}'.format(item, self.type_definition))
94
95

References searx.settings_defaults.SettingSublistValue.type_definition, and searx.settings_defaults.SettingsValue.type_definition.

Referenced by searx.settings_defaults.SettingsValue.__call__().

+ Here is the caller graph for this function:

Member Data Documentation

◆ type_definition


The documentation for this class was generated from the following file: