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

Public Member Functions

typing.Any check_type_definition (self, typing.Any value)
 
typing.Any __call__ (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)
 

Additional Inherited Members

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

Detailed Description

Check and update a setting value that is a directory path

Definition at line 96 of file settings_defaults.py.

Member Function Documentation

◆ __call__()

typing.Any searx.settings_defaults.SettingsDirectoryValue.__call__ ( self,
typing.Any value )

Reimplemented from searx.settings_defaults.SettingsValue.

Definition at line 104 of file settings_defaults.py.

104 def __call__(self, value: typing.Any) -> typing.Any:
105 if value == '':
106 value = self.default
107 return super().__call__(value)
108
109

References searx.settings_defaults.SettingsDirectoryValue.__call__(), searx.botdetection.config.Config.default(), searx.enginelib.traits.EngineTraitsEncoder.default(), searx.settings_defaults.SettingsValue.default, and searx.webutils.JSONEncoder.default().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_type_definition()

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

Reimplemented from searx.settings_defaults.SettingsValue.

Definition at line 99 of file settings_defaults.py.

99 def check_type_definition(self, value: typing.Any) -> typing.Any:
100 super().check_type_definition(value)
101 if not os.path.isdir(value):
102 raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), value)
103

References searx.settings_defaults.SettingsDirectoryValue.check_type_definition().

Referenced by searx.settings_defaults.SettingsValue.__call__(), and searx.settings_defaults.SettingsDirectoryValue.check_type_definition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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