Exemplo n.º 1
0
def time_for_end(PATH, subject_name, operation_name, out_flag, status_list):
    if out_flag.isSet():
        sender = subject_name
        message = "Completion of an operation " + operation_name + "."
        logger.message_output(sender, message)
        view_update.status_changer(status_list, "offline")
        return True
    else:
        return False
Exemplo n.º 2
0
def run_video_checker(out_flag, status_list, sessions_list, subject):
    checker_name = "video_checker_settings"
    operation_name = "new video checking"
    PATH, path_to_json, subject_data, subject_section_data =\
        load_data_for_checker(checker_name, subject, operation_name)
    while True:
        view_update.status_changer(status_list, "processing")
        if time_for_end(PATH, subject["name"], operation_name, out_flag,
                        status_list):
            return
        sender = subject["name"] + " " + operation_name
        checker.check_for_videos(sender, path_to_json, subject, subject_data,
                                 subject_section_data, sessions_list)
        view_update.status_changer(status_list, "waiting")
        interval = subject_section_data["interval"]
        i = 0
        while i < interval:
            time.sleep(1)
            if time_for_end(PATH, subject["name"], operation_name, out_flag,
                            status_list):
                return
            i += 1