From eb3c9814bb1f1f5408fa2667437cbf4050ac1493 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 23 Sep 2024 18:49:34 +0200 Subject: [PATCH] mv --- rwx/fs/__init__.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/rwx/fs/__init__.py b/rwx/fs/__init__.py index 46a26e6..205746d 100644 --- a/rwx/fs/__init__.py +++ b/rwx/fs/__init__.py @@ -95,18 +95,6 @@ def read_file_bytes(file_path: Path) -> bytes: return file_object.read() -def read_file_lines(file_path: Path, charset: str = CHARSET) -> list[str]: - """Read whole file lines. - - :param file_path: source input file - :type file_path: Path - :param charset: charset to use for decoding input - :type charset: str - :rtype: list[str] - """ - return read_file_text(file_path, charset).split(os.linesep) - - def read_file_dict(file_path: Path, charset: str = CHARSET) -> dict: """Read whole file as toml object. @@ -120,6 +108,18 @@ def read_file_dict(file_path: Path, charset: str = CHARSET) -> dict: return tomllib.loads(text) +def read_file_lines(file_path: Path, charset: str = CHARSET) -> list[str]: + """Read whole file lines. + + :param file_path: source input file + :type file_path: Path + :param charset: charset to use for decoding input + :type charset: str + :rtype: list[str] + """ + return read_file_text(file_path, charset).split(os.linesep) + + def read_file_text(file_path: Path, charset: str = CHARSET) -> str: """Read whole file text.