Config¶
Problematic¶
- How can we make personalization more simple?
- How can we automaticaly 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 domains, IPv4, IPv6 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:
MIT License
Copyright (c) 2017, 2018, 2019, 2020 Nissar Chababy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Load()
¶
-
class
PyFunceble.config.load.
Load
(path_to_config, custom=None)[source]¶ Loads the configuration(s) file(s).
Parameters: -
classmethod
_Load__download_them_all
()¶ Download everything that needs to be downloaded.
-
_Load__fix_paths
()¶ Fixes all paths.
-
_Load__load_it
()¶ Loads the configuration and everything needed around it.
Note
“Everything needed around it” is meant to be all files which are needed by other part of the project.
-
_Load__set_it
(custom)¶ Sets the configuration at its final location and load the complementary infos.
Parameters: custom (dict) – The custom index, this is what we overwrite.
-
_install_production_config
()[source]¶ Downloads the production configuration and install it in the given configuration directory.
-
classmethod
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 >= 1.
-
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