MCPcopy Index your code
hub / github.com/kivy/python-for-android / copy_files

Function copy_files

pythonforandroid/bootstrap.py:20–40  ·  view source on GitHub ↗
(src_root, dest_root, override=True, symlink=False)

Source from the content-addressed store, hash-verified

18
19
20def copy_files(src_root, dest_root, override=True, symlink=False):
21 for root, dirnames, filenames in walk(src_root):
22 for filename in filenames:
23 subdir = normpath(root.replace(src_root, ""))
24 if subdir.startswith(sep): # ensure it is relative
25 subdir = subdir[1:]
26 dest_dir = join(dest_root, subdir)
27 if not os.path.exists(dest_dir):
28 os.makedirs(dest_dir)
29 src_file = join(root, filename)
30 dest_file = join(dest_dir, filename)
31 if os.path.isfile(src_file):
32 if override and os.path.exists(dest_file):
33 os.unlink(dest_file)
34 if not os.path.exists(dest_file):
35 if symlink:
36 os.symlink(src_file, dest_file)
37 else:
38 shutil.copy(src_file, dest_file)
39 else:
40 os.makedirs(dest_file)
41
42
43default_recipe_priorities = [

Callers 2

_copy_in_final_filesMethod · 0.85
prepare_build_dirMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected