Ejemplo n.º 1
0
def start_background_check(*args):
    # print '# Starting publish background check...'
    defer_to_main_thread(_update_buttons, None)

    references = call_in_main_thread(cmds.file, q=True, reference=True)
    geocaches = call_in_main_thread(geocache_utils.get_existing_cache_mappings).keys()
    threading.Thread(target=_background_check, args=[references + geocaches]).start()
Ejemplo n.º 2
0
def start_background_check(*args):
    # print '# Starting publish background check...'
    defer_to_main_thread(_update_buttons, None)

    references = call_in_main_thread(cmds.file, q=True, reference=True)
    geocaches = call_in_main_thread(
        geocache_utils.get_existing_cache_mappings).keys()
    threading.Thread(target=_background_check,
                     args=[references + geocaches]).start()
Ejemplo n.º 3
0
def _background_check(references):

    with _check_lock:

        statuses = check_paths(references, only_published=True)
        if not statuses:
            # print '# No publishes are referenced.'
            defer_to_main_thread(_update_buttons, True)
            return

        out_of_date = []
        good = 0
        for status in statuses:
            if status.is_latest:
                good += 1
            else:
                out_of_date.append(status)

        if not out_of_date:
            # print '# None of the %d publishes are out of date.' % good
            defer_to_main_thread(_update_buttons, True)
            return

        # print '# %d publishes are out of date.' % len(out_of_date)
        defer_to_main_thread(_update_buttons, False)
        defer_to_main_thread(
            cmds.warning, '%d publish(es) are out of date.' % len(out_of_date))
Ejemplo n.º 4
0
def _background_check(references):

    with _check_lock:

        statuses = check_paths(references, only_published=True)
        if not statuses:
            # print '# No publishes are referenced.'
            defer_to_main_thread(_update_buttons, True)
            return

        out_of_date = []
        good = 0
        for status in statuses:
            if status.is_latest:
                good += 1
            else:
                out_of_date.append(status)

        if not out_of_date:
            # print '# None of the %d publishes are out of date.' % good
            defer_to_main_thread(_update_buttons, True)
            return

        # print '# %d publishes are out of date.' % len(out_of_date)
        defer_to_main_thread(_update_buttons, False)
        defer_to_main_thread(cmds.warning, '%d publish(es) are out of date.' % len(out_of_date))