Config¶
Problematic¶
- How can we make personalization more simple?
- How can we automatically merge the new configuration with the local one?
- How can we link some configuration endpoints with the real logic.
Documentation¶
The tool to check the availability or syntax of domain, IP or URL.
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ ██████╔╝██║ █████╗
██╔═══╝ ╚██╔╝ ██╔══╝ ██║ ██║██║╚██╗██║██║ ██╔══╝ ██╔══██╗██║ ██╔══╝
██║ ██║ ██║ ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝
Provides the configuration logics.
- Author:
- Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
- Special thanks:
- https://pyfunceble.github.io/special-thanks.html
- Contributors:
- https://pyfunceble.github.io/contributors.html
- Project link:
- https://github.com/funilrys/PyFunceble
- Project documentation:
- https://pyfunceble.readthedocs.io/en/master/
- Project homepage:
- https://pyfunceble.github.io/
License:
Copyright 2017, 2018, 2019, 2020 Nissar Chababy
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Load()
¶
Merge()
¶
Preset()
¶
-
class
PyFunceble.config.preset.
Preset
[source]¶ Checks or update the global configuration based on some events.
-
classmethod
_Preset__are_we_allowed_to_overwrite
(index)¶ Checks if we are allowed to overwrite an index.
-
classmethod
maximal_processes
()[source]¶ Ensures that the number of maximal processes is alway >= 2. If not, we don’t authorize the multiprocessing.
-
classmethod
switch
(variable, custom=False)[source]¶ Switches
PyFunceble.CONFIGURATION
variables to their opposite.Parameters: - variable (str|bool) – The variable name to switch. The variable should be an index our configuration system. If we want to switch a bool variable, we should parse it here.
- custom (bool) – Let us know if have to switch the parsed variable instead of our configuration index.
Returns: The opposite of the configuration index or the given variable.
Return type: Raises: Exception
When the configuration is not valid. In other words, if the PyFunceble.CONFIGURATION[variable_name] is not a bool.
-
classmethod