def copy_dir(src, dst, symlinks=False, ignore=None):
"""
copy directory from source to destiny
"""
if not os.path.exists(dst):
os.makedirs(dst)
for item in os.listdir(src):
s = os.path.join(src, item)
d = os.path.join(dst, item)
if os.path.isdir(s):
if os.path.exists(d):
continue
shutil.copytree(s, d, symlinks, ignore)
else:
shutil.copy2(s, d)