def git_clone_job_list(job_list):
    """Deal with all git clone jobs in $job_list."""
    queue = Queue()
    for job in job_list:
        queue.put(job)

    if len(job_list) < 20:
        thread_num = len(job_list)
    else:
        thread_num = 20

    threads = []
    for _ in range(thread_num):
        thread = Thread(target=git_clone_worker, args=(queue, ))
        thread.start()
        threads.append(thread)

    queue.join()

    for _ in range(thread_num):
        queue.put(None)

    for thread in threads:
        thread.join()
def git_clone_job_list ( job_list ) : queue = Queue ( ) for job in job_list : queue . put ( job ) if len ( job_list ) < 20 : thread_num = len ( job_list ) else : thread_num = 20 threads = [ ] for _ in range ( thread_num ) : thread = Thread ( target = git_clone_worker , args = ( queue , ) ) thread . start ( ) threads . append ( thread ) queue . join ( ) for _ in range ( thread_num ) : queue . put ( None ) for thread in threads : thread . join ( )
Deal with all git clone jobs in $job_list.