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 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()

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.

api()[source]

Prepares the global configuration for a test from the API.

complements()[source]

Prepares the global configuration for a complements generation.

cooldown_time()[source]

Ensures that we always have a correct cooldown time.

classmethod db_types()[source]

Ensure that the files are downloaded when the db types is not the JSON one.

classmethod disable(indexes)[source]

Sets the given configuration index to False.

classmethod dns_lookup_over_tcp()[source]

Ensures that the DNS lookup over tcp is proprely set.

classmethod dns_nameserver()[source]

Ensures that the DNS nameserver is proprely set.

classmethod enable(indexes)[source]

Sets the given configuration index to True.

file_url()[source]

Prepares the global configuration for a list of URL to test.

init_all()[source]

Initiate all presets which are independent from others.

classmethod maximal_processes()[source]

Ensures that the number of maximal processes is alway >= 1.

multiprocess()[source]

Prepares the global configuration for a test with multiple processes.

classmethod multiprocess_merging_mode()[source]

Ensures that a valid merging mode is given.

reputation_data()[source]

Ensures that the usage of reputation data is activated when needed.

classmethod reset_counters()[source]

Resets the counters.

simple_domain()[source]

Prepares the global configuration for a domain test.

simple_url()[source]

Prepares the global configuration for an URL test.

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:

bool

Raises:
Exception

When the configuration is not valid. In other words, if the PyFunceble.CONFIGURATION[variable_name] is not a bool.

syntax_test()[source]

Disables the HTTP status code if we are testing for syntax

classmethod timeout()[source]

Ensures that the timeout is always correct.