(q_send, program_name, data)
Handle saving the data files from the thread.
Handle saving the data files from the thread.
Handle saving the data files from the thread .
def _save_wrapper(q_send, program_name, data):
    """Handle saving the data files from the thread."""
    
    if program_name is not None and program_name[0] == TRACKING_DISABLE:
        return
    
    NOTIFY(LANGUAGE.strings['Tracking']['SavePrepare']).put(q_send)
    saved = False

    #Get how many attempts to use
    max_attempts = CONFIG['Save']['MaximumAttempts']
    
    compressed_data = prepare_file(data)
    
    #Attempt to save
    NOTIFY(LANGUAGE.strings['Tracking']['SaveStart']).put(q_send)
    for i in range(max_attempts):
        if save_data(program_name, compressed_data, _compress=False):
            NOTIFY(LANGUAGE.strings['Tracking']['SaveComplete']).put(q_send)
            saved = True
            break
        
        else:
            if max_attempts == 1:
                NOTIFY(LANGUAGE.strings['Tracking']['SaveIncompleteNoRetry']).put(q_send)
                return

            seconds = round_int(CONFIG['Save']['WaitAfterFail'])
            minutes = round_int(CONFIG['Save']['WaitAfterFail'] / 60)
            NOTIFY(LANGUAGE.strings['Tracking']['SaveIncompleteRetry'], ATTEMPT_CURRENT=i+1, ATTEMPT_MAX=max_attempts,
                   SECONDS=seconds, SECONDS_PLURAL=LANGUAGE.strings['Words'][('TimeSecondSingle', 'TimeSecondPlural')[seconds != 1]],
                   MINUTES=minutes, MINUTES_PLURAL=LANGUAGE.strings['Words'][('TimeMinuteSingle', 'TimeMinutePlural')[minutes != 1]]).put(q_send)

            time.sleep(CONFIG['Save']['WaitAfterFail'])
            
    if not saved:
        NOTIFY(LANGUAGE.strings['Tracking']['SaveIncompleteRetryFail']).put(q_send)
def _save_wrapper ( q_send , program_name , data ) : if program_name is not None and program_name [ 0 ] == TRACKING_DISABLE : return NOTIFY ( LANGUAGE . strings [ 'Tracking' ] [ 'SavePrepare' ] ) . put ( q_send ) saved = False #Get how many attempts to use max_attempts = CONFIG [ 'Save' ] [ 'MaximumAttempts' ] compressed_data = prepare_file ( data ) #Attempt to save NOTIFY ( LANGUAGE . strings [ 'Tracking' ] [ 'SaveStart' ] ) . put ( q_send ) for i in range ( max_attempts ) : if save_data ( program_name , compressed_data , _compress = False ) : NOTIFY ( LANGUAGE . strings [ 'Tracking' ] [ 'SaveComplete' ] ) . put ( q_send ) saved = True break else : if max_attempts == 1 : NOTIFY ( LANGUAGE . strings [ 'Tracking' ] [ 'SaveIncompleteNoRetry' ] ) . put ( q_send ) return seconds = round_int ( CONFIG [ 'Save' ] [ 'WaitAfterFail' ] ) minutes = round_int ( CONFIG [ 'Save' ] [ 'WaitAfterFail' ] / 60 ) NOTIFY ( LANGUAGE . strings [ 'Tracking' ] [ 'SaveIncompleteRetry' ] , ATTEMPT_CURRENT = i + 1 , ATTEMPT_MAX = max_attempts , SECONDS = seconds , SECONDS_PLURAL = LANGUAGE . strings [ 'Words' ] [ ( 'TimeSecondSingle' , 'TimeSecondPlural' ) [ seconds != 1 ] ] , MINUTES = minutes , MINUTES_PLURAL = LANGUAGE . strings [ 'Words' ] [ ( 'TimeMinuteSingle' , 'TimeMinutePlural' ) [ minutes != 1 ] ] ) . put ( q_send ) time . sleep ( CONFIG [ 'Save' ] [ 'WaitAfterFail' ] ) if not saved : NOTIFY ( LANGUAGE . strings [ 'Tracking' ] [ 'SaveIncompleteRetryFail' ] ) . put ( q_send )