(profile)
Check if profile is running.
    Returns False if profile hasn't yet saved to allow for an easy quit.
Check if profile is running.
    Returns False if profile hasn't yet saved to allow for an easy quit.
Check if profile is running . Returns False if profile hasn t yet saved to allow for an easy quit .
def check_running_status(profile):
    """Check if profile is running.
    Returns False if profile hasn't yet saved to allow for an easy quit.
    """
    if profile not in RunningApplications().all_loaded_apps():
        return True

    Message(LANGUAGE.strings['GenerationInput']['ProfileRunning'].format_custom(PROFILE=profile))
    
    #Not saved yet
    metadata = get_metadata(profile)
    if metadata is None:
        Message(LANGUAGE.strings['GenerationInput']['ProfileSaveNew'].format_custom(PROFILE=profile))
        Message(LANGUAGE.strings['GenerationInput']['SaveFrequency'].format_custom(TIME=ticks_to_seconds(CONFIG['Save']['Frequency'])))
        return False
    
    #Calculate when the next save should be
    else:
        last_save_time = time.time() - float(metadata['modified'])
        last_save = ticks_to_seconds(last_save_time, allow_decimals=False)

        if last_save_time < CONFIG['Save']['Frequency']:
            next_save_time = CONFIG['Save']['Frequency'] - last_save_time
            next_save = ticks_to_seconds(next_save_time, allow_decimals=False, output_length=2)
            Message(LANGUAGE.strings['GenerationInput']['ProfileSaveNext'].format_custom(PROFILE=profile,
                    PREVIOUS_SAVE=last_save, NEXT_SAVE=next_save))
        else:
            next_save_time = last_save_time - CONFIG['Save']['Frequency']
            next_save = ticks_to_seconds(next_save_time, allow_decimals=False, output_length=1)
            Message(LANGUAGE.strings['GenerationInput']['ProfileSaveDue'].format_custom(PROFILE=profile,
                    PREVIOUS_SAVE=last_save, NEXT_SAVE=next_save))
        Message()
        return True
def check_running_status ( profile ) : if profile not in RunningApplications ( ) . all_loaded_apps ( ) : return True Message ( LANGUAGE . strings [ 'GenerationInput' ] [ 'ProfileRunning' ] . format_custom ( PROFILE = profile ) ) #Not saved yet metadata = get_metadata ( profile ) if metadata is None : Message ( LANGUAGE . strings [ 'GenerationInput' ] [ 'ProfileSaveNew' ] . format_custom ( PROFILE = profile ) ) Message ( LANGUAGE . strings [ 'GenerationInput' ] [ 'SaveFrequency' ] . format_custom ( TIME = ticks_to_seconds ( CONFIG [ 'Save' ] [ 'Frequency' ] ) ) ) return False #Calculate when the next save should be else : last_save_time = time . time ( ) - float ( metadata [ 'modified' ] ) last_save = ticks_to_seconds ( last_save_time , allow_decimals = False ) if last_save_time < CONFIG [ 'Save' ] [ 'Frequency' ] : next_save_time = CONFIG [ 'Save' ] [ 'Frequency' ] - last_save_time next_save = ticks_to_seconds ( next_save_time , allow_decimals = False , output_length = 2 ) Message ( LANGUAGE . strings [ 'GenerationInput' ] [ 'ProfileSaveNext' ] . format_custom ( PROFILE = profile , PREVIOUS_SAVE = last_save , NEXT_SAVE = next_save ) ) else : next_save_time = last_save_time - CONFIG [ 'Save' ] [ 'Frequency' ] next_save = ticks_to_seconds ( next_save_time , allow_decimals = False , output_length = 1 ) Message ( LANGUAGE . strings [ 'GenerationInput' ] [ 'ProfileSaveDue' ] . format_custom ( PROFILE = profile , PREVIOUS_SAVE = last_save , NEXT_SAVE = next_save ) ) Message ( ) return True