|
From: <mi...@us...> - 2022-01-29 10:48:49
|
Revision: 8992
http://sourceforge.net/p/docutils/code/8992
Author: milde
Date: 2022-01-29 10:48:46 +0000 (Sat, 29 Jan 2022)
Log Message:
-----------
Fix trailing whitespace (flake warning W291).
Modified Paths:
--------------
trunk/docutils/docutils/io.py
trunk/docutils/docutils/languages/sv.py
trunk/docutils/docutils/languages/zh_cn.py
trunk/docutils/docutils/languages/zh_tw.py
trunk/docutils/docutils/nodes.py
trunk/docutils/docutils/transforms/components.py
trunk/docutils/docutils/transforms/universal.py
trunk/docutils/docutils/utils/error_reporting.py
trunk/docutils/docutils/writers/__init__.py
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/test/functional/tests/dangerous.py
trunk/docutils/test/functional/tests/pep_html.py
trunk/docutils/test/functional/tests/standalone_rst_s5_html_1.py
trunk/docutils/test/test__init__.py
trunk/docutils/test/test_dependencies.py
trunk/docutils/test/test_parsers/test_recommonmark/test_block_quotes.py
trunk/docutils/test/test_parsers/test_recommonmark/test_bullet_lists.py
trunk/docutils/test/test_parsers/test_recommonmark/test_inline_markup.py
trunk/docutils/test/test_parsers/test_recommonmark/test_section_headers.py
trunk/docutils/test/test_parsers/test_recommonmark/test_transitions.py
trunk/docutils/test/test_parsers/test_rst/test_SimpleTableParser.py
trunk/docutils/test/test_transforms/itest_hyperlinks_de.py
trunk/docutils/test/test_transforms/test_docinfo.py
trunk/docutils/test/test_transforms/test_smartquotes.py
trunk/docutils/test/test_transforms/test_substitutions.py
trunk/docutils/test/test_traversals.py
trunk/docutils/test/test_writers/test_manpage.py
trunk/docutils/tools/docutils-cli.py
trunk/docutils/tox.ini
Modified: trunk/docutils/docutils/io.py
===================================================================
--- trunk/docutils/docutils/io.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/docutils/io.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -142,7 +142,7 @@
return decoded.replace('\ufeff', '')
except (UnicodeError, LookupError) as err:
# keep exception instance for use outside of the "for" loop.
- error = err
+ error = err
raise UnicodeError(
'Unable to decode input data. Tried the following encodings: '
'%s.\n(%s)' % (', '.join(repr(enc) for enc in encodings),
Modified: trunk/docutils/docutils/languages/sv.py
===================================================================
--- trunk/docutils/docutils/languages/sv.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/docutils/languages/sv.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -50,7 +50,7 @@
'status': 'status',
'datum': 'date',
'copyright': 'copyright',
- 'dedikation': 'dedication',
+ 'dedikation': 'dedication',
'sammanfattning': 'abstract' }
"""Swedish (lowcased) to canonical name mapping for bibliographic fields."""
Modified: trunk/docutils/docutils/languages/zh_cn.py
===================================================================
--- trunk/docutils/docutils/languages/zh_cn.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/docutils/languages/zh_cn.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -38,7 +38,7 @@
'tip': '技巧',
'warning': '警告',
'contents': '目录',
-}
+}
"""Mapping of node class name to label text."""
bibliographic_fields = {
Modified: trunk/docutils/docutils/languages/zh_tw.py
===================================================================
--- trunk/docutils/docutils/languages/zh_tw.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/docutils/languages/zh_tw.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -37,7 +37,7 @@
'tip': '\u79d8\u8a23', # '秘訣',
'warning': '\u8b66\u544a', # '警告',
'contents': '\u76ee\u9304' # '目錄'
-}
+}
"""Mapping of node class name to label text."""
bibliographic_fields = {
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/docutils/nodes.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -2303,11 +2303,3 @@
def pseudo_quoteattr(value):
"""Quote attributes for pseudo-xml"""
return '"%s"' % value
-
-#
-#
-# Local Variables:
-# indent-tabs-mode: nil
-# sentence-end-double-space: t
-# fill-column: 78
-# End:
Modified: trunk/docutils/docutils/transforms/components.py
===================================================================
--- trunk/docutils/docutils/transforms/components.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/docutils/transforms/components.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -32,10 +32,10 @@
directive created a "pending" element containing a "meta" element
(in ``pending.details['nodes']``).
Only writers (``pending.details['component'] == 'writer'``)
- supporting the "html", "latex", or "odf" formats
+ supporting the "html", "latex", or "odf" formats
(``pending.details['format'] == 'html,latex,odf'``) included the
"meta" element; it was deleted from the output of all other writers.
-
+
This transform is no longer used by Docutils, it may be removed in future.
"""
# TODO: clean up or keep this for 3rd party (or possible future) use?
Modified: trunk/docutils/docutils/transforms/universal.py
===================================================================
--- trunk/docutils/docutils/transforms/universal.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/docutils/transforms/universal.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -78,7 +78,7 @@
if settings.generator:
text.extend([
nodes.Text('Generated by '),
- nodes.reference('', 'Docutils',
+ nodes.reference('', 'Docutils',
refuri='https://docutils.sourceforge.io/'),
nodes.Text(' from '),
nodes.reference('', 'reStructuredText',
Modified: trunk/docutils/docutils/utils/error_reporting.py
===================================================================
--- trunk/docutils/docutils/utils/error_reporting.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/docutils/utils/error_reporting.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -16,8 +16,8 @@
.. warning::
This module is deprecated with the end of support for Python 2.7
and will be removed in Docutils 0.21 or later.
-
- Replacements:
+
+ Replacements:
| SafeString -> str
| ErrorString -> docutils.io.error_string()
| ErrorOutput -> docutils.io.ErrorOutput
Modified: trunk/docutils/docutils/writers/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/__init__.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/docutils/writers/__init__.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -126,11 +126,11 @@
'xelatex': 'xetex',
'luatex': 'xetex',
'lualatex': 'xetex',
- 'odf': 'odf_odt',
- 'odt': 'odf_odt',
- 'ooffice': 'odf_odt',
- 'openoffice': 'odf_odt',
- 'libreoffice': 'odf_odt',
+ 'odf': 'odf_odt',
+ 'odt': 'odf_odt',
+ 'ooffice': 'odf_odt',
+ 'openoffice': 'odf_odt',
+ 'libreoffice': 'odf_odt',
'pprint': 'pseudoxml',
'pformat': 'pseudoxml',
'pdf': 'rlpdf',
@@ -147,5 +147,5 @@
try:
module = import_module(writer_name)
except ImportError as err:
- raise ImportError('No writer named "%s".' % writer_name)
+ raise ImportError('No writer named "%s".' % writer_name)
return module.Writer
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/docutils/writers/_html_base.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -150,7 +150,7 @@
self.output = self.apply_template()
def apply_template(self):
- with open(self.document.settings.template, 'r',
+ with open(self.document.settings.template, 'r',
encoding='utf-8') as template_file:
template = template_file.read()
subs = self.interpolation_dict()
Modified: trunk/docutils/test/functional/tests/dangerous.py
===================================================================
--- trunk/docutils/test/functional/tests/dangerous.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/test/functional/tests/dangerous.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -11,5 +11,5 @@
settings_overrides['file_insertion_enabled'] = False
settings_overrides['raw_enabled'] = False
# local copy of default stylesheet:
-settings_overrides['stylesheet_path'] = (
+settings_overrides['stylesheet_path'] = (
'functional/input/data/html4css1.css')
Modified: trunk/docutils/test/functional/tests/pep_html.py
===================================================================
--- trunk/docutils/test/functional/tests/pep_html.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/test/functional/tests/pep_html.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -13,5 +13,5 @@
settings_overrides['no_random'] = 1
settings_overrides['cloak_email_addresses'] = 1
# local copy of default stylesheet:
-settings_overrides['stylesheet_path'] = (
+settings_overrides['stylesheet_path'] = (
'functional/input/data/html4css1.css')
Modified: trunk/docutils/test/functional/tests/standalone_rst_s5_html_1.py
===================================================================
--- trunk/docutils/test/functional/tests/standalone_rst_s5_html_1.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/test/functional/tests/standalone_rst_s5_html_1.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -11,7 +11,7 @@
# Settings:
settings_overrides['theme'] = 'small-black'
# local copy of default stylesheet:
-settings_overrides['stylesheet_path'] = (
+settings_overrides['stylesheet_path'] = (
'functional/input/data/html4css1.css')
Modified: trunk/docutils/test/test__init__.py
===================================================================
--- trunk/docutils/test/test__init__.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/test/test__init__.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -32,13 +32,13 @@
# arguments may use keywords
self.assertEqual(VersionInfo(0, 1, 2, 'beta', 3, False),
VersionInfo(major=0, minor=1, micro=2,
- releaselevel='beta', serial=3,
+ releaselevel='beta', serial=3,
release=False))
# check defaults:
self.assertEqual(VersionInfo(),
VersionInfo(0, 0, 0, releaselevel='final',
serial=0, release=True))
-
+
def test_VersionInfo_value_check(self):
# releaselevel must be one of ('alpha', 'beta', 'candidate', 'final')
with self.assertRaises(ValueError):
Modified: trunk/docutils/test/test_dependencies.py
===================================================================
--- trunk/docutils/test/test_dependencies.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/test/test_dependencies.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -82,7 +82,7 @@
if PIL:
keys += ['figure-image']
expected = [paths[key] for key in keys]
- record = sorted(self.get_record(writer_name='latex',
+ record = sorted(self.get_record(writer_name='latex',
settings_overrides=latex_settings_overwrites))
# the order of the files is arbitrary
expected.sort()
Modified: trunk/docutils/test/test_parsers/test_recommonmark/test_block_quotes.py
===================================================================
--- trunk/docutils/test/test_parsers/test_recommonmark/test_block_quotes.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/test/test_parsers/test_recommonmark/test_block_quotes.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -69,7 +69,7 @@
Line 2.
>Block quote,
-continuation line
+continuation line
""",
"""\
<document source="test data">
Modified: trunk/docutils/test/test_parsers/test_recommonmark/test_bullet_lists.py
===================================================================
--- trunk/docutils/test/test_parsers/test_recommonmark/test_bullet_lists.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/test/test_parsers/test_recommonmark/test_bullet_lists.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -105,7 +105,7 @@
item 2
"""],
["""\
-Different bullets start different lists:
+Different bullets start different lists:
- item 1
Modified: trunk/docutils/test/test_parsers/test_recommonmark/test_inline_markup.py
===================================================================
--- trunk/docutils/test/test_parsers/test_recommonmark/test_inline_markup.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/test/test_parsers/test_recommonmark/test_inline_markup.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -323,11 +323,11 @@
<reference name="ref" refuri="/uri">
ref
"""],
-# Fails with recommonmark 0.6.0:
+# Fails with recommonmark 0.6.0:
# ["""\
# Inline image ![foo *bar*]
# in a paragraph.
-#
+#
# [foo *bar*]: train.jpg "train & tracks"
# """,
# """\
@@ -397,7 +397,7 @@
<image alt="a train" uri="train.jpg">
more text.
"""],
-# recommonmark 0.6.0 drops the "title"
+# recommonmark 0.6.0 drops the "title"
# ["""\
# Inline image  more text.
# """,
Modified: trunk/docutils/test/test_parsers/test_recommonmark/test_section_headers.py
===================================================================
--- trunk/docutils/test/test_parsers/test_recommonmark/test_section_headers.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/test/test_parsers/test_recommonmark/test_section_headers.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -70,10 +70,10 @@
"""],
# ["""\
# Test unexpected section titles.
-#
+#
# * Title
# =====
-#
+#
# Paragraph.
# """,
# """\
Modified: trunk/docutils/test/test_parsers/test_recommonmark/test_transitions.py
===================================================================
--- trunk/docutils/test/test_parsers/test_recommonmark/test_transitions.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/test/test_parsers/test_recommonmark/test_transitions.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -69,21 +69,21 @@
"""],
# ["""\
# --------
-#
+#
# A section or document may not begin with a transition.
-#
+#
# The DTD specifies that two transitions may not
# be adjacent:
-#
+#
# --------
-#
+#
# --------
-#
+#
# --------
-#
+#
# The DTD also specifies that a section or document
# may not end with a transition.
-#
+#
# --------
# """,
# """\
Modified: trunk/docutils/test/test_parsers/test_rst/test_SimpleTableParser.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_SimpleTableParser.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/test/test_parsers/test_rst/test_SimpleTableParser.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -63,9 +63,9 @@
========== ===========
A table with four rows,
-----------------------
-and two columns.
-First and last rows
-contain column spans.
+and two columns.
+First and last rows
+contain column spans.
=======================
""",
([10, 11],
@@ -94,10 +94,10 @@
=========== ================
A table with two header rows,
-----------------------------
-the first with a span.
+the first with a span.
=========== ================
-Two body rows,
-the second with a span.
+Two body rows,
+the second with a span.
=============================
""",
([11, 16],
Modified: trunk/docutils/test/test_transforms/itest_hyperlinks_de.py
===================================================================
--- trunk/docutils/test/test_transforms/itest_hyperlinks_de.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/test/test_transforms/itest_hyperlinks_de.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -8,16 +8,16 @@
Tests for docutils.transforms.references.Hyperlinks with non-English language.
TODO: This test fails currently when run as part of "alltests" because
-
+
- the "info" system-messages for directive fallbacks are only generated
- once (the name -> directive mapping is cached in
+ once (the name -> directive mapping is cached in
``docutils.parsers.rst.directives._directives``).
-
+
- the cache is not reset between after processing a document
(i.e. it contains name -> directive mappings from other tests).
-
+
See also https://sourceforge.net/p/docutils/feature-requests/71/
-"""
+"""
if __name__ == '__main__':
import __init__
@@ -65,7 +65,7 @@
Kurznotiz
<system_message level="1" source="test data" type="INFO">
<paragraph>
- Using <module 'docutils.languages.de' from '/usr/local/src/docutils-git-svn/docutils/docutils/languages/de.pyc'> for language "de".
+ Using <module 'docutils.languages.de' from '/usr/local/src/docutils-git-svn/docutils/docutils/languages/de.py'> for language "de".
"""],
])
Modified: trunk/docutils/test/test_transforms/test_docinfo.py
===================================================================
--- trunk/docutils/test/test_transforms/test_docinfo.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/test/test_transforms/test_docinfo.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -357,7 +357,7 @@
["""\
.. RCS keyword extraction.
-:Status: (some text) $""" + """RCSfile: test_docinfo.py,v $ (more text)
+:Status: (some text) $""" + """RCSfile: test_docinfo.py,v $ (more text)
:Date: (some text) $""" + """Date: 2002/10/08 01:34:23 $ (more text)
:Date: (some text) $""" + """Date: 2005-03-26T16:21:28.693201Z $ (more text)
:Version: (some text) $""" + """Revision: 1.1 $ (more text)
Modified: trunk/docutils/test/test_transforms/test_smartquotes.py
===================================================================
--- trunk/docutils/test/test_transforms/test_smartquotes.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/test/test_transforms/test_smartquotes.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -88,7 +88,7 @@
"""\
<document source="test data">
<paragraph>
- Do not “educate” quotes
+ Do not “educate” quotes \n\
<literal>
inside "literal" text
and
@@ -261,7 +261,7 @@
), (
<literal>
'string'
- ),
+ ), \n\
<emphasis>
«\u202fbetont\u202f»
, «\u202f
Modified: trunk/docutils/test/test_transforms/test_substitutions.py
===================================================================
--- trunk/docutils/test/test_transforms/test_substitutions.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/test/test_transforms/test_substitutions.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -237,13 +237,13 @@
"""\
<document source="test data">
<paragraph>
- Substitution reference with
- text and
+ Substitution reference with \n\
+ text and \n\
<reference name="hyperlink-reference" refname="hyperlink-reference">
hyperlink-reference
.
<substitution_definition names="reference-in-content">
- text and
+ text and \n\
<reference name="hyperlink-reference" refname="hyperlink-reference">
hyperlink-reference
"""],
Modified: trunk/docutils/test/test_traversals.py
===================================================================
--- trunk/docutils/test/test_traversals.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/test/test_traversals.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -23,7 +23,7 @@
Happily, happily going by train.
-.. attention:: Attention, attention. This is a public annoucement.
+.. attention:: Attention, attention. This is a public annoucement.
You must get off the train now.
KaZoom! Train crashes.
@@ -73,4 +73,3 @@
if __name__ == '__main__':
unittest.main()
-
Modified: trunk/docutils/test/test_writers/test_manpage.py
===================================================================
--- trunk/docutils/test/test_writers/test_manpage.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/test/test_writers/test_manpage.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -51,7 +51,7 @@
totest = {}
totest['blank'] = [
- ["",
+ ["",
r""".\" Man page generated from reStructuredText.
.
"""+indend_macros+
Modified: trunk/docutils/tools/docutils-cli.py
===================================================================
--- trunk/docutils/tools/docutils-cli.py 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/tools/docutils-cli.py 2022-01-29 10:48:46 UTC (rev 8992)
@@ -54,7 +54,7 @@
config_section = 'docutils-cli application'
config_section_dependencies = ('applications',)
-# Get default components from configuration files
+# Get default components from configuration files
# default to "html5" writer for backwards compatibility
default_settings = Publisher().get_settings(settings_spec=CliSettingsSpec,
writer='html5')
Modified: trunk/docutils/tox.ini
===================================================================
--- trunk/docutils/tox.ini 2022-01-29 10:48:24 UTC (rev 8991)
+++ trunk/docutils/tox.ini 2022-01-29 10:48:46 UTC (rev 8992)
@@ -92,7 +92,7 @@
# E999 SyntaxError: invalid syntax
# F404 from __future__ imports must occur at the beginning of the file
# F821 undefined name 'foo'
-ignore = E101,E111,E114,E115,E116,E117,E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E201,E202,E203,E211,E221,E222,E225,E226,E228,E231,E241,E251,E261,E262,E265,E266,E271,E301,E302,E303,E305,E306,E401,E402,E501,E502,E701,E704,E711,E713,E721,E722,E731,E741,W191,W291,W293,W391,W503,W504,W605,F401,F841
+ignore = E101,E111,E114,E115,E116,E117,E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E201,E202,E203,E211,E221,E222,E225,E226,E228,E231,E241,E251,E261,E262,E265,E266,E271,E301,E302,E303,E305,E306,E401,E402,E501,E502,E701,E704,E711,E713,E721,E722,E731,E741,W191,W293,W391,W503,W504,W605,F401,F841
exclude = .venv,.tox,dist,*egg,build
max-complexity = 35
# Some rules are disabled for specific files (requires flake8 3.7.0)
@@ -99,4 +99,10 @@
#
# F821, disabled due to use of 'settings_overrides'
per-file-ignores =
- docutils/test/functional/tests/*:F821
+ test/functional/tests/*:F821 # included config files
+ test/test_readers/test_pep/*:E122,E128
+ test/test_parsers/*:E122,E124,E128
+ test/test_writers/*:E122,E124,E128
+ test/test_writers/test_manpage.py:E121,E128,W291
+ test/test_writers/test_latex2e.py:E122,E128,W291 # r'' test samples
+ test/test_transforms/*:E122,E124,E128
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|