Compare commits

..

No commits in common. "4e369df232f527dc9640e1a55373453d70f0feb6" and "d4d60982415d69ab5e4759c6cd62e5db27866d02" have entirely different histories.

2 changed files with 4 additions and 4 deletions

View file

@ -52,18 +52,18 @@ def make_directory(path: Path) -> None:
path.mkdir(exist_ok=True, parents=True) path.mkdir(exist_ok=True, parents=True)
def read_file_bytes(file_path: Path) -> bytes: def read_file_bytes(file_path: str) -> bytes:
"""Read whole file bytes.""" """Read whole file bytes."""
with file_path.open("br") as file_object: with Path(file_path).open("br") as file_object:
return file_object.read() return file_object.read()
def read_file_lines(file_path: Path, charset: str = CHARSET) -> list[str]: def read_file_lines(file_path: str, charset: str = CHARSET) -> list[str]:
"""Read whole file lines.""" """Read whole file lines."""
return read_file_text(file_path, charset).split(os.linesep) 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: str, charset: str = CHARSET) -> str:
"""Read whole file text.""" """Read whole file text."""
return read_file_bytes(file_path).decode(charset) return read_file_bytes(file_path).decode(charset)

View file