File Core¶
Problematic¶
How can we operate in one place the test of file(s) content?
Documentation¶
The tool to check the availability or syntax of domains, IPv4 or URL.
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ ██████╔╝██║ █████╗
██╔═══╝ ╚██╔╝ ██╔══╝ ██║ ██║██║╚██╗██║██║ ██╔══╝ ██╔══██╗██║ ██╔══╝
██║ ██║ ██║ ╚██████╔╝██║ ╚████║╚██████╗███████╗██████╔╝███████╗███████╗
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚══════╝╚═════╝ ╚══════╝╚══════╝
Provide the logic for a file test from the CLI.
- 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 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.
-
class
PyFunceble.file_core.
FileCore
(file, file_type='domain')[source]¶ Brain of PyFunceble for file testing.
Parameters: - file (str) – The file we are testing.
- file_type (str) –
The file type. Should be one of the following.
domain
url
-
_FileCore__process_test
(subject)¶ Given a subject, we perform its test.
Parameters: subject (str) – The subjet we have to test.
-
classmethod
_format_line
(line)[source]¶ Format the extracted line before passing it to the system.
Parameters: line (str) – The extracted line. Returns: The formatted line with only the element to test. Return type: str
-
_get_list_to_of_subjects_to_test_from_file
(file_object)[source]¶ Give a file object, we construct/get the list of subject to test.
-
_test_line
(line, manager_data=None)[source]¶ Given a line, we test it.
Parameters: - line (str) – A line to work with.
- manager_data (multiprocessing.Manager.list) – A Server process.
-
domain
(subject)[source]¶ Handle the test of a single domain.
Parameters: subject (str) – The subject we are testing.