Skip to content

Commit

Permalink
docstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
tfeldmann committed Aug 30, 2022
1 parent fb0b35a commit cb2282d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fs/move.py
Expand Up @@ -29,13 +29,15 @@ def move_fs(
):
# type: (...) -> None
"""Move the contents of a filesystem to another filesystem.
Arguments:
src_fs (FS or str): Source filesystem (instance or URL).
dst_fs (FS or str): Destination filesystem (instance or URL).
workers (int): Use `worker` threads to copy data, or ``0`` (default) for
a single-threaded copy.
preserve_time (bool): If `True`, try to preserve mtime of the
resources (defaults to `False`).
"""
move_dir(src_fs, "/", dst_fs, "/", workers=workers, preserve_time=preserve_time)

Expand All @@ -50,6 +52,7 @@ def move_file(
):
# type: (...) -> None
"""Move a file from one filesystem to another.
Arguments:
src_fs (FS or str): Source filesystem (instance or URL).
src_path (str): Path to a file on ``src_fs``.
Expand All @@ -59,6 +62,7 @@ def move_file(
resources (defaults to `False`).
cleanup_dst_on_error (bool): If `True`, tries to delete the file copied to
``dst_fs`` if deleting the file from ``src_fs`` fails (defaults to `True`).
"""
with manage_fs(src_fs, writeable=True) as _src_fs:
with manage_fs(dst_fs, writeable=True, create=True) as _dst_fs:
Expand Down Expand Up @@ -122,6 +126,7 @@ def move_dir(
):
# type: (...) -> None
"""Move a directory from one filesystem to another.
Arguments:
src_fs (FS or str): Source filesystem (instance or URL).
src_path (str): Path to a directory on ``src_fs``
Expand All @@ -131,11 +136,13 @@ def move_dir(
(default) for a single-threaded copy.
preserve_time (bool): If `True`, try to preserve mtime of the
resources (defaults to `False`).
Raises:
fs.errors.ResourceNotFound: if ``src_path`` does not exist on `src_fs`
fs.errors.DirectoryExpected: if ``src_path`` or one of its
ancestors is not a directory.
fs.errors.IllegalDestination: when moving a folder into itself
"""
with manage_fs(src_fs, writeable=True) as _src_fs:
with manage_fs(dst_fs, writeable=True, create=True) as _dst_fs:
Expand Down

0 comments on commit cb2282d

Please sign in to comment.