PyFunceble.cli.system package

Submodules

PyFunceble.cli.system.base module

The tool to check the availability or syntax of domain, IP or URL.

██████╗ ██╗   ██╗███████╗██╗   ██╗███╗   ██╗ ██████╗███████╗██████╗ ██╗     ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║   ██║████╗  ██║██╔════╝██╔════╝██╔══██╗██║     ██╔════╝
██████╔╝ ╚████╔╝ █████╗  ██║   ██║██╔██╗ ██║██║     █████╗  ██████╔╝██║     █████╗
██╔═══╝   ╚██╔╝  ██╔══╝  ██║   ██║██║╚██╗██║██║     ██╔══╝  ██╔══██╗██║     ██╔══╝
██║        ██║   ██║     ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝        ╚═╝   ╚═╝      ╚═════╝ ╚═╝  ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝

Provides the base of all our subclasses related to the system management.

Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
Special thanks:
https://pyfunceble.github.io/#/special-thanks
Contributors:
https://pyfunceble.github.io/#/contributors
Project link:
https://github.com/funilrys/PyFunceble
Project documentation:
https://pyfunceble.readthedocs.io/en/dev/
Project homepage:
https://pyfunceble.github.io/

License:

Copyright 2017, 2018, 2019, 2020, 2022 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.
class PyFunceble.cli.system.base.SystemBase(args: Optional[argparse.Namespace] = None)[source]

Bases: object

Provides the base of all system classes. The idea is that every system classes will have access to the argument given by end-user.

Each of them will have a start method which will run a set of predefined action. But the start method -in comparison to previous versions - starts on purpose.

Parameters:args – The arguments from argparse.ArgumentParser.
args

Provides the current state of the _args attribute.

ensure_args_is_given()[source]

Ensures that the self.args attribute is given before launching the decorated method.

set_args(value: argparse.Namespace) → PyFunceble.cli.system.base.SystemBase[source]

Sets the given args.

Parameters:value – The arguments to work with.
start() → PyFunceble.cli.system.base.SystemBase[source]

Provides a launcher for a brunch of predefined actions defined by the current object.

PyFunceble.cli.system.integrator module

The tool to check the availability or syntax of domain, IP or URL.

██████╗ ██╗   ██╗███████╗██╗   ██╗███╗   ██╗ ██████╗███████╗██████╗ ██╗     ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║   ██║████╗  ██║██╔════╝██╔════╝██╔══██╗██║     ██╔════╝
██████╔╝ ╚████╔╝ █████╗  ██║   ██║██╔██╗ ██║██║     █████╗  ██████╔╝██║     █████╗
██╔═══╝   ╚██╔╝  ██╔══╝  ██║   ██║██║╚██╗██║██║     ██╔══╝  ██╔══██╗██║     ██╔══╝
██║        ██║   ██║     ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝        ╚═╝   ╚═╝      ╚═════╝ ╚═╝  ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝

Provides our very own argument parser. Take this as a splitter which runs some actions against other resource before returning the arguments.

Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
Special thanks:
https://pyfunceble.github.io/#/special-thanks
Contributors:
https://pyfunceble.github.io/#/contributors
Project link:
https://github.com/funilrys/PyFunceble
Project documentation:
https://pyfunceble.readthedocs.io/en/dev/
Project homepage:
https://pyfunceble.github.io/

License:

Copyright 2017, 2018, 2019, 2020, 2022 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.
class PyFunceble.cli.system.integrator.SystemIntegrator(args: Optional[argparse.Namespace] = None)[source]

Bases: PyFunceble.cli.system.base.SystemBase

Provides our system integrator. The idea is that we given an argparse Namespace, we should be able to parse it into our system.

To simplify the trick and headache in the CLI management, I explicitely mapped the dest argument to what we are supposed to have in the flatten version of the configuration. That way, we only need to compare against the flatten version instead of looping over all possible levels of the configuration tree.

check_config() → PyFunceble.cli.system.integrator.SystemIntegrator[source]

Checks or do some sanity check of the configuration.

This method will basically check that the common mistakes while mixing configuration and CLI arguments are not found.

Warning

The messages are not directly printed, but rather stored in the PyFunceble.cli.storage.EXTRA_MESSAGES list.

init_logger() → PyFunceble.cli.system.integrator.SystemIntegrator[source]

Initiate the loggers. In fact, before this moment, in a normal case the logger was not properly initiated. To avoid multiple management place, I took it to the essential.

Warning

If you plan to play with the logger on your own, be sure to follow the same procedure.

inject_into_config() → PyFunceble.cli.system.integrator.SystemIntegrator[source]

Injects the configuration variables into the configuration after comparing each value with the current one.

start() → PyFunceble.cli.system.integrator.SystemIntegrator[source]

Starts a group of actions provided by this interface.

PyFunceble.cli.system.launcher module

The tool to check the availability or syntax of domain, IP or URL.

██████╗ ██╗   ██╗███████╗██╗   ██╗███╗   ██╗ ██████╗███████╗██████╗ ██╗     ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║   ██║████╗  ██║██╔════╝██╔════╝██╔══██╗██║     ██╔════╝
██████╔╝ ╚████╔╝ █████╗  ██║   ██║██╔██╗ ██║██║     █████╗  ██████╔╝██║     █████╗
██╔═══╝   ╚██╔╝  ██╔══╝  ██║   ██║██║╚██╗██║██║     ██╔══╝  ██╔══██╗██║     ██╔══╝
██║        ██║   ██║     ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝        ╚═╝   ╚═╝      ╚═════╝ ╚═╝  ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝

