|
From: <mi...@us...> - 2023-04-17 20:26:44
|
Revision: 9352
http://sourceforge.net/p/docutils/code/9352
Author: milde
Date: 2023-04-17 20:26:41 +0000 (Mon, 17 Apr 2023)
Log Message:
-----------
The "null" writer will generate an empty string in Docutils 0.22.
Update writer documentation to Python 3 terminology.
Format multi-line docstrings according to policies.
Writers generate `str` or `bytes` output.
In future, the "null" writer will also generate `str` output
for consistency with other writers and the documentation.
Modified Paths:
--------------
trunk/docutils/RELEASE-NOTES.txt
trunk/docutils/docutils/writers/__init__.py
trunk/docutils/docutils/writers/null.py
Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt 2023-04-17 20:26:33 UTC (rev 9351)
+++ trunk/docutils/RELEASE-NOTES.txt 2023-04-17 20:26:41 UTC (rev 9352)
@@ -133,6 +133,8 @@
- Remove ``use_verbatim_when_possible`` setting
(use literal_block_env_: verbatim) in Docutils 2.0.
+* "null" writer: output will change to the empty string in Docutils 0.22.
+
* The default value of the `auto_encode` argument of `core.publish_str()`,
`core.publish_from_doctree()`, and `core.publish_programmatically()`
will change to ``False`` in Docutils 0.22.
Modified: trunk/docutils/docutils/writers/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/__init__.py 2023-04-17 20:26:33 UTC (rev 9351)
+++ trunk/docutils/docutils/writers/__init__.py 2023-04-17 20:26:41 UTC (rev 9352)
@@ -36,19 +36,23 @@
universal.StripClassesAndElements]
document = None
- """The document to write (Docutils doctree); set by `write`."""
+ """The document to write (Docutils doctree); set by `write()`."""
output = None
- """Final translated form of `document` (Unicode string for text, binary
- string for other forms); set by `translate`."""
+ """Final translated form of `document`
+ (`str` for text, `bytes` for binary formats); set by `translate()`.
+ """
+
language = None
- """Language module for the document; set by `write`."""
+ """Language module for the document; set by `write()`."""
destination = None
"""`docutils.io` Output object; where to write the document.
- Set by `write`."""
+ Set by `write()`.
+ """
+
def __init__(self):
# Used by HTML and LaTeX writer for output fragments:
Modified: trunk/docutils/docutils/writers/null.py
===================================================================
--- trunk/docutils/docutils/writers/null.py 2023-04-17 20:26:33 UTC (rev 9351)
+++ trunk/docutils/docutils/writers/null.py 2023-04-17 20:26:41 UTC (rev 9352)
@@ -4,6 +4,9 @@
"""
A do-nothing Writer.
+
+`self.output` will change from ``None`` to the empty string
+in Docutils 0.22.
"""
from docutils import writers
@@ -18,4 +21,5 @@
config_section_dependencies = ('writers',)
def translate(self):
+ # output = None # TODO in 0.22
pass
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|