Skip to content

Commit 9448a95

Browse files
committed
Updated documentation.
1 parent 67c7492 commit 9448a95

File tree

6 files changed

+40
-7
lines changed

6 files changed

+40
-7
lines changed

doc-source/api/terminal_colours.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44

55
.. automodule:: domdf_python_tools.terminal_colours
66
:members:
7+
:autosummary:

doc-source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
]
5454

5555
sphinxemoji_style = 'twemoji'
56-
todo_include_todos = bool(os.environ.get("SHOW_TODOS", False))
56+
todo_include_todos = bool(os.environ.get("SHOW_TODOS", 0))
5757
gitstamp_fmt = "%d %b %Y"
5858

5959
templates_path = ['_templates']

doc-source/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
autodocsumm
22
extras_require
33
pytz>=2019.1
4+
sphinx>=3.0.3
45
sphinx-copybutton>=0.2.12
56
sphinx-notfound-page
67
sphinx-prompt>=1.2.0
78
sphinx-tabs>=1.1.13
8-
sphinx>=3.0.3
99
sphinx_autodoc_typehints>=1.11.0
10-
sphinx_rtd_theme<0.4
10+
sphinx_rtd_theme<0.5
1111
sphinxcontrib-httpdomain>=1.7.0
1212
sphinxemoji>=0.1.6

domdf_python_tools/paths.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ class PathPlus(pathlib.Path):
282282
instantiating a Path will return either a PosixPath or a WindowsPath
283283
object. You can also instantiate a PosixPath or WindowsPath directly,
284284
but cannot instantiate a WindowsPath on a POSIX system or vice versa.
285+
286+
.. versionadded:: 0.3.8
285287
"""
286288

287289
def __new__(cls, *args, **kwargs):
@@ -296,6 +298,8 @@ def __new__(cls, *args, **kwargs):
296298
def make_executable(self):
297299
"""
298300
Make the file executable.
301+
302+
.. versionadded:: 0.3.8
299303
"""
300304

301305
make_executable(self)
@@ -313,6 +317,8 @@ def write_clean(
313317
:type string: str
314318
:param encoding: The encoding to write to the file using. Default ``"UTF-8"``.
315319
:param errors:
320+
321+
.. versionadded:: 0.3.8
316322
"""
317323

318324
with self.open("w", encoding=encoding, errors=errors) as fp:
@@ -338,6 +344,8 @@ def maybe_make(
338344
will be ignored (same behavior as the POSIX mkdir -p command), but only if the last path
339345
component is not an existing non-directory file.
340346
:type exist_ok: bool, optional
347+
348+
.. versionadded:: 0.3.8
341349
"""
342350

343351
maybe_make(self, mode=mode, parents=parents, exist_ok=exist_ok)
@@ -355,6 +363,8 @@ def append_text(
355363
:type string: str
356364
:param encoding: The encoding to write to the file using. Default ``"UTF-8"``.
357365
:param errors:
366+
367+
.. versionadded:: 0.3.8
358368
"""
359369

360370
with self.open("a", encoding=encoding, errors=errors) as fp:
@@ -373,6 +383,8 @@ def write_text(
373383
:type data: str
374384
:param encoding: The encoding to write to the file using. Default ``"UTF-8"``.
375385
:param errors:
386+
387+
.. versionadded:: 0.3.8
376388
"""
377389

378390
return super().write_text(data, encoding=encoding, errors=errors)
@@ -389,6 +401,8 @@ def read_text(
389401
:param errors:
390402
391403
:return: The content of the file.
404+
405+
.. versionadded:: 0.3.8
392406
"""
393407

394408
return super().read_text(encoding=encoding, errors=errors)
@@ -404,6 +418,19 @@ def open(
404418
"""
405419
Open the file pointed by this path and return a file object, as
406420
the built-in open() function does.
421+
422+
:param mode: The mode to open the file in. Default ``"r"`` (read only.
423+
:type mode: str
424+
:param buffering:
425+
:type buffering: int
426+
:param encoding:
427+
:type encoding: str
428+
:param errors:
429+
:param newline:
430+
431+
:return:
432+
433+
.. versionadded:: 0.3.8
407434
"""
408435

409436
if 'b' in mode:
@@ -415,6 +442,8 @@ class PosixPathPlus(PathPlus, pathlib.PurePosixPath):
415442
"""Path subclass for non-Windows systems.
416443
417444
On a POSIX system, instantiating a PathPlus object should return an instance of this class.
445+
446+
.. versionadded:: 0.3.8
418447
"""
419448
__slots__ = ()
420449

@@ -423,6 +452,8 @@ class WindowsPathPlus(PathPlus, pathlib.PureWindowsPath):
423452
"""Path subclass for Windows systems.
424453
425454
On a Windows system, instantiating a PathPlus object should return an instance of this class.
455+
456+
.. versionadded:: 0.3.8
426457
"""
427458
__slots__ = ()
428459

domdf_python_tools/terminal.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def clear() -> None:
7676
"""
7777
Clears the display.
7878
79-
Works for Windows and UNIX, but does not clear Python Interpreter or PyCharm Console.
79+
Works for Windows and POSIX, but does not clear the Python Interpreter or PyCharm's Console.
8080
"""
8181

8282
if os.name == "nt":
@@ -106,17 +106,17 @@ def interrupt() -> None:
106106

107107
def overtype(*objects, sep: str = ' ', end: str = '', file=sys.stdout, flush: bool = False) -> None:
108108
"""
109-
Print ``objects`` to the text stream ``file``, starting with "\\r", separated by ``sep``
109+
Print ``objects`` to the text stream ``file``, starting with ``"\\r"``, separated by ``sep``
110110
and followed by ``end``.
111111
112112
``sep``, ``end``, ``file`` and ``flush``, if present, must be given as keyword arguments
113113
114114
All non-keyword arguments are converted to strings like :class:`str` does and written to the stream,
115115
separated by `sep` and followed by `end`.
116116
117-
If no objects are given, :func:`~domdf_python_tools.terminal.overtype` will just write "\\r".
117+
If no objects are given, :func:`~domdf_python_tools.terminal.overtype` will just write ``"\\r"``.
118118
119-
TODO: This does not currently work in the PyCharm console, at least on Windows
119+
.. TODO:: This does not currently work in the PyCharm console, at least on Windows
120120
121121
:param objects: A list of strings or string-like objects to write to the terminal.
122122
:param sep: String to separate the objects with, by default " "

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ commands =
3434

3535

3636
[testenv:docs]
37+
setenv = SHOW_TODOS = 1
3738
basepython = python3.8
3839
changedir = {toxinidir}/doc-source
3940
deps =

0 commit comments

Comments
 (0)