PyFunceble.cli.filesystem.printer package

Submodules

PyFunceble.cli.filesystem.printer.base module

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

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

Provides the base of all our printers.

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, 2023, 2024 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

    https://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.filesystem.printer.base.PrinterBase(template_to_use: str | None = None, *, dataset: Dict[str, str] | None = None, skip_column: List[str] | None = None)[source]

Bases: object

Provides the base of all printer class.

Printer classes are classes which derivate from this class. their objectives should be the same: Unify and simplify the way to print something to a given destination.

HEADERS: Dict[str, str] = {'amount': 'Amount', 'checker_type': 'Checker', 'days': 'Days', 'expiration_date': 'Expiration Date', 'hours': 'Hours', 'http_status_code': 'HTTP Code', 'idna_subject': 'Subject', 'ip': 'IP', 'minutes': 'Minutes', 'percentage': 'Percentage', 'registrar': 'Registrar', 'seconds': 'Seconds', 'status': 'Status', 'status_source': 'Source'}
STD_LENGTH: Dict[str, int] = {'amount': 12, 'checker_type': 13, 'days': 2, 'expiration_date': 17, 'hours': 2, 'http_status_code': 10, 'idna_subject': 100, 'minutes': 2, 'percentage': 12, 'registrar': 30, 'seconds': 6, 'status': 11, 'status_source': 10}
STD_UNKNOWN: str = 'Unknown'
TEMPLATES: Dict[str, Template] = {'all': <string.Template object>, 'execution_time': <string.Template object>, 'hosts': <string.Template object>, 'less': <string.Template object>, 'percentage': <string.Template object>, 'plain': <string.Template object>, 'registrar': <string.Template object>, 'simple': <string.Template object>}
property dataset: Dict[str, str] | None

Provides the current state of the _dataset attribute.

ensure_dataset_is_given()[source]

Ensures that the dataset to write is given before launching the decorated method.

Raises:

TypeError – When the current self.template_to_use is not set.

ensure_template_to_use_is_given()[source]

Ensures that the template to use is given before launching the decorated method.

Raises:

TypeError – When the current self.template_to_use is not set.

get_header_to_print() str[source]

Provides the template header to print.

get_line_to_print() str[source]

Provides the line to print.

print_header() None[source]

Prints the header.

print_interpolated_line() None[source]

Prints the line where we are suppose to write it.

set_dataset(value: Dict[str, str]) PrinterBase[source]

Sets the dataset to apply to the template.

Parameters:

value – The value to set.

set_skip_column(value: List[str]) PrinterBase[source]

Sets the columns to skip.

Parameters:

value – The value to set.

set_template_to_use(value: str) PrinterBase[source]

Sets the template to use.

Parameters:

value – The value to set.

property skip_column: List[str] | None

Provides the current state of the _skip_column attribute.

property template_to_use: str | None

Provides the current state of the _template_to_use attribute.

PyFunceble.cli.filesystem.printer.file module

PyFunceble.cli.filesystem.printer.stdout module

Module contents

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

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

Provides everything related to what we actually print (output) or to a file.

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, 2023, 2024 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

    https://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.