Skip to content

# Whois record idna subject

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

::

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

Provides our WHOIS record migrator.

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://docs.pyfunceble.com

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.

## `WhoisRecordIDNASubjectMigrator`

Bases: `MariaDBMigratorBase`

Provides the interface which provides the completion of the missing IDNA subject column.

Source code in `PyFunceble/cli/migrators/mariadb/whois_record_idna_subject.py`

     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120

    class WhoisRecordIDNASubjectMigrator(MariaDBMigratorBase):
        """
        Provides the interface which provides the completion of the missing
        IDNA subject column.
        """

        @property
        def authorized(self) -> bool:
            """
            Provides the authorization to process.
            """

            if PyFunceble.cli.facility.CredentialLoader.is_already_loaded():
                # pylint: disable=singleton-comparison
                return (
                    self.db_session.query(WhoisRecord)
                    .filter(WhoisRecord.idna_subject == None)
                    .first()
                    is not None
                )
            return False

        @MariaDBMigratorBase.execute_if_authorized(None)
        def migrate(self) -> "WhoisRecordIDNASubjectMigrator":
            # pylint: disable=singleton-comparison

            broken = False

            for row in self.db_session.query(WhoisRecord).filter(
                WhoisRecord.idna_subject == None
            ):
                if (
                    self.continuous_integration
                    and self.continuous_integration.is_time_exceeded()
                ):
                    broken = True
                    break

                PyFunceble.facility.Logger.info(
                    "Started to fix idna_subject field of %r", row.subject
                )
                row.idna_subject = domain2idna.domain2idna(row.subject)

                self.db_session.add(row)

                if self.print_action_to_stdout:
                    print_single_line()

                PyFunceble.facility.Logger.info(
                    "Finished to fix idna_subject field of %r", row.subject
                )

            self.db_session.commit()

            if not broken:
                self.done = True

            return self

### `authorized: bool` `property`

Provides the authorization to process.