read_file_dict
This commit is contained in:
parent
5eae0334de
commit
daccf01b8c
1 changed files with 2 additions and 2 deletions
|
@ -107,14 +107,14 @@ def read_file_lines(file_path: Path, charset: str = CHARSET) -> list[str]:
|
|||
return read_file_text(file_path, charset).split(os.linesep)
|
||||
|
||||
|
||||
def read_file_object(file_path: Path, charset: str = CHARSET) -> object:
|
||||
def read_file_dict(file_path: Path, charset: str = CHARSET) -> dict:
|
||||
"""Read whole file as toml object.
|
||||
|
||||
:param file_path: source input file
|
||||
:type file_path: Path
|
||||
:param charset: charset to use for decoding input
|
||||
:type charset: str
|
||||
:rtype: object
|
||||
:rtype: dict
|
||||
"""
|
||||
text = read_file_text(file_path, charset)
|
||||
return tomllib.loads(text)
|
||||
|
|
Loading…
Reference in a new issue