diff options
Diffstat (limited to 'file_utils.py')
| -rw-r--r-- | file_utils.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/file_utils.py b/file_utils.py index 6bcfc75..d1e2eff 100644 --- a/file_utils.py +++ b/file_utils.py @@ -6,7 +6,6 @@ import datetime import errno import glob import hashlib -import io import logging import os import pathlib @@ -190,7 +189,7 @@ def create_path_if_not_exist(path, on_error=None): >>> os.path.exists(path) True """ - logger.debug(f"Creating path {path}") + logger.debug("Creating path %s", path) previous_umask = os.umask(0) try: os.makedirs(path) @@ -462,6 +461,11 @@ def get_files_recursive(directory: str): class FileWriter(object): + """A helper that writes a file to a temporary location and then moves + it atomically to its ultimate destination on close. + + """ + def __init__(self, filename: str) -> None: self.filename = filename uuid = uuid4() |
