コード例 #1
0
def init():
    """
    Gloabl Initialization routine for task
    """

    """ Create SharedState and give it runf """
    state = SharedState(task_name)
    state.runf = runf
    state.taskfolder = task_folder
    state.statepath = task_statepath

    if newstart:
        print('new start...')
        initial_idset = set(util.get_initial_ids())
        existing_idset = set()
        # initial_idset = set(config.get_initial_ids())
        # existing_idset = config.get_existing_idset()
        new_idset = initial_idset.difference(existing_idset)

        state.add_idset(new_idset)
        state.add_idset(existing_idset)

        """ Necessary step, initialize the task queue """
        for job in new_idset:
            state.queue.put(job)

        print('actually # ids used : %d' % len(new_idset))

    else:
        print('resuming from saved state...')
        state.fromfile(task_statepath)

    return state
コード例 #2
0
def init():
    """
    Gloabl Initialization routine for task
    """
    print("Init -- download user review for selected apps")

    """ general initialization """

    """ Create SharedState and give it runf """
    state = SharedState(task_name)
    state.runf = runf
    state.taskfolder = task_folder
    state.statepath = task_statepath

    if newstart:
        print('new start...')

        """todo initial id set should be from the 5000 selected developers """
        initial_idset = set(get_selected_appids_kai())
        print('# new ids is : %d' % len(initial_idset))
        state.add_idset(initial_idset)

        """ Necessary step, initialize the task queue """
        for job in initial_idset:
            state.queue.put(job)

    else:
        print('resuming from saved state...')
        state.fromfile(task_statepath)

    return state