PyFunceble/core.py
def domain(self, domain=None, last_domain=None):
        """
        Manage the case that we want to test only a domain.

        :param domain: The domain or IP to test.
        :type domain: str

        :param last_domain:
            The last domain to test if we are testing a file.
        :type last_domain: str

        :param return_status: Tell us if we need to return the status.
        :type return_status: bool
        """

        # We print the header.
        self._print_header()

        if domain:
            # A domain is given.

            # We format and set the domain we are testing and treating.
            PyFunceble.INTERN["to_test"] = self._format_domain(domain)
        else:
            # A domain is not given.

            # We set the domain we are testing and treating to None.
            PyFunceble.INTERN["to_test"] = None

        if PyFunceble.INTERN["to_test"]:
            # The domain is given (Not None).

            if PyFunceble.CONFIGURATION["syntax"]:
                # The syntax mode is activated.

                # We get the status from Syntax.
                status = self.syntax_status.get()
            else:
                # We test and get the status of the domain.
                status, _ = self.status.get()

            # We run the file decision logic.
            self._file_decision(PyFunceble.INTERN["to_test"], last_domain, status)

            if PyFunceble.CONFIGURATION["simple"]:
                # The simple mode is activated.

                # We print the domain and the status.
                print(PyFunceble.INTERN["to_test"], status)

            # We return the tested domain and its status.
            return PyFunceble.INTERN["to_test"], status

        # We return None, there is nothing to test.
        return None
def domain(self, domain=None, last_domain=None):
        # We print the header.
        self._print_header()

        if domain:
            # A domain is given.

            # We format and set the domain we are testing and treating.
            PyFunceble.INTERN["to_test"] = self._format_domain(domain)
        else:
            # A domain is not given.

            # We set the domain we are testing and treating to None.
            PyFunceble.INTERN["to_test"] = None

        if PyFunceble.INTERN["to_test"]:
            # The domain is given (Not None).

            if PyFunceble.CONFIGURATION["syntax"]:
                # The syntax mode is activated.

                # We get the status from Syntax.
                status = self.syntax_status.get()
            else:
                # We test and get the status of the domain.
                status, _ = self.status.get()

            # We run the file decision logic.
            self._file_decision(PyFunceble.INTERN["to_test"], last_domain, status)

            if PyFunceble.CONFIGURATION["simple"]:
                # The simple mode is activated.

                # We print the domain and the status.
                print(PyFunceble.INTERN["to_test"], status)

            # We return the tested domain and its status.
            return PyFunceble.INTERN["to_test"], status

        # We return None, there is nothing to test.
        return None
def domain ( self , domain = None , last_domain = None ) : # We print the header. self . _print_header ( ) if domain : # A domain is given. # We format and set the domain we are testing and treating. PyFunceble . INTERN [ "to_test" ] = self . _format_domain ( domain ) else : # A domain is not given. # We set the domain we are testing and treating to None. PyFunceble . INTERN [ "to_test" ] = None if PyFunceble . INTERN [ "to_test" ] : # The domain is given (Not None). if PyFunceble . CONFIGURATION [ "syntax" ] : # The syntax mode is activated. # We get the status from Syntax. status = self . syntax_status . get ( ) else : # We test and get the status of the domain. status , _ = self . status . get ( ) # We run the file decision logic. self . _file_decision ( PyFunceble . INTERN [ "to_test" ] , last_domain , status ) if PyFunceble . CONFIGURATION [ "simple" ] : # The simple mode is activated. # We print the domain and the status. print ( PyFunceble . INTERN [ "to_test" ] , status ) # We return the tested domain and its status. return PyFunceble . INTERN [ "to_test" ] , status # We return None, there is nothing to test. return None
Manage the case that we want to test only a domain.

        :param domain: The domain or IP to test.
        :type domain: str

        :param last_domain:
            The last domain to test if we are testing a file.
        :type last_domain: str

        :param return_status: Tell us if we need to return the status.
        :type return_status: bool
Manage the case that we want to test only a domain .