| |
- copy = move(sources: Iterable[Union[str, pathlib.Path]], destination: Union[str, pathlib.Path] = None, excludes: Iterable[Union[str, pathlib.Path]] = None, merge: Callable[[str, str, pathlib.Path], str] = None, required: bool = False) -> bool
- copy file(s) at source to current directory, preserving file mode.
Args:
sources (ListOfPathsOrStrs): Glob pattern(s) to copy
destination (PathOrStr): Destination folder for copied files
excludes (ListOfPathsOrStrs): Glob pattern(s) of files to skip
merge (Callable[[str, str, Path], str]): Callback function for merging files
if there is an existing file.
required (bool): If required and no source files are copied, throws a MissingSourceError
Returns:
True if any files were copied, False otherwise.
- dont_overwrite(patterns: Iterable[Union[str, pathlib.Path]]) -> Callable[[str, str, pathlib.Path], str]
- Returns a merge function that doesn't overwrite the specified files.
Pass the return value to move() or copy() to avoid overwriting existing
files.
- move(sources: Iterable[Union[str, pathlib.Path]], destination: Union[str, pathlib.Path] = None, excludes: Iterable[Union[str, pathlib.Path]] = None, merge: Callable[[str, str, pathlib.Path], str] = None, required: bool = False) -> bool
- copy file(s) at source to current directory, preserving file mode.
Args:
sources (ListOfPathsOrStrs): Glob pattern(s) to copy
destination (PathOrStr): Destination folder for copied files
excludes (ListOfPathsOrStrs): Glob pattern(s) of files to skip
merge (Callable[[str, str, Path], str]): Callback function for merging files
if there is an existing file.
required (bool): If required and no source files are copied, throws a MissingSourceError
Returns:
True if any files were copied, False otherwise.
- replace(sources: Iterable[Union[str, pathlib.Path]], before: str, after: str, flags: int = <RegexFlag.MULTILINE: 8>) -> int
- Replaces occurrences of before with after in all the given sources.
Returns:
The number of times the text was found and replaced across all files.
|