Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes11833 committed Nov 22, 2024
1 parent f9d87e9 commit bbd1cdd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions rclone_python/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,17 @@ def rclone_progress(


def extract_rclone_progress(line: str) -> Tuple[bool, Union[Dict[str, Any], None]]:
"""Extracts and returns the progress updates from the rclone transfer operation.
The returned Dictionary includes the original rclone stats output inside of "rclone_output".
All file sizes and speeds are give in bytes.
Args:
line (str): One output line of the rclone transfer operation with the --use-json-log flag enabled.
Returns:
Tuple[bool, Union[Dict[str, Any], None]]: The retrieved update Dictionary.
"""

try:
stats: Dict = json.loads(line).get("stats", None)
except ValueError:
Expand Down

0 comments on commit bbd1cdd

Please sign in to comment.