Skip to content

Commit 540e660

Browse files
committed
Tidying up
1 parent 9abafe9 commit 540e660

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

domdf_python_tools/enums.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
# class IntEnum(Enum):
3232
# """
33-
# An Enum that can be converted into an integer
33+
# An Enum that can be converted into an integer.
3434
# """
3535
#
3636
# def __int__(self):
@@ -45,7 +45,7 @@
4545

4646
class StrEnum(str, Enum):
4747
"""
48-
An Enum that can be converted into a string
48+
An Enum that can be converted into a string.
4949
"""
5050

5151
def __str__(self) -> str:

domdf_python_tools/paths.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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

155155
def 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

170170
def 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

226226
def 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

240240
def 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

262262
def make_executable(filename: PathLike) -> None:

tests/test_terminal_colours.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def test_back_attributes(obj, expects, capsys):
120120
(Style.BRIGHT, "\033[1m"),
121121
]
122122
)
123-
def test_back_attributes(obj, expects, capsys):
123+
def test_style_attributes(obj, expects, capsys):
124124
assert obj == expects
125125
assert obj("Hello World") == f"{obj}Hello World\033[22m"
126126

@@ -138,9 +138,3 @@ def test_back_attributes(obj, expects, capsys):
138138
assert stdout[2] == f"{obj}Coloured Again!"
139139
assert stdout[3] == f"\033[22mReset Again!"
140140
assert stdout[4] == ''
141-
142-
143-
def test_style_attributes():
144-
assert Style.DIM == "\033[2m"
145-
assert Style.NORMAL == "\033[22m"
146-
assert Style.BRIGHT == "\033[1m"

0 commit comments

Comments
 (0)