Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)

        def sync_dir_to(src_dir, dst_dir, exclude=None, include=None, ignore_existing=False):
    if not path.exists(dst_dir):
        os.makedirs(dst_dir)

    files_to_copy = get_file_list(src_dir, exclude=exclude, include=include)
    for filename in files_to_copy:
        src = path.join(src_dir, filename)
        dst = path.join(dst_dir, filename)
                
        if ignore_existing and path.exists(dst):
            continue
        else:
            yield (filename, dst)
            dir = path.dirname(dst)
            if not path.exists(dir):
                os.makedirs(dir)
            shutil.copy2(src, dst)
        


src/c/i/cipr-0.7.7/src/cipr/commands/core.py   cipr(Download)
 
    console.quiet('Copying files from %s' % templ_dir)
    for src, dst in util.sync_dir_to(templ_dir, env.project_directory, ignore_existing=True):
        console.quiet('  %s -> %s' % (src, dst))
 
        os.makedirs(env.dist_dir)
 
    for src, dst in util.sync_dir_to(env.project_directory, env.build_dir, exclude=['.cipr', '.git', 'build', 'dist']):
        console.quiet('  %s -> %s' % (src, dst))
 

src/c/o/corona-cipr-HEAD/src/cipr/commands/core.py   corona-cipr(Download)
 
    console.quiet('Copying files from %s' % templ_dir)
    for src, dst in util.sync_dir_to(templ_dir, env.project_directory, ignore_existing=True):
        console.quiet('  %s -> %s' % (src, dst))
 
        os.makedirs(env.dist_dir)
 
    for src, dst in util.sync_dir_to(env.project_directory, env.build_dir, exclude=['.cipr', '.git', 'build', 'dist']):
        console.quiet('  %s -> %s' % (src, dst))