PyFunceble/logs.py
def referer_not_found(self, extension):
        """
        Logs the case that the referer was not found.

        :param extension: The extension of the domain we are testing.
        :type extension: str
        """

        if PyFunceble.CONFIGURATION["logs"]:
            # The logs subsystem is activated.

            to_write = {
                self.current_time: {
                    "domain": PyFunceble.INTERN["to_test"],
                    "extension": extension,
                }
            }

            if self.output:
                output = self.output
            else:
                output = PyFunceble.OUTPUT_DIRECTORY
                output += PyFunceble.OUTPUTS["parent_directory"]
                output += PyFunceble.OUTPUTS["logs"]["directories"]["parent"]
                output += PyFunceble.OUTPUTS["logs"]["filenames"]["no_referer"]

            current_content = self._get_content(output)
            current_content.update(to_write)

            self._write_content(current_content, output)

            if PyFunceble.CONFIGURATION["share_logs"]:
                # The logs sharing is activated.

                # And we share the logs with the api.
                PyFunceble.requests.post(
                    PyFunceble.LINKS["api_no_referer"], data=to_write[self.current_time]
                )
def referer_not_found(self, extension):
        """
        Logs the case that the referer was not found.

        :param extension: The extension of the domain we are testing.
        :type extension: str
        """

        if PyFunceble.CONFIGURATION["logs"]:
            # The logs subsystem is activated.

            to_write = {
                self.current_time: {
                    "domain": PyFunceble.INTERN["to_test"],
                    "extension": extension,
                }
            }

            if self.output:
                output = self.output
            else:
                output = PyFunceble.OUTPUT_DIRECTORY
                output += PyFunceble.OUTPUTS["parent_directory"]
                output += PyFunceble.OUTPUTS["logs"]["directories"]["parent"]
                output += PyFunceble.OUTPUTS["logs"]["filenames"]["no_referer"]

            current_content = self._get_content(output)
            current_content.update(to_write)

            self._write_content(current_content, output)

            if PyFunceble.CONFIGURATION["share_logs"]:
                # The logs sharing is activated.

                # And we share the logs with the api.
                PyFunceble.requests.post(
                    PyFunceble.LINKS["api_no_referer"], data=to_write[self.current_time]
                )
Logs the case that the referer was not found.

        :param extension: The extension of the domain we are testing.
        :type extension: str