From 0d63d44ac89aab38fe95f36497adaf95110ab949 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Tue, 8 Feb 2022 14:38:15 -0800 Subject: More cleanup. --- file_utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'file_utils.py') 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() -- cgit v1.3