22#
33# paths.py
44"""
5- Functions for paths and files
5+ Functions for paths and files.
66"""
77#
88# Copyright © 2018-2020 Dominic Davis-Foster <[email protected] > @@ -154,7 +154,7 @@ def maybe_make(directory: PathLike, mode=0o777, parents: bool = False, exist_ok:
154154
155155def parent_path (path : PathLike ) -> pathlib .Path :
156156 """
157- Returns the path of the parent directory for the given file or directory
157+ Returns the path of the parent directory for the given file or directory.
158158
159159 :param path: Path to find the parent for
160160
@@ -169,7 +169,7 @@ def parent_path(path: PathLike) -> pathlib.Path:
169169
170170def read (filename : PathLike ) -> str :
171171 """
172- Read a file in the current directory (in text mode)
172+ Read a file in the current directory (in text mode).
173173
174174 .. warning::
175175
@@ -225,7 +225,7 @@ def relpath(path: PathLike, relative_to: Optional[PathLike] = None) -> pathlib.P
225225
226226def write (var : str , filename : PathLike ) -> None :
227227 """
228- Write a variable to file in the current directory
228+ Write a variable to file in the current directory.
229229
230230 TODO: make this the file in the given directory, by default the current directory
231231
@@ -239,7 +239,7 @@ def write(var: str, filename: PathLike) -> None:
239239
240240def clean_writer (string : str , fp : IO ) -> None :
241241 """
242- Write string to ``fp`` without trailing spaces
242+ Write string to ``fp`` without trailing spaces.
243243
244244 :param string:
245245 :type string: str
@@ -256,7 +256,7 @@ def clean_writer(string: str, fp: IO) -> None:
256256
257257 for line in buffer :
258258 fp .write (line )
259- fp .write (" \n " )
259+ fp .write (' \n ' )
260260
261261
262262def make_executable (filename : PathLike ) -> None :
0 commit comments