PyFunceble/prints.py
def _colorify(self, data):
        """
        Retun colored string.

        :param data: The string to colorify.
        :type data: str

        :return: A colored string.
        :rtype: str
        """

        if self.template in ["Generic", "Less"]:
            # The template is in the list of template that need the coloration.

            if (
                self.data_to_print[1].lower() in PyFunceble.STATUS["list"]["up"]
                or self.data_to_print[1].lower() in PyFunceble.STATUS["list"]["valid"]
            ):
                # The status is in the list of up status.

                # We print the data with a green background.
                data = PyFunceble.Fore.BLACK + PyFunceble.Back.GREEN + data
            elif self.data_to_print[1].lower() in PyFunceble.STATUS["list"]["down"]:
                # The status is in the list of down status.

                # We print the data with a red background.
                data = PyFunceble.Fore.BLACK + PyFunceble.Back.RED + data
            else:
                # The status is not in the list of up and down status.

                # We print the data with a cyan background.
                data = PyFunceble.Fore.BLACK + PyFunceble.Back.CYAN + data

        # We return the data.
        return data
def _colorify(self, data):
        """
        Retun colored string.

        :param data: The string to colorify.
        :type data: str

        :return: A colored string.
        :rtype: str
        """

        if self.template in ["Generic", "Less"]:
            # The template is in the list of template that need the coloration.

            if (
                self.data_to_print[1].lower() in PyFunceble.STATUS["list"]["up"]
                or self.data_to_print[1].lower() in PyFunceble.STATUS["list"]["valid"]
            ):
                # The status is in the list of up status.

                # We print the data with a green background.
                data = PyFunceble.Fore.BLACK + PyFunceble.Back.GREEN + data
            elif self.data_to_print[1].lower() in PyFunceble.STATUS["list"]["down"]:
                # The status is in the list of down status.

                # We print the data with a red background.
                data = PyFunceble.Fore.BLACK + PyFunceble.Back.RED + data
            else:
                # The status is not in the list of up and down status.

                # We print the data with a cyan background.
                data = PyFunceble.Fore.BLACK + PyFunceble.Back.CYAN + data

        # We return the data.
        return data
def _colorify ( self , data ) : if self . template in [ "Generic" , "Less" ] : # The template is in the list of template that need the coloration. if ( self . data_to_print [ 1 ] . lower ( ) in PyFunceble . STATUS [ "list" ] [ "up" ] or self . data_to_print [ 1 ] . lower ( ) in PyFunceble . STATUS [ "list" ] [ "valid" ] ) : # The status is in the list of up status. # We print the data with a green background. data = PyFunceble . Fore . BLACK + PyFunceble . Back . GREEN + data elif self . data_to_print [ 1 ] . lower ( ) in PyFunceble . STATUS [ "list" ] [ "down" ] : # The status is in the list of down status. # We print the data with a red background. data = PyFunceble . Fore . BLACK + PyFunceble . Back . RED + data else : # The status is not in the list of up and down status. # We print the data with a cyan background. data = PyFunceble . Fore . BLACK + PyFunceble . Back . CYAN + data # We return the data. return data
Retun colored string.

        :param data: The string to colorify.
        :type data: str

        :return: A colored string.
        :rtype: str
Retun colored string .