MCPcopy Index your code
hub / github.com/RustPython/RustPython / _copy_from

Method _copy_from

Lib/pathlib/__init__.py:1119–1134  ·  view source on GitHub ↗

Recursively copy the given path to this path.

(self, source, follow_symlinks=True, preserve_metadata=False)

Source from the content-addressed store, hash-verified

1117 return self.copy(target, **kwargs)
1118
1119 def _copy_from(self, source, follow_symlinks=True, preserve_metadata=False):
1120 """
1121 Recursively copy the given path to this path.
1122 """
1123 if not follow_symlinks and source.info.is_symlink():
1124 self._copy_from_symlink(source, preserve_metadata)
1125 elif source.info.is_dir():
1126 children = source.iterdir()
1127 os.mkdir(self)
1128 for child in children:
1129 self.joinpath(child.name)._copy_from(
1130 child, follow_symlinks, preserve_metadata)
1131 if preserve_metadata:
1132 copy_info(source.info, self)
1133 else:
1134 self._copy_from_file(source, preserve_metadata)
1135
1136 def _copy_from_file(self, source, preserve_metadata=False):
1137 ensure_different_files(source, self)

Callers 1

copyMethod · 0.45

Calls 8

_copy_from_symlinkMethod · 0.95
joinpathMethod · 0.95
_copy_from_fileMethod · 0.95
copy_infoFunction · 0.90
is_symlinkMethod · 0.45
is_dirMethod · 0.45
iterdirMethod · 0.45
mkdirMethod · 0.45

Tested by

no test coverage detected