|
From: <mi...@us...> - 2022-01-29 10:48:18
|
Revision: 8990
http://sourceforge.net/p/docutils/code/8990
Author: milde
Date: 2022-01-29 10:48:14 +0000 (Sat, 29 Jan 2022)
Log Message:
-----------
Various small fixes.
Update comments
One more generator expression instead of lists.
Fix unbound variable.
Drop duplicate import.
Modified Paths:
--------------
trunk/docutils/docutils/__init__.py
trunk/docutils/docutils/nodes.py
trunk/docutils/test/test_functional.py
trunk/docutils/test/test_io.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test__init__.py
Modified: trunk/docutils/docutils/__init__.py
===================================================================
--- trunk/docutils/docutils/__init__.py 2022-01-27 17:06:30 UTC (rev 8989)
+++ trunk/docutils/docutils/__init__.py 2022-01-29 10:48:14 UTC (rev 8990)
@@ -185,7 +185,7 @@
settings_default_overrides = None
"""A dictionary of auxiliary defaults, to override defaults for settings
- defined in other components. Override in subclasses."""
+ defined in other components' `setting_specs`. Override in subclasses."""
relative_path_settings = ()
"""Settings containing filesystem paths. Override in subclasses.
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2022-01-27 17:06:30 UTC (rev 8989)
+++ trunk/docutils/docutils/nodes.py 2022-01-29 10:48:14 UTC (rev 8990)
@@ -417,10 +417,10 @@
def pformat(self, indent=' ', level=0):
try:
if self.document.settings.detailed:
- lines = ['%s%s' % (indent*level, '<#text>')
- ] + [indent*(level+1) + repr(line)
- for line in self.splitlines(True)]
- return '\n'.join(lines) + '\n'
+ tag = '%s%s' % (indent*level, '<#text>')
+ lines = (indent*(level+1) + repr(line)
+ for line in self.splitlines(True))
+ return '\n'.join((tag, *lines)) + '\n'
except AttributeError:
pass
indent = indent * level
Modified: trunk/docutils/test/test_functional.py
===================================================================
--- trunk/docutils/test/test_functional.py 2022-01-27 17:06:30 UTC (rev 8989)
+++ trunk/docutils/test/test_functional.py 2022-01-29 10:48:14 UTC (rev 8990)
@@ -6,7 +6,9 @@
"""
Perform tests with the data in the functional/ directory.
-Read README.txt for details on how this is done.
+Please see the documentation on `functional testing`__ for details.
+
+__ ../../docs/dev/testing.html#functional
"""
import sys
Modified: trunk/docutils/test/test_io.py
===================================================================
--- trunk/docutils/test/test_io.py 2022-01-27 17:06:30 UTC (rev 8989)
+++ trunk/docutils/test/test_io.py 2022-01-29 10:48:14 UTC (rev 8990)
@@ -140,7 +140,7 @@
# in Py3k, the locale encoding is used without --input-encoding
# skipping the heuristic unless decoding fails.
return
- probed_encodings = (locale_encoding, 'latin-1')
+ probed_encodings = (io.locale_encoding, 'latin-1')
input = io.FileInput(source_path='data/latin1.txt')
data = input.read()
if input.successful_encoding not in probed_encodings:
Modified: trunk/docutils/test/test_parsers/test_rst/test_directives/test__init__.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_directives/test__init__.py 2022-01-27 17:06:30 UTC (rev 8989)
+++ trunk/docutils/test/test_parsers/test_rst/test_directives/test__init__.py 2022-01-29 10:48:14 UTC (rev 8990)
@@ -54,5 +54,4 @@
self.assertRaises(ValueError, directives.parser_name, 'fantasy')
if __name__ == '__main__':
- import unittest
unittest.main()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|