Provides the system launcher. From here, it’s all about real testing.

Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
Special thanks:
https://pyfunceble.github.io/#/special-thanks
Contributors:
https://pyfunceble.github.io/#/contributors
Project link:
https://github.com/funilrys/PyFunceble
Project documentation:
https://pyfunceble.readthedocs.io/en/dev/
Project homepage:
https://pyfunceble.github.io/

License:

Copyright 2017, 2018, 2019, 2020, 2022 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.
class PyFunceble.cli.system.launcher.SystemLauncher(args: Optional[argparse.Namespace] = None)[source]

Bases: PyFunceble.cli.system.base.SystemBase

Provides the system tests launcher.

adblock_inputline2subject = <PyFunceble.converter.adblock_input_line2subject.AdblockInputLine2Subject object>
checker_type = None
ci_stop_in_the_middle_if_time_exceeded() → PyFunceble.cli.system.launcher.SystemLauncher[source]

Stops our processes as soon as the time is exceeded.

cidr2subject = <PyFunceble.converter.cidr2subject.CIDR2Subject object>
continue_dataset = None
continuous_integration = None
counter = <PyFunceble.cli.filesystem.counter.FilesystemCounter object>
db_session = None
dir_files_sorter_process_manager = None
execution_time_holder = None
file_preloader = None
file_printer = <PyFunceble.cli.filesystem.printer.file.FilePrinter object>
fill_protocol() → PyFunceble.cli.system.launcher.SystemLauncher[source]

Fills the protocol with the information about what we are supposed to test.

fill_to_test_queue_from_protocol() → PyFunceble.cli.system.launcher.SystemLauncher[source]

Read the protocol and fill the testing queue.

generate_waiting_files() → PyFunceble.cli.system.launcher.SystemLauncher[source]

Generates all the files that needs to be generated when all status are proceeses.

inactive_dataset = None
inputline2subject = <PyFunceble.converter.input_line2subject.InputLine2Subject object>
migrator_process_manager = None
miner_process_manager = None
static print_home_ascii() → None[source]

Prints our ASCII home logo.

producer_process_manager = None
registrar_counter = <PyFunceble.cli.filesystem.registrar_counter.RegistrarCounter object>
remove_unwanted_files() → PyFunceble.cli.system.launcher.SystemLauncher[source]

Deletes some unwanted files that needs to be deleted when all status are processed.

rpz_inputline2subject = <PyFunceble.converter.rpz_input_line2subject.RPZInputLine2Subject object>
rpz_policy2subject = <PyFunceble.converter.rpz_policy2subject.RPZPolicy2Subject object>
run_ci_end_saving_instructions() → PyFunceble.cli.system.launcher.SystemLauncher[source]

Runns our CI END “saving” instructions.

The instructions executed by this method are the one we execute before ending a testing session under one of the supported CI engines.

The purpose of this method is to make our instructions available to everybody instead of hiding them into the start method. :-)

Warning

This is the standard “end” instructions. Do not call this method if you are trying to run an action after the CI execution time exceeded.

run_ci_saving_instructions() → PyFunceble.cli.system.launcher.SystemLauncher[source]

Runns our CI “saving” instructions.

The instructions executed by this method are the one we execute before ending a testing session under one of the supported CI engines.

The purpose of this method is to make our instructions available to everybody instead of hiding them into the start method. :-)

Warning

This is the standard “end” instructions. Do not call this method if you are trying to run an action after the CI execution time exceeded.

run_standard_end_instructions() → PyFunceble.cli.system.launcher.SystemLauncher[source]

Runns our standard “end” instructions.

The instructions executed by this method are the one we execute normally.

The purpose of this method is to make our standard end instructions available to everybody instead of hiding them into the start method. :-)

Warning

This is the standard “end” instructions. Do not call this method if you are trying to run an action after the CI execution time exceeded.

sessions_id = {}
start() → PyFunceble.cli.system.launcher.SystemLauncher[source]

Provides a launcher for a brunch of predefined actions defined by the current object.

stdout_printer = <PyFunceble.cli.filesystem.printer.stdout.StdoutPrinter object>
stop_and_wait_for_all_manager() → PyFunceble.cli.system.launcher.SystemLauncher[source]

Sends our stop signal and wait until all managers are finished.

subject2complements = <PyFunceble.converter.subject2complements.Subject2Complements object>
tester_process_manager = None
testing_protocol = []

Saves the protocol which we are going to generate. The protocol will saves a set of information about what to test, what kind of output to produce and most importantly where.

url2netloc = <PyFunceble.converter.url2netloc.Url2Netloc object>
wildcard2subject = <PyFunceble.converter.wildcard2subject.Wildcard2Subject object>

Module contents

The tool to check the availability or syntax of domain, IP or URL.

██████╗ ██╗   ██╗███████╗██╗   ██╗███╗   ██╗ ██████╗███████╗██████╗ ██╗     ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║   ██║████╗  ██║██╔════╝██╔════╝██╔══██╗██║     ██╔════╝
██████╔╝ ╚████╔╝ █████╗  ██║   ██║██╔██╗ ██║██║     █████╗  ██████╔╝██║     █████╗
██╔═══╝   ╚██╔╝  ██╔══╝  ██║   ██║██║╚██╗██║██║     ██╔══╝  ██╔══██╗██║     ██╔══╝
██║        ██║   ██║     ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝        ╚═╝   ╚═╝      ╚═════╝ ╚═╝  ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝

Provides our system handlers. Actually, every success CLI parsing will ends in on of the submodules.

Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
Special thanks:
https://pyfunceble.github.io/#/special-thanks
Contributors:
https://pyfunceble.github.io/#/contributors
Project link:
https://github.com/funilrys/PyFunceble
Project documentation:
https://pyfunceble.readthedocs.io/en/dev/
Project homepage:
https://pyfunceble.github.io/

License:

Copyright 2017, 2018, 2019, 2020, 2022 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.