PyFunceble/auto_continue.py
def backup(self):
        """
        Backup the current execution state.
        """

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

            # We initiate the location where we are going to save the data to backup.
            data_to_backup = {}
            # We get the current counter states.
            configuration_counter = PyFunceble.INTERN["counter"]["number"]

            # We initiate the data we have to backup.
            data_to_backup[PyFunceble.INTERN["file_to_test"]] = {
                # We backup the number of tested.
                "tested": configuration_counter["tested"],
                # We backup the number of up.
                "up": configuration_counter["up"],
                # We backup the number of down.
                "down": configuration_counter["down"],
                # We backup the number of invalid.
                "invalid": configuration_counter["invalid"],
            }

            # We initiate the final data we have to save.
            # We initiate this variable instead of updating backup_content because
            # we do not want to touch the backup_content.
            to_save = {}

            # We add the backup_content into to_save.
            to_save.update(self.backup_content)
            # And we overwrite with the newly data to backup.
            to_save.update(data_to_backup)

            # Finaly, we save our informations into the log file.
            Dict(to_save).to_json(self.autocontinue_log_file)
def backup(self):
        if PyFunceble.CONFIGURATION["auto_continue"]:
            # The auto_continue subsystem is activated.

            # We initiate the location where we are going to save the data to backup.
            data_to_backup = {}
            # We get the current counter states.
            configuration_counter = PyFunceble.INTERN["counter"]["number"]

            # We initiate the data we have to backup.
            data_to_backup[PyFunceble.INTERN["file_to_test"]] = {
                # We backup the number of tested.
                "tested": configuration_counter["tested"],
                # We backup the number of up.
                "up": configuration_counter["up"],
                # We backup the number of down.
                "down": configuration_counter["down"],
                # We backup the number of invalid.
                "invalid": configuration_counter["invalid"],
            }

            # We initiate the final data we have to save.
            # We initiate this variable instead of updating backup_content because
            # we do not want to touch the backup_content.
            to_save = {}

            # We add the backup_content into to_save.
            to_save.update(self.backup_content)
            # And we overwrite with the newly data to backup.
            to_save.update(data_to_backup)

            # Finaly, we save our informations into the log file.
            Dict(to_save).to_json(self.autocontinue_log_file)
def backup ( self ) : if PyFunceble . CONFIGURATION [ "auto_continue" ] : # The auto_continue subsystem is activated. # We initiate the location where we are going to save the data to backup. data_to_backup = { } # We get the current counter states. configuration_counter = PyFunceble . INTERN [ "counter" ] [ "number" ] # We initiate the data we have to backup. data_to_backup [ PyFunceble . INTERN [ "file_to_test" ] ] = { # We backup the number of tested. "tested" : configuration_counter [ "tested" ] , # We backup the number of up. "up" : configuration_counter [ "up" ] , # We backup the number of down. "down" : configuration_counter [ "down" ] , # We backup the number of invalid. "invalid" : configuration_counter [ "invalid" ] , } # We initiate the final data we have to save. # We initiate this variable instead of updating backup_content because # we do not want to touch the backup_content. to_save = { } # We add the backup_content into to_save. to_save . update ( self . backup_content ) # And we overwrite with the newly data to backup. to_save . update ( data_to_backup ) # Finaly, we save our informations into the log file. Dict ( to_save ) . to_json ( self . autocontinue_log_file )
Backup the current execution state.
Backup the current execution state .