|
From: <mi...@us...> - 2022-03-04 15:54:27
|
Revision: 9021
http://sourceforge.net/p/docutils/code/9021
Author: milde
Date: 2022-03-04 15:54:22 +0000 (Fri, 04 Mar 2022)
Log Message:
-----------
Ensure at least two spaces before inline comment.
flake 8 rule E261
Exceptions for modules sheduled for removal or with
3rd-party origin and for data collections.
Modified Paths:
--------------
trunk/docutils/docutils/__init__.py
trunk/docutils/docutils/core.py
trunk/docutils/docutils/frontend.py
trunk/docutils/docutils/io.py
trunk/docutils/docutils/languages/__init__.py
trunk/docutils/docutils/languages/af.py
trunk/docutils/docutils/languages/sv.py
trunk/docutils/docutils/languages/zh_cn.py
trunk/docutils/docutils/languages/zh_tw.py
trunk/docutils/docutils/parsers/__init__.py
trunk/docutils/docutils/parsers/recommonmark_wrapper.py
trunk/docutils/docutils/parsers/rst/directives/body.py
trunk/docutils/docutils/parsers/rst/directives/images.py
trunk/docutils/docutils/parsers/rst/directives/misc.py
trunk/docutils/docutils/parsers/rst/directives/tables.py
trunk/docutils/docutils/parsers/rst/languages/af.py
trunk/docutils/docutils/parsers/rst/languages/cs.py
trunk/docutils/docutils/parsers/rst/languages/de.py
trunk/docutils/docutils/parsers/rst/languages/eo.py
trunk/docutils/docutils/parsers/rst/languages/ja.py
trunk/docutils/docutils/parsers/rst/languages/nl.py
trunk/docutils/docutils/parsers/rst/languages/sv.py
trunk/docutils/docutils/parsers/rst/roles.py
trunk/docutils/docutils/parsers/rst/states.py
trunk/docutils/docutils/parsers/rst/tableparser.py
trunk/docutils/docutils/statemachine.py
trunk/docutils/docutils/transforms/components.py
trunk/docutils/docutils/transforms/parts.py
trunk/docutils/docutils/transforms/peps.py
trunk/docutils/docutils/transforms/references.py
trunk/docutils/docutils/transforms/universal.py
trunk/docutils/docutils/utils/__init__.py
trunk/docutils/docutils/utils/code_analyzer.py
trunk/docutils/docutils/utils/math/latex2mathml.py
trunk/docutils/docutils/utils/math/tex2mathml_extern.py
trunk/docutils/docutils/utils/punctuation_chars.py
trunk/docutils/docutils/utils/smartquotes.py
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/docutils/writers/docutils_xml.py
trunk/docutils/docutils/writers/html4css1/__init__.py
trunk/docutils/docutils/writers/html5_polyglot/__init__.py
trunk/docutils/docutils/writers/latex2e/__init__.py
trunk/docutils/docutils/writers/manpage.py
trunk/docutils/docutils/writers/odf_odt/__init__.py
trunk/docutils/docutils/writers/s5_html/__init__.py
trunk/docutils/docutils/writers/xetex/__init__.py
trunk/docutils/test/DocutilsTestSupport.py
trunk/docutils/test/functional/tests/field_name_limit.py
trunk/docutils/test/test_command_line.py
trunk/docutils/test/test_functional.py
trunk/docutils/test/test_io.py
trunk/docutils/test/test_language.py
trunk/docutils/test/test_nodes.py
trunk/docutils/test/test_parsers/test_recommonmark/test_misc.py
trunk/docutils/test/test_parsers/test_recommonmark/test_transitions.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_admonitions_dummy_lang.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_code_parsing.py
trunk/docutils/test/test_parsers/test_rst/test_source_line.py
trunk/docutils/test/test_parsers/test_rst/test_tables.py
trunk/docutils/test/test_parsers/test_rst/test_transitions.py
trunk/docutils/test/test_publisher.py
trunk/docutils/test/test_settings.py
trunk/docutils/test/test_transforms/test___init__.py
trunk/docutils/test/test_transforms/test_expose_internals.py
trunk/docutils/test/test_transforms/test_filter_messages.py
trunk/docutils/test/test_transforms/test_smartquotes.py
trunk/docutils/test/test_transforms/test_transitions.py
trunk/docutils/test/test_transforms/test_writer_aux.py
trunk/docutils/test/test_utils.py
trunk/docutils/test/test_viewlist.py
trunk/docutils/test/test_writers/test_docutils_xml.py
trunk/docutils/test/test_writers/test_pseudoxml.py
trunk/docutils/tools/buildhtml.py
trunk/docutils/tools/dev/generate_punctuation_chars.py
trunk/docutils/tools/docutils-cli.py
trunk/docutils/tools/quicktest.py
trunk/docutils/tools/rst2html5.py
trunk/docutils/tox.ini
Modified: trunk/docutils/docutils/__init__.py
===================================================================
--- trunk/docutils/docutils/__init__.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/__init__.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -117,10 +117,9 @@
major=0,
minor=19,
micro=0,
- releaselevel='beta', # one of 'alpha', 'beta', 'candidate', 'final'
- # pre-release serial number (0 for final releases and active development):
- serial=0,
- release=False # True for official releases and pre-releases
+ releaselevel='beta', # one of 'alpha', 'beta', 'candidate', 'final'
+ serial=0, # pre-release number (0 for final releases and snapshots)
+ release=False # True for official releases and pre-releases
)
"""Comprehensive version information tuple. See 'Version Numbering' in
docs/dev/policies.txt."""
Modified: trunk/docutils/docutils/core.py
===================================================================
--- trunk/docutils/docutils/core.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/core.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -213,7 +213,7 @@
except Exception as error:
if not self.settings: # exception too early to report nicely
raise
- if self.settings.traceback: # Propagate exceptions?
+ if self.settings.traceback: # Propagate exceptions?
self.debugging_dumps()
raise
self.report_Exception(error)
Modified: trunk/docutils/docutils/frontend.py
===================================================================
--- trunk/docutils/docutils/frontend.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/frontend.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -315,7 +315,7 @@
def update(self, other_dict, option_parser):
if isinstance(other_dict, Values):
other_dict = other_dict.__dict__
- other_dict = dict(other_dict) # also works with ConfigParser sections
+ other_dict = dict(other_dict) # also works with ConfigParser sections
for setting in option_parser.lists.keys():
if hasattr(self, setting) and setting in other_dict:
value = getattr(self, setting)
Modified: trunk/docutils/docutils/io.py
===================================================================
--- trunk/docutils/docutils/io.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/io.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -23,7 +23,7 @@
# If no valid guess can be made, locale_encoding is set to `None`:
try:
locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]
-except ValueError as error: # OS X may set UTF-8 without language code
+except ValueError as error: # OS X may set UTF-8 without language code
# See https://bugs.python.org/issue18378 fixed in 3.8
# and https://sourceforge.net/p/docutils/bugs/298/.
# Drop the special case after requiring Python >= 3.8
@@ -31,7 +31,7 @@
locale_encoding = "UTF-8"
else:
locale_encoding = None
-except: # any other problems determining the locale -> use None
+except: # any other problems determining the locale -> use None
locale_encoding = None
try:
codecs.lookup(locale_encoding or '')
@@ -279,11 +279,12 @@
self.destination.write(data.encode(self.encoding,
self.encoding_errors))
except TypeError:
- if isinstance(data, str): # destination may expect bytes
+ if isinstance(data, str): # destination may expect bytes
self.destination.write(data.encode(self.encoding,
self.encoding_errors))
elif self.destination in (sys.stderr, sys.stdout):
- self.destination.buffer.write(data) # write bytes to raw stream
+ # write bytes to raw stream
+ self.destination.buffer.write(data)
else:
self.destination.write(str(data, self.encoding,
self.decoding_errors))
@@ -433,7 +434,7 @@
self.opened = False
else:
self.destination = sys.stdout
- elif (# destination is file-type object -> check mode:
+ elif ( # destination is file-type object -> check mode:
mode and hasattr(self.destination, 'mode')
and mode != self.destination.mode):
print('Warning: Destination mode "%s" differs from specified '
Modified: trunk/docutils/docutils/languages/__init__.py
===================================================================
--- trunk/docutils/docutils/languages/__init__.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/languages/__init__.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -64,7 +64,7 @@
except KeyError:
pass
for tag in normalize_language_tag(language_code):
- tag = tag.replace('-', '_') # '-' not valid in module names
+ tag = tag.replace('-', '_') # '-' not valid in module names
module = self.import_from_packages(tag, reporter)
if module is not None:
break
Modified: trunk/docutils/docutils/languages/af.py
===================================================================
--- trunk/docutils/docutils/languages/af.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/languages/af.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -33,7 +33,7 @@
'hint': 'Wenk',
'important': 'Belangrik',
'note': 'Nota',
- 'tip': 'Tip', # hint and tip both have the same translation: wenk
+ 'tip': 'Tip', # hint and tip both have the same translation: wenk
'warning': 'Waarskuwing',
'contents': 'Inhoud'}
"""Mapping of node class name to label text."""
Modified: trunk/docutils/docutils/languages/sv.py
===================================================================
--- trunk/docutils/docutils/languages/sv.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/languages/sv.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -27,7 +27,7 @@
'dedication': 'Dedikation',
'abstract': 'Sammanfattning',
'attention': 'Observera!',
- 'caution': 'Akta!', # 'Varning' already used for 'warning'
+ 'caution': 'Akta!', # 'Varning' already used for 'warning'
'danger': 'FARA!',
'error': 'Fel',
'hint': 'Vink',
Modified: trunk/docutils/docutils/languages/zh_cn.py
===================================================================
--- trunk/docutils/docutils/languages/zh_cn.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/languages/zh_cn.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -58,9 +58,9 @@
"""Simplified Chinese to canonical name mapping for bibliographic fields."""
author_separators = [';', ',',
- '\uff1b', # ';'
- '\uff0c', # ','
- '\u3001', # '、'
+ '\uff1b', # ';'
+ '\uff0c', # ','
+ '\u3001', # '、'
]
"""List of separator strings for the 'Authors' bibliographic field. Tried in
order."""
Modified: trunk/docutils/docutils/languages/zh_tw.py
===================================================================
--- trunk/docutils/docutils/languages/zh_tw.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/languages/zh_tw.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -15,28 +15,28 @@
labels = {
# fixed: language-dependent
- 'author': '\u4f5c\u8005', # '作者' <-- Chinese word
- 'authors': '\u4f5c\u8005\u7fa4', # '作者群',
- 'organization': '\u7d44\u7e54', # '組織',
- 'address': '\u5730\u5740', # '地址',
- 'contact': '\u9023\u7d61', # '連絡',
- 'version': '\u7248\u672c', # '版本',
- 'revision': '\u4fee\u8a02', # '修訂',
- 'status': '\u72c0\u614b', # '狀態',
- 'date': '\u65e5\u671f', # '日期',
- 'copyright': '\u7248\u6b0a', # '版權',
- 'dedication': '\u984c\u737b', # '題獻',
- 'abstract': '\u6458\u8981', # '摘要',
- 'attention': '\u6ce8\u610f\uff01', # '注意!',
- 'caution': '\u5c0f\u5fc3\uff01', # '小心!',
- 'danger': '\uff01\u5371\u96aa\uff01', # '!危險!',
- 'error': '\u932f\u8aa4', # '錯誤',
- 'hint': '\u63d0\u793a', # '提示',
- 'important': '\u91cd\u8981', # '注意!',
- 'note': '\u8a3b\u91cb', # '註釋',
- 'tip': '\u79d8\u8a23', # '秘訣',
- 'warning': '\u8b66\u544a', # '警告',
- 'contents': '\u76ee\u9304' # '目錄'
+ 'author': '\u4f5c\u8005', # '作者' <-- Chinese word
+ 'authors': '\u4f5c\u8005\u7fa4', # '作者群',
+ 'organization': '\u7d44\u7e54', # '組織',
+ 'address': '\u5730\u5740', # '地址',
+ 'contact': '\u9023\u7d61', # '連絡',
+ 'version': '\u7248\u672c', # '版本',
+ 'revision': '\u4fee\u8a02', # '修訂',
+ 'status': '\u72c0\u614b', # '狀態',
+ 'date': '\u65e5\u671f', # '日期',
+ 'copyright': '\u7248\u6b0a', # '版權',
+ 'dedication': '\u984c\u737b', # '題獻',
+ 'abstract': '\u6458\u8981', # '摘要',
+ 'attention': '\u6ce8\u610f\uff01', # '注意!',
+ 'caution': '\u5c0f\u5fc3\uff01', # '小心!',
+ 'danger': '\uff01\u5371\u96aa\uff01', # '!危險!',
+ 'error': '\u932f\u8aa4', # '錯誤',
+ 'hint': '\u63d0\u793a', # '提示',
+ 'important': '\u91cd\u8981', # '注意!',
+ 'note': '\u8a3b\u91cb', # '註釋',
+ 'tip': '\u79d8\u8a23', # '秘訣',
+ 'warning': '\u8b66\u544a', # '警告',
+ 'contents': '\u76ee\u9304', # '目錄'
}
"""Mapping of node class name to label text."""
@@ -57,9 +57,9 @@
"""Traditional Chinese to canonical name mapping for bibliographic fields."""
author_separators = [';', ',',
- '\uff1b', # ';'
- '\uff0c', # ','
- '\u3001', # '、'
+ '\uff1b', # ';'
+ '\uff0c', # ','
+ '\u3001', # '、'
]
"""List of separator strings for the 'Authors' bibliographic field. Tried in
order."""
Modified: trunk/docutils/docutils/parsers/__init__.py
===================================================================
--- trunk/docutils/docutils/parsers/__init__.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/parsers/__init__.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -64,7 +64,7 @@
self.document.note_parse_message)
-_parser_aliases = {# short names for known parsers
+_parser_aliases = { # short names for known parsers
'null': 'docutils.parsers.null',
# reStructuredText
'rst': 'docutils.parsers.rst',
Modified: trunk/docutils/docutils/parsers/recommonmark_wrapper.py
===================================================================
--- trunk/docutils/docutils/parsers/recommonmark_wrapper.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/parsers/recommonmark_wrapper.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -60,7 +60,7 @@
config_section_dependencies = ('parsers',)
def get_transforms(self):
- return Component.get_transforms(self) # + [AutoStructify]
+ return Component.get_transforms(self) # + [AutoStructify]
def parse(self, inputstring, document):
"""Use the upstream parser and clean up afterwards.
Modified: trunk/docutils/docutils/parsers/rst/directives/body.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/body.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/parsers/rst/directives/body.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -136,7 +136,7 @@
optional_arguments = 1
option_spec = {'class': directives.class_option,
'name': directives.unchanged,
- 'number-lines': directives.unchanged # integer or None
+ 'number-lines': directives.unchanged # integer or None
}
has_content = True
Modified: trunk/docutils/docutils/parsers/rst/directives/images.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/images.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/parsers/rst/directives/images.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -10,7 +10,7 @@
from urllib.request import url2pathname
-try: # check for the Python Imaging Library
+try: # check for the Python Imaging Library
import PIL.Image
except ImportError:
try: # sometimes PIL modules are put in PYTHONPATH's root
@@ -131,7 +131,7 @@
with PIL.Image.open(imagepath) as img:
figure_node['width'] = '%dpx' % img.size[0]
except (OSError, UnicodeEncodeError):
- pass # TODO: warn/info?
+ pass # TODO: warn/info?
else:
self.state.document.settings.record_dependencies.add(
imagepath.replace('\\', '/'))
Modified: trunk/docutils/docutils/parsers/rst/directives/misc.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/misc.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/parsers/rst/directives/misc.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -41,7 +41,7 @@
'start-after': directives.unchanged_required,
'end-before': directives.unchanged_required,
# ignored except for 'literal' or 'code':
- 'number-lines': directives.unchanged, # integer or None
+ 'number-lines': directives.unchanged, # integer or None
'class': directives.class_option,
'name': directives.unchanged}
@@ -159,9 +159,9 @@
if tab_width < 0:
include_lines = rawtext.splitlines()
codeblock = CodeBlock(self.name,
- [self.options.pop('code')], # arguments
+ [self.options.pop('code')], # arguments
self.options,
- include_lines, # content
+ include_lines, # content
self.lineno,
self.content_offset,
self.block_text,
@@ -173,7 +173,7 @@
clip_options = (startline, endline, before_text, after_text)
include_log = self.state.document.include_log
# log entries are tuples (<source>, <clip-options>)
- if not include_log: # new document
+ if not include_log: # new document
include_log.append((utils.relative_path(None, source),
(None, None, None, None)))
if (path, clip_options) in include_log:
Modified: trunk/docutils/docutils/parsers/rst/directives/tables.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/tables.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/parsers/rst/directives/tables.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -163,7 +163,7 @@
colspec['colwidth'] = col_width
if self.widths == 'auto':
table_node['classes'] += ['colwidths-auto']
- elif self.widths: # "grid" or list of integers
+ elif self.widths: # "grid" or list of integers
table_node['classes'] += ['colwidths-given']
self.add_name(table_node)
if title:
@@ -480,7 +480,7 @@
table = nodes.table()
if self.widths == 'auto':
table['classes'] += ['colwidths-auto']
- elif self.widths: # explicitly set column widths
+ elif self.widths: # explicitly set column widths
table['classes'] += ['colwidths-given']
tgroup = nodes.tgroup(cols=len(col_widths))
table += tgroup
Modified: trunk/docutils/docutils/parsers/rst/languages/af.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/af.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/parsers/rst/languages/af.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -24,7 +24,7 @@
'wenk': 'hint',
'belangrik': 'important',
'nota': 'note',
- 'tip': 'tip', # hint and tip both have the same translation: wenk
+ 'tip': 'tip', # hint and tip both have the same translation: wenk
'waarskuwing': 'warning',
'vermaning': 'admonition',
'kantstreep': 'sidebar',
@@ -51,7 +51,7 @@
'insluiting': 'include',
'rou': 'raw',
'vervang': 'replace',
- 'unicode': 'unicode', # should this be translated? unikode
+ 'unicode': 'unicode', # should this be translated? unikode
'datum': 'date',
'klas': 'class',
'role (translation required)': 'role',
Modified: trunk/docutils/docutils/parsers/rst/languages/cs.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/cs.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/parsers/rst/languages/cs.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -18,7 +18,7 @@
directives = {
# language-dependent: fixed
'pozor': 'attention',
- 'caution (translation required)': 'caution', # jak rozlisit caution a warning?
+ 'caution (translation required)': 'caution', # jak rozlisit caution a warning?
'code (translation required)': 'code',
'nebezpe\u010D\u00ED': 'danger',
'chyba': 'error',
@@ -47,8 +47,8 @@
'math (translation required)': 'math',
'meta (translation required)': 'meta',
#'imagemap': 'imagemap',
- 'image (translation required)': 'image', # obrazek
- 'figure (translation required)': 'figure', # a tady?
+ 'image (translation required)': 'image', # obrazek
+ 'figure (translation required)': 'figure', # a tady?
'include (translation required)': 'include',
'raw (translation required)': 'raw',
'replace (translation required)': 'replace',
Modified: trunk/docutils/docutils/parsers/rst/languages/de.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/de.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/parsers/rst/languages/de.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -29,7 +29,7 @@
'warnung': 'warning',
'ermahnung': 'admonition',
'kasten': 'sidebar',
- 'seitenkasten': 'sidebar', # kept for backwards compatibiltity
+ 'seitenkasten': 'sidebar', # kept for backwards compatibiltity
'seitenleiste': 'sidebar',
'thema': 'topic',
'zeilenblock': 'line-block',
@@ -37,8 +37,8 @@
'rubrik': 'rubric',
'epigraph': 'epigraph',
'highlights': 'highlights',
- 'pull-quote': 'pull-quote', # commonly used in German too
- 'seitenansprache': 'pull-quote', # cf. http://www.typografie.info/2/wiki.php?title=Seitenansprache
+ 'pull-quote': 'pull-quote', # commonly used in German too
+ 'seitenansprache': 'pull-quote', # cf. http://www.typografie.info/2/wiki.php?title=Seitenansprache
'zusammengesetzt': 'compound',
'verbund': 'compound',
'container': 'container',
@@ -86,7 +86,7 @@
'titel-referenz': 'title-reference',
'pep-referenz': 'pep-reference',
'rfc-referenz': 'rfc-reference',
- 'betonung': 'emphasis', # for backwards compatibility
+ 'betonung': 'emphasis', # for backwards compatibility
'betont': 'emphasis',
'fett': 'strong',
'wörtlich': 'literal',
Modified: trunk/docutils/docutils/parsers/rst/languages/eo.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/eo.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/parsers/rst/languages/eo.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -47,7 +47,7 @@
#'qa': 'questions',
#'faq': 'questions',
'tabelo': 'table',
- 'tabelo-vdk': 'csv-table', # "valoroj disigitaj per komoj"
+ 'tabelo-vdk': 'csv-table', # "valoroj disigitaj per komoj"
'tabelo-csv': 'csv-table',
'tabelo-lista': 'list-table',
'meta': 'meta',
Modified: trunk/docutils/docutils/parsers/rst/languages/ja.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/ja.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/parsers/rst/languages/ja.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -72,14 +72,14 @@
'ディフォルトロール': 'default-role',
'既定役': 'default-role',
'タイトル': 'title',
- '題': 'title', # 題名 件名
+ '題': 'title', # 題名 件名
'目次': 'contents',
'節数': 'sectnum',
'ヘッダ': 'header',
'フッタ': 'footer',
- #'脚注': 'footnotes', # 脚註?
+ #'脚注': 'footnotes', # 脚註?
#'サイテーション': 'citations', # 出典 引証 引用
- 'ターゲットノート': 'target-notes', # 的注 的脚注
+ 'ターゲットノート': 'target-notes', # 的注 的脚注
}
"""Japanese name to registered (in directives/__init__.py) directive name
mapping."""
Modified: trunk/docutils/docutils/parsers/rst/languages/nl.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/nl.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/parsers/rst/languages/nl.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -35,7 +35,7 @@
'rubriek': 'rubric',
'opschrift': 'epigraph',
'hoogtepunten': 'highlights',
- 'pull-quote': 'pull-quote', # Dutch printers use the english term
+ 'pull-quote': 'pull-quote', # Dutch printers use the english term
'samenstelling': 'compound',
'verbinding': 'compound',
'container (translation required)': 'container',
Modified: trunk/docutils/docutils/parsers/rst/languages/sv.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/sv.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/parsers/rst/languages/sv.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -15,21 +15,21 @@
directives = {
'observera': 'attention',
- 'akta': 'caution', # also 'försiktigt'
+ 'akta': 'caution', # also 'försiktigt'
'kod': 'code',
'fara': 'danger',
'fel': 'error',
- 'vink': 'hint', # also 'hint'
+ 'vink': 'hint', # also 'hint'
'viktigt': 'important',
'notera': 'note',
'tips': 'tip',
'varning': 'warning',
- 'anmärkning': 'admonition', # literal 'tillrättavisning', 'förmaning'
+ 'anmärkning': 'admonition', # literal 'tillrättavisning', 'förmaning'
'sidorad': 'sidebar',
'ämne': 'topic',
'tema': 'topic',
'rad-block': 'line-block',
- 'parsed-literal (translation required)': 'parsed-literal', # 'tolkad-bokstavlig'?
+ 'parsed-literal (translation required)': 'parsed-literal', # 'tolkad-bokstavlig'?
'rubrik': 'rubric',
'epigraf': 'epigraph',
'höjdpunkter': 'highlights',
@@ -45,7 +45,7 @@
'list-tabell': 'list-table',
'meta': 'meta',
'matematik': 'math',
- # 'bildkarta': 'imagemap', # FIXME: Translation might be too literal.
+ # 'bildkarta': 'imagemap', # FIXME: Translation might be too literal.
'bild': 'image',
'figur': 'figure',
'inkludera': 'include',
@@ -80,7 +80,7 @@
'rfc-referens': 'rfc-reference',
'betoning': 'emphasis',
'stark': 'strong',
- 'bokstavlig': 'literal', # also 'ordagranna'
+ 'bokstavlig': 'literal', # also 'ordagranna'
'matematik': 'math',
'namngiven-referens': 'named-reference',
'anonym-referens': 'anonymous-reference',
Modified: trunk/docutils/docutils/parsers/rst/roles.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/roles.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/parsers/rst/roles.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -149,7 +149,7 @@
role_fn = _role_registry[canonicalname]
register_local_role(normname, role_fn)
return role_fn, messages
- return None, messages # Error message will be generated by caller.
+ return None, messages # Error message will be generated by caller.
def register_canonical_role(name, role_fn):
"""
@@ -222,7 +222,7 @@
opts = normalized_role_options(self.supplied_options)
try:
opts.update(options)
- except TypeError: # options may be ``None``
+ except TypeError: # options may be ``None``
pass
# pass concatenation of content from instance and call argument:
supplied_content = self.supplied_content or []
@@ -361,7 +361,7 @@
def math_role(role, rawtext, text, lineno, inliner,
options=None, content=None):
options = normalized_role_options(options)
- text = utils.unescape(text, True) # raw text without inline role markup
+ text = utils.unescape(text, True) # raw text without inline role markup
node = nodes.math(rawtext, text, **options)
return [node], []
Modified: trunk/docutils/docutils/parsers/rst/states.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/states.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/parsers/rst/states.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -347,7 +347,7 @@
try: # check for existing title style
level = title_styles.index(style) + 1
except ValueError: # new title style
- if len(title_styles) == memo.section_level: # new subsection
+ if len(title_styles) == memo.section_level: # new subsection
title_styles.append(style)
return True
else: # not at lowest level
@@ -393,8 +393,8 @@
self.state_machine.input_lines[offset:], input_offset=absoffset,
node=section_node, match_titles=True)
self.goto_line(newabsoffset)
- if memo.section_level <= mylevel: # can't handle next section?
- raise EOFError # bubble up to supersection
+ if memo.section_level <= mylevel: # can't handle next section?
+ raise EOFError # bubble up to supersection
# reset section_level; next pass will detect it properly
memo.section_level = mylevel
@@ -487,7 +487,7 @@
parts = ('initial_inline', start_string_prefix, '',
[
- ('start', '', self.non_whitespace_after, # simple start-strings
+ ('start', '', self.non_whitespace_after, # simple start-strings
[r'\*\*', # strong
r'\*(?!\*)', # emphasis but not strong
r'``', # literal
@@ -494,20 +494,20 @@
r'_`', # inline internal target
r'\|(?!\|)'] # substitution reference
),
- ('whole', '', end_string_suffix, # whole constructs
- [# reference name & end-string
+ ('whole', '', end_string_suffix, # whole constructs
+ [ # reference name & end-string
r'(?P<refname>%s)(?P<refend>__?)' % self.simplename,
('footnotelabel', r'\[', r'(?P<fnend>\]_)',
- [r'[0-9]+', # manually numbered
- r'\#(%s)?' % self.simplename, # auto-numbered (w/ label?)
- r'\*', # auto-symbol
- r'(?P<citationlabel>%s)' % self.simplename, # citation reference
+ [r'[0-9]+', # manually numbered
+ r'\#(%s)?' % self.simplename, # auto-numbered (w/ label?)
+ r'\*', # auto-symbol
+ r'(?P<citationlabel>%s)' % self.simplename, # citation ref
]
)
]
),
('backquote', # interpreted text or phrase reference
- '(?P<role>(:%s:)?)' % self.simplename, # optional role
+ '(?P<role>(:%s:)?)' % self.simplename, # optional role
self.non_whitespace_after,
['`(?!`)'] # but not literal
)
@@ -804,7 +804,7 @@
def phrase_ref(self, before, after, rawsource, escaped, text=None):
# `text` is ignored (since 0.16)
match = self.patterns.embedded_link.search(escaped)
- if match: # embedded <URI> or <alias_>
+ if match: # embedded <URI> or <alias_>
text = escaped[:match.start(0)]
unescaped = unescape(text)
rawtext = unescape(text, True)
@@ -1089,7 +1089,7 @@
'period': Struct(prefix='', suffix='.', start=0, end=-1)}
enum.formats = enum.formatinfo.keys()
enum.sequences = ['arabic', 'loweralpha', 'upperalpha',
- 'lowerroman', 'upperroman'] # ORDERED!
+ 'lowerroman', 'upperroman'] # ORDERED!
enum.sequencepats = {'arabic': '[0-9]+',
'loweralpha': '[a-z]',
'upperalpha': '[A-Z]',
@@ -1217,7 +1217,7 @@
for i in range(len(indented)):
line = indented[i].rstrip()
if line:
- if nonblank_seen and blank == i - 1: # last line blank
+ if nonblank_seen and blank == i - 1: # last line blank
match = self.attribution_pattern.match(line)
if match:
attribution_end, indent = self.check_attribution(
@@ -1257,7 +1257,7 @@
def parse_attribution(self, indented, line_offset):
text = '\n'.join(indented).rstrip()
- lineno = 1 + line_offset # line_offset is zero-based
+ lineno = 1 + line_offset # line_offset is zero-based
textnodes, messages = self.inline_text(text, lineno)
node = nodes.attribution(text, '', *textnodes)
node.source, node.line = self.state_machine.get_source_and_line(lineno)
@@ -1421,7 +1421,7 @@
auto-enumerator ("#" instead of the regular enumerator).
Return ``None`` for invalid (out of range) ordinals.
- """ #"
+ """
if sequence == '#':
enumerator = '#'
elif sequence == 'arabic':
@@ -1488,8 +1488,8 @@
def parse_field_marker(self, match):
"""Extract & return field name from a field marker match."""
- field = match.group()[1:] # strip off leading ':'
- field = field[:field.rfind(':')] # strip off trailing ':' etc.
+ field = match.group()[1:] # strip off leading ':'
+ field = field[:field.rfind(':')] # strip off trailing ':' etc.
return field
def parse_field_body(self, indented, offset, node):
@@ -1627,7 +1627,7 @@
text = '\n'.join(indented)
text_nodes, messages = self.inline_text(text, lineno)
line = nodes.line(text, '', *text_nodes)
- if match.string.rstrip() != '|': # not empty
+ if match.string.rstrip() != '|': # not empty
line.indent = len(match.group(1)) - 1
return line, messages, blank_finish
@@ -1714,12 +1714,12 @@
width = len(block[0].strip())
for i in range(len(block)):
block[i] = block[i].strip()
- if block[i][0] not in '+|': # check left edge
+ if block[i][0] not in '+|': # check left edge
blank_finish = 0
self.state_machine.previous_line(len(block) - i)
del block[i:]
break
- if not self.grid_table_top_pat.match(block[-1]): # find bottom
+ if not self.grid_table_top_pat.match(block[-1]): # find bottom
blank_finish = 0
# from second-last to third line of table:
for i in range(len(block) - 2, 1, -1):
@@ -1795,7 +1795,7 @@
table = nodes.table()
if widths == 'auto':
table['classes'] += ['colwidths-auto']
- elif widths: # "grid" or list of integers
+ elif widths: # "grid" or list of integers
table['classes'] += ['colwidths-given']
tgroup = nodes.tgroup(cols=len(colwidths))
table += tgroup
@@ -1981,7 +1981,7 @@
- 'refuri' and the URI
- 'malformed' and a system_message node
"""
- if block and block[-1].strip()[-1:] == '_': # possible indirect target
+ if block and block[-1].strip()[-1:] == '_': # possible indirect target
reference = ' '.join(line.strip() for line in block)
refname = self.is_reference(reference)
if refname:
@@ -2135,7 +2135,7 @@
) = self.state_machine.get_first_known_indented(match.end(),
strip_top=0)
block_text = '\n'.join(self.state_machine.input_lines[
- initial_line_offset : self.state_machine.line_offset + 1]) # noqa: E203
+ initial_line_offset : self.state_machine.line_offset + 1]) # noqa: E203
try:
arguments, options, content, content_offset = (
self.parse_directive_block(indented, line_offset,
@@ -2264,7 +2264,7 @@
newline_offset, blank_finish = self.nested_list_parse(
datalines, 0, node, initial_state='ExtensionOptions',
blank_finish=True)
- if newline_offset != len(datalines): # incomplete parse of block
+ if newline_offset != len(datalines): # incomplete parse of block
return 0, 'invalid option block'
try:
options = utils.extract_extension_options(node, option_spec)
@@ -2292,8 +2292,8 @@
def comment(self, match):
if self.state_machine.is_next_line_blank():
first_comment_line = match.string[match.end():]
- if not first_comment_line.strip(): # empty comment
- return [nodes.comment()], True # "A tiny but practical wart."
+ if not first_comment_line.strip(): # empty comment
+ return [nodes.comment()], True # "A tiny but practical wart."
if first_comment_line.startswith('end of inclusion from "'):
# cf. parsers.rst.directives.misc.Include
self.document.include_log.pop()
@@ -2443,7 +2443,7 @@
patterns['rfc2822'] = r'[!-9;-~]+:( +|$)'
initial_transitions = [(name, 'Body')
for name in Body.initial_transitions]
- initial_transitions.insert(-1, ('rfc2822', 'Body')) # just before 'text'
+ initial_transitions.insert(-1, ('rfc2822', 'Body')) # just before 'text'
def rfc2822(self, match, context, next_state):
"""RFC2822-style field list item."""
@@ -2451,7 +2451,7 @@
self.parent += fieldlist
field, blank_finish = self.rfc2822_field(match)
fieldlist += field
- offset = self.state_machine.line_offset + 1 # next line
+ offset = self.state_machine.line_offset + 1 # next line
newline_offset, blank_finish = self.nested_list_parse(
self.state_machine.input_lines[offset:],
input_offset=self.state_machine.abs_line_offset() + 1,
@@ -2504,7 +2504,7 @@
def invalid_input(self, match=None, context=None, next_state=None):
"""Not a compound element member. Abort this state machine."""
- self.state_machine.previous_line() # back up so parent SM can reassess
+ self.state_machine.previous_line() # back up so parent SM can reassess
raise EOFError
indent = invalid_input
@@ -2912,7 +2912,7 @@
def eof(self, context):
"""Not a definition."""
- self.state_machine.previous_line(2) # so parent SM can reassess
+ self.state_machine.previous_line(2) # so parent SM can reassess
return []
def indent(self, match, context, next_state):
@@ -3089,7 +3089,7 @@
self.parent += self.reporter.warning(
'Literal block expected; none found.',
line=self.state_machine.abs_line_number()
- ) # src not available, statemachine.input_lines is empty
+ ) # src not available, statemachine.input_lines is empty
self.state_machine.previous_line()
self.parent += self.messages
return []
Modified: trunk/docutils/docutils/parsers/rst/tableparser.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/tableparser.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/parsers/rst/tableparser.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -294,7 +294,7 @@
for i in range(len(colseps)):
colindex[colseps[i]] = i # column boundary -> col number map
colspecs = [(colseps[i] - colseps[i - 1] - 1)
- for i in range(1, len(colseps))] # list of column widths
+ for i in range(1, len(colseps))] # list of column widths
# prepare an empty table with the correct number of rows & columns
onerow = [None for i in range(len(colseps) - 1)]
rows = [onerow[:] for i in range(len(rowseps) - 1)]
Modified: trunk/docutils/docutils/statemachine.py
===================================================================
--- trunk/docutils/docutils/statemachine.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/statemachine.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -244,7 +244,7 @@
else:
results.extend(result)
except TransitionCorrection as exception:
- self.previous_line() # back up for another try
+ self.previous_line() # back up for another try
transitions = (exception.args[0],)
if self.debug:
print('\nStateMachine.run: TransitionCorrection to '
@@ -252,7 +252,7 @@
% (state.__class__.__name__, transitions[0]), file=self._stderr)
continue
except StateCorrection as exception:
- self.previous_line() # back up for another try
+ self.previous_line() # back up for another try
next_state = exception.args[0]
if len(exception.args) == 1:
transitions = None
@@ -407,7 +407,7 @@
return block
except UnexpectedIndentationError as err:
block = err.args[0]
- self.next_line(len(block) - 1) # advance to last line of block
+ self.next_line(len(block) - 1) # advance to last line of block
raise
def check_line(self, context, state, transitions=None):
@@ -808,7 +808,7 @@
indented, indent, blank_finish = self.input_lines.get_indented(
self.line_offset, until_blank, strip_indent)
if indented:
- self.next_line(len(indented) - 1) # advance to last indented line
+ self.next_line(len(indented) - 1) # advance to last indented line
while indented and not indented[0].strip():
indented.trim_start()
offset += 1
@@ -838,7 +838,7 @@
indented, indent, blank_finish = self.input_lines.get_indented(
self.line_offset, until_blank, strip_indent,
block_indent=indent)
- self.next_line(len(indented) - 1) # advance to last indented line
+ self.next_line(len(indented) - 1) # advance to last indented line
while indented and not indented[0].strip():
indented.trim_start()
offset += 1
@@ -870,7 +870,7 @@
indented, indent, blank_finish = self.input_lines.get_indented(
self.line_offset, until_blank, strip_indent,
first_indent=indent)
- self.next_line(len(indented) - 1) # advance to last indented line
+ self.next_line(len(indented) - 1) # advance to last indented line
if strip_top:
while indented and not indented[0].strip():
indented.trim_start()
@@ -1443,7 +1443,7 @@
new = []
for char in line:
new.append(char)
- if east_asian_width(char) in 'WF': # 'W'ide & 'F'ull-width
+ if east_asian_width(char) in 'WF': # Wide & Full-width
new.append(pad_char)
self.data[i] = ''.join(new)
Modified: trunk/docutils/docutils/transforms/components.py
===================================================================
--- trunk/docutils/docutils/transforms/components.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/transforms/components.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -45,7 +45,7 @@
def apply(self):
pending = self.startnode
- component_type = pending.details['component'] # 'reader' or 'writer'
+ component_type = pending.details['component'] # 'reader' or 'writer'
formats = (pending.details['format']).split(',')
component = self.document.transformer.components[component_type]
for format in formats:
Modified: trunk/docutils/docutils/transforms/parts.py
===================================================================
--- trunk/docutils/docutils/transforms/parts.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/transforms/parts.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -38,7 +38,7 @@
if self.maxdepth is None:
self.maxdepth = sys.maxsize
self.update_section_numbers(self.document)
- else: # store details for eventual section numbering by the writer
+ else: # store details for eventual section numbering by the writer
self.document.settings.sectnum_depth = self.maxdepth
self.document.settings.sectnum_start = self.startvalue
self.document.settings.sectnum_prefix = self.prefix
@@ -140,8 +140,8 @@
entries.append(item)
if entries:
contents = nodes.bullet_list('', *entries)
- if auto: # auto-numbered sections
- contents['classes'].append('auto-toc') # auto-numbered sections
+ if auto: # auto-numbered sections
+ contents['classes'].append('auto-toc')
return contents
else:
return []
Modified: trunk/docutils/docutils/transforms/peps.py
===================================================================
--- trunk/docutils/docutils/transforms/peps.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/transforms/peps.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -48,7 +48,7 @@
'header; it is not a PEP.')
pep = None
for field in header:
- if field[0].astext().lower() == 'pep': # should be the first field
+ if field[0].astext().lower() == 'pep': # should be the first field
value = field[1].astext()
try:
pep = int(value)
@@ -122,7 +122,7 @@
refuri=(self.document.settings.pep_base_url
+ self.pep_url % pepno)))
newbody.append(space)
- para[:] = newbody[:-1] # drop trailing space
+ para[:] = newbody[:-1] # drop trailing space
elif name == 'last-modified':
utils.clean_rcs_keywords(para, self.rcs_keyword_substitutions)
if cvs_url:
Modified: trunk/docutils/docutils/transforms/references.py
===================================================================
--- trunk/docutils/docutils/transforms/references.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/transforms/references.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -235,7 +235,7 @@
self.circular_indirect_reference(target)
return
target.multiply_indirect = 1
- self.resolve_indirect_target(reftarget) # multiply indirect
+ self.resolve_indirect_target(reftarget) # multiply indirect
del target.multiply_indirect
if reftarget.hasattr('refuri'):
target['refuri'] = reftarget['refuri']
Modified: trunk/docutils/docutils/transforms/universal.py
===================================================================
--- trunk/docutils/docutils/transforms/universal.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/transforms/universal.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -152,7 +152,7 @@
for node in tuple(self.document.findall(nodes.system_message)):
if node['level'] < self.document.reporter.report_level:
node.parent.remove(node)
- try: # also remove id-entry
+ try: # also remove id-entry
del(self.document.ids[node['ids'][0]])
except (IndexError):
pass
@@ -318,7 +318,7 @@
if tag in smartquotes.smartchars.quotes:
lang = tag
break
- else: # language not supported: (keep ASCII quotes)
+ else: # language not supported -- keep ASCII quotes
if lang not in self.unsupported_languages:
self.document.reporter.warning(
'No smart quotes defined for language "%s".' % lang,
@@ -335,4 +335,4 @@
for txtnode, newtext in zip(txtnodes, teacher):
txtnode.parent.replace(txtnode, nodes.Text(newtext))
- self.unsupported_languages = set() # reset
+ self.unsupported_languages.clear()
Modified: trunk/docutils/docutils/utils/__init__.py
===================================================================
--- trunk/docutils/docutils/utils/__init__.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/utils/__init__.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -168,8 +168,9 @@
if line is not None:
attributes.setdefault('line', line)
# assert source is not None, "node has line- but no source-argument"
- if 'source' not in attributes: # 'line' is absolute line number
- try: # look up (source, line-in-source)
+ if 'source' not in attributes:
+ # 'line' is absolute line number
+ try:
source, line = self.get_source_and_line(attributes.get('line'))
except AttributeError:
source, line = None, None
@@ -345,7 +346,7 @@
return path
try:
path = path.decode(sys.getfilesystemencoding(), 'strict')
- except AttributeError: # default value None has no decode method
+ except AttributeError: # default value None has no decode method
if not path:
return ''
raise ValueError('`path` value must be a String or ``None``, '
@@ -525,7 +526,7 @@
# expand relative paths if found in stylesheet-dirs:
stylesheets = [find_file_in_dirs(path, settings.stylesheet_dirs)
for path in stylesheets]
- if os.sep != '/': # for URLs, we need POSIX paths
+ if os.sep != '/': # for URLs, we need POSIX paths
stylesheets = [path.replace(os.sep, '/') for path in stylesheets]
return stylesheets
Modified: trunk/docutils/docutils/utils/code_analyzer.py
===================================================================
--- trunk/docutils/docutils/utils/code_analyzer.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/utils/code_analyzer.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -16,9 +16,9 @@
with_pygments = False
# Filter the following token types from the list of class arguments:
-unstyled_tokens = ['token', # Token (base token type)
- 'text', # Token.Text
- ''] # short name for Token and Text
+unstyled_tokens = ['token', # Token (base token type)
+ 'text', # Token.Text
+ ''] # short name for Token and Text
# (Add, e.g., Token.Punctuation with ``unstyled_tokens += 'punctuation'``.)
class LexerError(ApplicationError):
@@ -97,9 +97,9 @@
return
tokens = pygments.lex(self.code, self.lexer)
for tokentype, value in self.merge(tokens):
- if self.tokennames == 'long': # long CSS class args
+ if self.tokennames == 'long': # long CSS class args
classes = str(tokentype).lower().split('.')
- else: # short CSS class args
+ else: # short CSS class args
classes = [_get_ttype_class(tokentype)]
classes = [cls for cls in classes if cls not in unstyled_tokens]
yield classes, value
Modified: trunk/docutils/docutils/utils/math/latex2mathml.py
===================================================================
--- trunk/docutils/docutils/utils/math/latex2mathml.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/utils/math/latex2mathml.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -39,7 +39,7 @@
# identifiers -> <mi>
letters = tex2unichar.mathalpha
-letters['hbar'] = '\u210F' # compatibility mapping to ℏ (\hslash).
+letters['hbar'] = '\u210F' # compatibility mapping to ℏ (\hslash).
# (ħ LATIN SMALL LETTER H WITH STROKE is upright)
# special case: Capital Greek letters: (upright in TeX style)
Modified: trunk/docutils/docutils/utils/math/tex2mathml_extern.py
===================================================================
--- trunk/docutils/docutils/utils/math/tex2mathml_extern.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/utils/math/tex2mathml_extern.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -31,7 +31,7 @@
.. _LaTeXML: http://dlmf.nist.gov/LaTeXML/
"""
p = subprocess.Popen(['latexml',
- '-', # read from stdin
+ '-', # read from stdin
# '--preload=amsmath',
'--inputencoding=utf8',
],
@@ -50,7 +50,7 @@
'-',
'--nonumbersections',
'--format=xhtml',
- # '--linelength=78', # experimental
+ # '--linelength=78', # experimental
'--'
],
stdin=subprocess.PIPE,
@@ -77,9 +77,9 @@
.. _TtM: http://hutchinson.belmont.ma.us/tth/mml/
"""
p = subprocess.Popen(['ttm',
- # '-i', # italic font for equations. Default roman.
- '-', # unicode character encoding. (Default iso-8859-1).
- '-r', # output raw MathML (no preamble or postlude)
+ # '-i', # italic font for equations. Default roman.
+ '-u', # unicode encoding. (Default iso-8859-1).
+ '-r', # output raw MathML (no wrapper)
],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
Modified: trunk/docutils/docutils/utils/punctuation_chars.py
===================================================================
--- trunk/docutils/docutils/utils/punctuation_chars.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/utils/punctuation_chars.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -82,7 +82,7 @@
u'\ufe50-\ufe52\ufe54-\ufe58\ufe5f-\ufe61\ufe63\ufe68\ufe6a'
u'\ufe6b\uff01-\uff03\uff05-\uff07\uff0a\uff0c-\uff0f\uff1a'
u'\uff1b\uff1f\uff20\uff3c\uff61\uff64\uff65')
-if sys.maxunicode >= 0x10FFFF: # "wide" build
+if sys.maxunicode >= 0x10FFFF: # "wide" build
delimiters += (u'\U00010100\U00010101\U0001039f\U000103d0\U00010857'
u'\U0001091f\U0001093f\U00010a50-\U00010a58\U00010a7f'
u'\U00010b39-\U00010b3f\U000110bb\U000110bc\U000110be-'
@@ -93,15 +93,16 @@
# Matching open/close quotes
# --------------------------
-quote_pairs = {# open char: matching closing characters # usage example
- u'\xbb': u'\xbb', # » » Swedish
- u'\u2018': u'\u201a', # ‘ ‚ Albanian/Greek/Turkish
- u'\u2019': u'\u2019', # ’ ’ Swedish
- u'\u201a': u'\u2018\u2019', # ‚ ‘ German ‚ ’ Polish
- u'\u201c': u'\u201e', # “ „ Albanian/Greek/Turkish
- u'\u201e': u'\u201c\u201d', # „ “ German „ ” Polish
- u'\u201d': u'\u201d', # ” ” Swedish
- u'\u203a': u'\u203a', # › › Swedish
+quote_pairs = {
+ # open char: matching closing characters # usage example
+ u'\xbb': u'\xbb', # » » Swedish
+ u'\u2018': u'\u201a', # ‘ ‚ Albanian/Greek/Turkish
+ u'\u2019': u'\u2019', # ’ ’ Swedish
+ u'\u201a': u'\u2018\u2019', # ‚ ‘ German ‚ ’ Polish
+ u'\u201c': u'\u201e', # “ „ Albanian/Greek/Turkish
+ u'\u201e': u'\u201c\u201d', # „ “ German „ ” Polish
+ u'\u201d': u'\u201d', # ” ” Swedish
+ u'\u203a': u'\u203a', # › › Swedish
}
"""Additional open/close quote pairs."""
Modified: trunk/docutils/docutils/utils/smartquotes.py
===================================================================
--- trunk/docutils/docutils/utils/smartquotes.py 2022-03-03 22:16:35 UTC (rev 9020)
+++ trunk/docutils/docutils/utils/smartquotes.py 2022-03-04 15:54:22 UTC (rev 9021)
@@ -387,10 +387,10 @@
class smartchars:
"""Smart quotes and dashes"""
- endash = '–' # "–" EN DASH
- emdash = '—' # "—" EM DASH
- ellipsis = '…' # "…" HORIZONTAL ELLIPSIS
- apostrophe = '’' # "’" RIGHT SINGLE QUOTATION MARK
+ endash = '–' # "–" EN DASH
+ emdash = '—' # "—" EM DASH
+ ellipsis = '…' # "…" HORIZONTAL ELLIPSIS
+ apostrophe = '’' # "’" RIGHT SINGLE QUOTATION MARK
# quote characters (language-specific, set in __init__())
# [1] https://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks
@@ -407,7 +407,7 @@
# See also configuration option "smartquote-locales".
quotes = {'af': '“”‘’',
'af-x-altquot': '„”‚’',
- 'bg': '„“‚‘', # Bulgarian, https://bg.wikipedia.org/wiki/Кавички
+ 'bg': '„“‚‘', # https://bg.wikipedia.org/wiki/Кавички
'ca': '«»“”',
'ca-x-altquot': '“”‘’',
'cs': '„“‚‘',
@@ -420,24 +420,24 @@
'de-ch': '«»‹›',
'el': '«»“”',
'en': '“”‘’',
- 'en-uk-x-altquot': '‘’“”', # Attention: " → ‘ and ' → “ !
+ 'en-uk-x-altquot': '‘’“”', # Attention: " → ‘ and ' → “ !
'eo': '“”‘’',
'es': '«»“”',
'es-x-altquot': '“”‘’',
- 'et': '„“‚‘', # no secondary quote listed in
- 'et-x-altquot': '«»‹›', # the sources above (wikipedia.org)
+ 'et': '„“‚‘', # no secondary quote listed in
+ 'et-x-altquot': '«»‹›', # the sources above (wikipedia.org)
'eu': '«»‹›',
'fi': '””’’',
'fi-x-altquot': '»»››',
- 'fr': ('« ', ' »', '“', '”'), # full no...
[truncated message content] |