format
This commit is contained in:
parent
aa1f06c20f
commit
3393f09907
2 changed files with 4 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
|||
"""Handle errors."""
|
||||
|
||||
|
||||
class Error(Exception):
|
||||
"""Parent class for all errors."""
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue