From 3393f0990742dda006ded747dae2e50319356af2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 13 Sep 2024 17:13:37 +0200 Subject: [PATCH] format --- rwx/err/__init__.py | 1 + rwx/fs/__init__.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/rwx/err/__init__.py b/rwx/err/__init__.py index 5df6b97..294d8d8 100644 --- a/rwx/err/__init__.py +++ b/rwx/err/__init__.py @@ -1,4 +1,5 @@ """Handle errors.""" + class Error(Exception): """Parent class for all errors.""" diff --git a/rwx/fs/__init__.py b/rwx/fs/__init__.py index 64a8483..514fcec 100644 --- a/rwx/fs/__init__.py +++ b/rwx/fs/__init__.py @@ -56,11 +56,11 @@ def read_file(file_path: str): return file_object.read() -def read_file_lines(file_path: str, charset:str=CHARSET): +def read_file_lines(file_path: str, charset: str = CHARSET): return read_file_text(file_path).split(os.linesep) -def read_file_text(file_path: str, charset:str=CHARSET): +def read_file_text(file_path: str, charset: str = CHARSET): return read_file(file_path).decode(charset) @@ -74,7 +74,7 @@ def wipe(path: str) -> None: pass -def write(file_path: str, text: str, charset:str=CHARSET) -> None: +def write(file_path: str, text: str, charset: str = CHARSET) -> None: """Write text into a file.""" with open(file_path, "bw") as file_object: file_object.write(text.encode(charset))