mv
This commit is contained in:
parent
daccf01b8c
commit
eb3c9814bb
1 changed files with 12 additions and 12 deletions
|
@ -95,18 +95,6 @@ def read_file_bytes(file_path: Path) -> bytes:
|
||||||
return file_object.read()
|
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:
|
def read_file_dict(file_path: Path, charset: str = CHARSET) -> dict:
|
||||||
"""Read whole file as toml object.
|
"""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)
|
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:
|
def read_file_text(file_path: Path, charset: str = CHARSET) -> str:
|
||||||
"""Read whole file text.
|
"""Read whole file text.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue