|
From: <mi...@us...> - 2022-11-21 20:51:26
|
Revision: 9259
http://sourceforge.net/p/docutils/code/9259
Author: milde
Date: 2022-11-21 20:51:23 +0000 (Mon, 21 Nov 2022)
Log Message:
-----------
Small documentation fixes.
transforms.txt:
Update "added by" in "Transforms Listed in Priority Order".
io.py:
reword docstrings and assertion messages,
use PEP 257 "Docstring Conventions".
Modified Paths:
--------------
trunk/docutils/docs/api/transforms.txt
trunk/docutils/docutils/io.py
Modified: trunk/docutils/docs/api/transforms.txt
===================================================================
--- trunk/docutils/docs/api/transforms.txt 2022-11-21 14:51:43 UTC (rev 9258)
+++ trunk/docutils/docs/api/transforms.txt 2022-11-21 20:51:23 UTC (rev 9259)
@@ -114,7 +114,7 @@
writer_aux.Compound *not used, to be removed* 910
-writer_aux.Admonitions html4css1 (w), 920
+writer_aux.Admonitions _html_base (w), 920
latex2e (w)
misc.CallBack n/a 990
@@ -202,7 +202,7 @@
writers.latex2e.Writer
writer_aux.Admonitions
-writers.html4css1.Writer:
+writers._html_base.Writer:
writer_aux.Admonitions
writers.odf_odt.Writer:
Modified: trunk/docutils/docutils/io.py
===================================================================
--- trunk/docutils/docutils/io.py 2022-11-21 14:51:43 UTC (rev 9258)
+++ trunk/docutils/docutils/io.py 2022-11-21 20:51:23 UTC (rev 9259)
@@ -136,7 +136,7 @@
"""
if self.encoding and self.encoding.lower() == 'unicode':
assert isinstance(data, str), ('input encoding is "unicode" '
- 'but input is not a `str` object')
+ 'but `data` is no `str` instance')
if isinstance(data, str):
# nothing to decode
return data
@@ -255,9 +255,8 @@
If `data` is a `bytes` instance, it is returned unchanged.
"""
if self.encoding and self.encoding.lower() == 'unicode':
- assert isinstance(data, str), (
- 'the encoding given is "unicode" but the output is not '
- 'a Unicode string')
+ assert isinstance(data, str), ('output encoding is "unicode" '
+ 'but `data` is no `str` instance')
return data
if not isinstance(data, str):
# Non-unicode (e.g. bytes) output.
@@ -604,8 +603,8 @@
"""Encode `data`, store it in `self.destination`, and return it.
If `self.encoding` is set to the pseudo encoding name "unicode",
- `data` must be a `str` instance and is returned unchanged.
- (cf. `Output.encode`)
+ `data` must be a `str` instance and is returned unchanged
+ (cf. `Output.encode`).
"""
self.destination = self.encode(data)
return self.destination
@@ -613,22 +612,18 @@
class NullInput(Input):
- """
- Degenerate input: read nothing.
- """
+ """Degenerate input: read nothing."""
default_source_path = 'null input'
def read(self):
- """Return a null string."""
+ """Return an empty string."""
return ''
class NullOutput(Output):
- """
- Degenerate output: write nothing.
- """
+ """Degenerate output: write nothing."""
default_destination_path = 'null output'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|