PyFunceble/status.py
def handle(cls, status, invalid_source="IANA"):
        """
        Handle the lack of WHOIS and expiration date. :smile_cat:

        :param matched_status: The status that we have to handle.
        :type status: str

        :param invalid_source:
            The source to set when we handle INVALID element.
        :type invalid_source: str

        :return:
            The strus of the domain after generating the files desired
            by the user.
        :rtype: str
        """

        if status.lower() not in PyFunceble.STATUS["list"]["invalid"]:
            # The matched status is not in the list of invalid status.

            # We initiate the source we are going to parse to the Generate class.
            source = "NSLOOKUP"

            if Lookup().nslookup():
                # We could execute the nslookup logic.

                # We get the status and source after extra rules check.
                status, source = cls.extra_rules.handle(
                    PyFunceble.STATUS["official"]["up"], source
                )

                # We generate the status files with the up status.
                Generate(status, source).status_file()

                # We return the up status.
                return status, source

            # We could not execute the nslookup logic.

            # We get the status and source after extra rules check.
            status, source = cls.extra_rules.handle(
                PyFunceble.STATUS["official"]["down"], source
            )

            # We generate the status file with the down status.
            Generate(status, source).status_file()

            # We return the down status.
            return status, source

        # The matched status is in the list of invalid status.

        # We get the status and source after extra rules check.
        status, source = cls.extra_rules.handle(
            PyFunceble.STATUS["official"]["invalid"], invalid_source
        )

        # We generate the status file with the invalid status.
        Generate(status, source).status_file()

        # We return the status.
        return status, source
def handle(cls, status, invalid_source="IANA"):
        """
        Handle the lack of WHOIS and expiration date. :smile_cat:

        :param matched_status: The status that we have to handle.
        :type status: str

        :param invalid_source:
            The source to set when we handle INVALID element.
        :type invalid_source: str

        :return:
            The strus of the domain after generating the files desired
            by the user.
        :rtype: str
        """

        if status.lower() not in PyFunceble.STATUS["list"]["invalid"]:
            # The matched status is not in the list of invalid status.

            # We initiate the source we are going to parse to the Generate class.
            source = "NSLOOKUP"

            if Lookup().nslookup():
                # We could execute the nslookup logic.

                # We get the status and source after extra rules check.
                status, source = cls.extra_rules.handle(
                    PyFunceble.STATUS["official"]["up"], source
                )

                # We generate the status files with the up status.
                Generate(status, source).status_file()

                # We return the up status.
                return status, source

            # We could not execute the nslookup logic.

            # We get the status and source after extra rules check.
            status, source = cls.extra_rules.handle(
                PyFunceble.STATUS["official"]["down"], source
            )

            # We generate the status file with the down status.
            Generate(status, source).status_file()

            # We return the down status.
            return status, source

        # The matched status is in the list of invalid status.

        # We get the status and source after extra rules check.
        status, source = cls.extra_rules.handle(
            PyFunceble.STATUS["official"]["invalid"], invalid_source
        )

        # We generate the status file with the invalid status.
        Generate(status, source).status_file()

        # We return the status.
        return status, source
Handle the lack of WHOIS and expiration date. :smile_cat:

        :param matched_status: The status that we have to handle.
        :type status: str

        :param invalid_source:
            The source to set when we handle INVALID element.
        :type invalid_source: str

        :return:
            The strus of the domain after generating the files desired
            by the user.
        :rtype: str