|
From: <mi...@us...> - 2022-01-26 22:10:19
|
Revision: 8984
http://sourceforge.net/p/docutils/code/8984
Author: milde
Date: 2022-01-26 22:10:06 +0000 (Wed, 26 Jan 2022)
Log Message:
-----------
New style classes no longer need to inherit from `object`.
Patch by Adam Turner.
Modified Paths:
--------------
trunk/docutils/docutils/__init__.py
trunk/docutils/docutils/core.py
trunk/docutils/docutils/io.py
trunk/docutils/docutils/languages/__init__.py
trunk/docutils/docutils/nodes.py
trunk/docutils/docutils/parsers/rst/__init__.py
trunk/docutils/docutils/parsers/rst/directives/images.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/__init__.py
trunk/docutils/docutils/utils/__init__.py
trunk/docutils/docutils/utils/code_analyzer.py
trunk/docutils/docutils/utils/error_reporting.py
trunk/docutils/docutils/utils/math/latex2mathml.py
trunk/docutils/docutils/utils/math/math2html.py
trunk/docutils/docutils/utils/smartquotes.py
trunk/docutils/docutils/writers/latex2e/__init__.py
trunk/docutils/docutils/writers/manpage.py
trunk/docutils/docutils/writers/odf_odt/__init__.py
trunk/docutils/test/DocutilsTestSupport.py
trunk/docutils/test/alltests.py
trunk/docutils/test/test_statemachine.py
trunk/docutils/tools/buildhtml.py
trunk/docutils/tools/dev/create_unimap.py
trunk/docutils/tools/dev/unicode2rstsubs.py
Modified: trunk/docutils/docutils/__init__.py
===================================================================
--- trunk/docutils/docutils/__init__.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/__init__.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -131,7 +131,7 @@
class DataError(ApplicationError): pass
-class SettingsSpec(object):
+class SettingsSpec:
"""
Runtime setting specification base class.
Modified: trunk/docutils/docutils/core.py
===================================================================
--- trunk/docutils/docutils/core.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/core.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -22,7 +22,7 @@
from docutils.transforms import Transformer
import docutils.readers.doctree
-class Publisher(object):
+class Publisher:
"""
A facade encapsulating the high-level logic of a Docutils system.
Modified: trunk/docutils/docutils/io.py
===================================================================
--- trunk/docutils/docutils/io.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/io.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -223,7 +223,7 @@
return data.encode(self.encoding, self.error_handler)
-class ErrorOutput(object):
+class ErrorOutput:
"""
Wrapper class for file-like error streams with
failsafe de- and encoding of `str`, `bytes`, `unicode` and
Modified: trunk/docutils/docutils/languages/__init__.py
===================================================================
--- trunk/docutils/docutils/languages/__init__.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/languages/__init__.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -16,7 +16,7 @@
from docutils.utils import normalize_language_tag
-class LanguageImporter(object):
+class LanguageImporter:
"""Import language modules.
When called with a BCP 47 language tag, instances return a module
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/nodes.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -37,7 +37,7 @@
# Functional Node Base Classes
# ==============================
-class Node(object):
+class Node:
"""Abstract base class of nodes in a document tree."""
parent = None
@@ -1144,12 +1144,12 @@
# Mixins
# ========
-class Resolvable(object):
+class Resolvable:
resolved = 0
-class BackLinkable(object):
+class BackLinkable:
def add_backref(self, refid):
self['backrefs'].append(refid)
@@ -1159,19 +1159,19 @@
# Element Categories
# ====================
-class Root(object):
+class Root:
pass
-class Titular(object):
+class Titular:
pass
-class PreBibliographic(object):
+class PreBibliographic:
"""Category of Node which may occur before Bibliographic Nodes."""
-class Bibliographic(object):
+class Bibliographic:
pass
@@ -1179,11 +1179,11 @@
pass
-class Structural(object):
+class Structural:
pass
-class Body(object):
+class Body:
pass
@@ -1206,11 +1206,11 @@
"""Internal elements that don't appear in output."""
-class Part(object):
+class Part:
pass
-class Inline(object):
+class Inline:
pass
@@ -1227,7 +1227,7 @@
Required for MoinMoin/reST compatibility."""
-class Labeled(object):
+class Labeled:
"""Contains a `label` as its first element."""
@@ -1945,7 +1945,7 @@
"""A list of names of all concrete Node subclasses."""
-class NodeVisitor(object):
+class NodeVisitor:
"""
"Visitor" pattern [GoF95]_ abstract superclass implementation for
Modified: trunk/docutils/docutils/parsers/rst/__init__.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/__init__.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/parsers/rst/__init__.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -205,7 +205,7 @@
self.msg = message
-class Directive(object):
+class Directive:
"""
Base class for reStructuredText directives.
Modified: trunk/docutils/docutils/parsers/rst/directives/images.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/images.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/parsers/rst/directives/images.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -15,7 +15,7 @@
except ImportError:
try: # sometimes PIL modules are put in PYTHONPATH's root
import Image
- class PIL(object): pass # dummy wrapper
+ class PIL: pass # dummy wrapper
PIL.Image = Image
except ImportError:
PIL = None
Modified: trunk/docutils/docutils/parsers/rst/roles.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/roles.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/parsers/rst/roles.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -189,7 +189,7 @@
register_canonical_role(canonical_name, role)
-class GenericRole(object):
+class GenericRole:
"""
Generic interpreted text role.
@@ -206,7 +206,7 @@
return [self.node_class(rawtext, text, **options)], []
-class CustomRole(object):
+class CustomRole:
"""Wrapper for custom interpreted text roles."""
def __init__(self, role_name, base_role, options=None, content=None):
Modified: trunk/docutils/docutils/parsers/rst/states.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/states.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/parsers/rst/states.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -125,7 +125,7 @@
class MarkupMismatch(Exception): pass
-class Struct(object):
+class Struct:
"""Stores data attributes for dotted-attribute access."""
@@ -458,7 +458,7 @@
return regexp
-class Inliner(object):
+class Inliner:
"""
Parse inline markup; call the `parse()` method.
Modified: trunk/docutils/docutils/parsers/rst/tableparser.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/tableparser.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/parsers/rst/tableparser.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -40,7 +40,7 @@
DataError.__init__(self, *args)
-class TableParser(object):
+class TableParser:
"""
Abstract superclass for the common parts of the syntax-specific parsers.
Modified: trunk/docutils/docutils/statemachine.py
===================================================================
--- trunk/docutils/docutils/statemachine.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/statemachine.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -113,7 +113,7 @@
from docutils import io, utils
-class StateMachine(object):
+class StateMachine:
"""
A finite state machine for text filters using regular expressions.
@@ -504,7 +504,7 @@
observer(*info)
-class State(object):
+class State:
"""
State superclass. Contains a list of transitions, and transition methods.
@@ -1019,7 +1019,7 @@
return context, next_state, results
-class _SearchOverride(object):
+class _SearchOverride:
"""
Mix-in class to override `StateMachine` regular expression behavior.
@@ -1052,7 +1052,7 @@
pass
-class ViewList(object):
+class ViewList:
"""
List with extended functionality: slices of ViewList objects are child
Modified: trunk/docutils/docutils/transforms/__init__.py
===================================================================
--- trunk/docutils/docutils/transforms/__init__.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/transforms/__init__.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -30,7 +30,7 @@
class TransformError(ApplicationError): pass
-class Transform(object):
+class Transform:
"""
Docutils transform component abstract base class.
Modified: trunk/docutils/docutils/utils/__init__.py
===================================================================
--- trunk/docutils/docutils/utils/__init__.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/utils/__init__.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -30,7 +30,7 @@
class SystemMessagePropagation(ApplicationError): pass
-class Reporter(object):
+class Reporter:
"""
Info/warning/error reporter and ``system_message`` element generator.
@@ -678,7 +678,7 @@
return taglist
-class DependencyList(object):
+class DependencyList:
"""
List of dependencies, with file recording support.
Modified: trunk/docutils/docutils/utils/code_analyzer.py
===================================================================
--- trunk/docutils/docutils/utils/code_analyzer.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/utils/code_analyzer.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -24,7 +24,7 @@
class LexerError(ApplicationError):
pass
-class Lexer(object):
+class Lexer:
"""Parse `code` lines and yield "classified" tokens.
Arguments
@@ -105,7 +105,7 @@
yield classes, value
-class NumberLines(object):
+class NumberLines:
"""Insert linenumber-tokens at the start of every code line.
Arguments
Modified: trunk/docutils/docutils/utils/error_reporting.py
===================================================================
--- trunk/docutils/docutils/utils/error_reporting.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/utils/error_reporting.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -85,7 +85,7 @@
unicode = str # noqa
-class SafeString(object):
+class SafeString:
"""
A wrapper providing robust conversion to `str` and `unicode`.
"""
@@ -162,7 +162,7 @@
super(ErrorString, self).__unicode__())
-class ErrorOutput(object):
+class ErrorOutput:
"""
Wrapper class for file-like error streams with
failsafe de- and encoding of `str`, `bytes`, `unicode` and
Modified: trunk/docutils/docutils/utils/math/latex2mathml.py
===================================================================
--- trunk/docutils/docutils/utils/math/latex2mathml.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/utils/math/latex2mathml.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -303,7 +303,7 @@
# MathML element classes
# ----------------------
-class math(object):
+class math:
"""Base class for MathML elements and root of MathML trees."""
nchildren = None
Modified: trunk/docutils/docutils/utils/math/math2html.py
===================================================================
--- trunk/docutils/docutils/utils/math/math2html.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/utils/math/math2html.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -32,7 +32,7 @@
__version__ = '1.3 (2021-06-02)'
-class Trace(object):
+class Trace:
"A tracing class"
debugmode = False
@@ -78,7 +78,7 @@
show = classmethod(show)
-class ContainerConfig(object):
+class ContainerConfig:
"Configuration class from elyxer.config file"
extracttext = {
@@ -104,7 +104,7 @@
}
-class EscapeConfig(object):
+class EscapeConfig:
"Configuration class from elyxer.config file"
chars = {
@@ -120,7 +120,7 @@
}
-class FormulaConfig(object):
+class FormulaConfig:
"Configuration class from elyxer.config file"
alphacommands = {
@@ -545,7 +545,7 @@
}
-class CommandLineParser(object):
+class CommandLineParser:
"A parser for runtime options"
def __init__(self, options):
@@ -613,7 +613,7 @@
return key
-class Options(object):
+class Options:
"A set of runtime options"
location = None
@@ -671,7 +671,7 @@
sys.exit()
-class Cloner(object):
+class Cloner:
"An object used to clone other objects."
def clone(cls, original):
@@ -688,7 +688,7 @@
clone = classmethod(clone)
create = classmethod(create)
-class ContainerExtractor(object):
+class ContainerExtractor:
"""A class to extract certain containers.
The config parameter is a map containing three lists:
@@ -729,7 +729,7 @@
return clone
-class Parser(object):
+class Parser:
"A generic parser"
def __init__(self):
@@ -865,7 +865,7 @@
-class ContainerOutput(object):
+class ContainerOutput:
"The generic HTML output for a container."
def gethtml(self, container):
@@ -1010,7 +1010,7 @@
return [container.string]
-class Globable(object):
+class Globable:
"""A bit of text which can be globbed (lumped together in bits).
Methods current(), skipcurrent(), checkfor() and isout() have to be
implemented by subclasses."""
@@ -1128,7 +1128,7 @@
return None
return nextending.ending
-class EndingList(object):
+class EndingList:
"A list of position endings"
def __init__(self):
@@ -1192,7 +1192,7 @@
return string + ']'
-class PositionEnding(object):
+class PositionEnding:
"An ending for a parsing position"
def __init__(self, ending, optional):
@@ -1303,7 +1303,7 @@
return self.text[self.pos : self.pos + length]
-class Container(object):
+class Container:
"A container for text and objects in a lyx file"
partkey = None
@@ -1508,7 +1508,7 @@
return 'Constant: ' + self.string
-class DocumentParameters(object):
+class DocumentParameters:
"Global parameters for the document."
displaymode = False
@@ -1874,7 +1874,7 @@
return bracket
-class MathsProcessor(object):
+class MathsProcessor:
"A processor for a maths construction inside the FormulaProcessor."
def process(self, contents, index):
@@ -1886,7 +1886,7 @@
return 'Maths processor ' + self.__class__.__name__
-class FormulaProcessor(object):
+class FormulaProcessor:
"A processor specifically for formulas."
processors = []
@@ -2030,7 +2030,7 @@
while not pos.finished():
self.add(self.factory.parseany(pos))
-class FormulaFactory(object):
+class FormulaFactory:
"Construct bits of formula"
# bit types will be appended later
@@ -2351,7 +2351,7 @@
TextFunction, SpacedCommand]
-class BigBracket(object):
+class BigBracket:
"A big bracket generator."
def __init__(self, size, bracket, alignment='l'):
@@ -2866,7 +2866,7 @@
-class ParameterDefinition(object):
+class ParameterDefinition:
"The definition of a parameter in a hybrid function."
"[] parameters are optional, {} parameters are mandatory."
"Each parameter has a one-character name, like {$1} or {$p}."
@@ -3084,7 +3084,7 @@
element.size = self.size
-class HybridSize(object):
+class HybridSize:
"The size associated with a hybrid function."
configsizes = FormulaConfig.hybridsizes
Modified: trunk/docutils/docutils/utils/smartquotes.py
===================================================================
--- trunk/docutils/docutils/utils/smartquotes.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/utils/smartquotes.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -381,7 +381,7 @@
import re, sys
-class smartchars(object):
+class smartchars:
"""Smart quotes and dashes
"""
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -296,7 +296,7 @@
self.parts[part] = ''.join(lines)
-class Babel(object):
+class Babel:
"""Language specifics for LaTeX."""
# TeX (babel) language names:
@@ -496,7 +496,7 @@
# \providelength and \provideenvironment commands.
# However, it is pretty non-standard (texlive-latex-extra).
-class PreambleCmds(object):
+class PreambleCmds:
"""Building blocks for the latex preamble."""
# Requirements and Setup
@@ -612,7 +612,7 @@
# -------------------
# ::
-class CharMaps(object):
+class CharMaps:
"""LaTeX representations for active and Unicode characters."""
# characters that need escaping even in `alltt` environments:
@@ -787,7 +787,7 @@
# and unimap.py from TeXML
-class DocumentClass(object):
+class DocumentClass:
"""Details of a LaTeX document class."""
def __init__(self, document_class, with_part=False):
@@ -828,7 +828,7 @@
return depth
-class Table(object):
+class Table:
"""Manage a table while traversing.
Table style might be
Modified: trunk/docutils/docutils/writers/manpage.py
===================================================================
--- trunk/docutils/docutils/writers/manpage.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/writers/manpage.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -107,7 +107,7 @@
self.output = visitor.astext()
-class Table(object):
+class Table:
def __init__(self):
self._rows = []
self._options = ['center']
@@ -302,7 +302,7 @@
pass
def list_start(self, node):
- class EnumChar(object):
+ class EnumChar:
enum_style = {
'bullet': '\\(bu',
'emdash': '\\(em',
Modified: trunk/docutils/docutils/writers/odf_odt/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/odf_odt/__init__.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/docutils/writers/odf_odt/__init__.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -305,7 +305,7 @@
#
-class TableStyle(object):
+class TableStyle:
def __init__(self, border=None, backgroundcolor=None):
self.border = border
self.backgroundcolor = backgroundcolor
@@ -333,7 +333,7 @@
#
# Information about the indentation level for lists nested inside
# other contexts, e.g. dictionary lists.
-class ListLevel(object):
+class ListLevel:
def __init__(self, level, sibling_level=True, nested_level=True):
self.level = level
self.sibling_level = sibling_level
Modified: trunk/docutils/test/DocutilsTestSupport.py
===================================================================
--- trunk/docutils/test/DocutilsTestSupport.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/test/DocutilsTestSupport.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -86,7 +86,7 @@
StringList.__repr__ = StringList.__str__
-class DevNull(object):
+class DevNull:
"""Output sink."""
Modified: trunk/docutils/test/alltests.py
===================================================================
--- trunk/docutils/test/alltests.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/test/alltests.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -25,7 +25,7 @@
import docutils
-class Tee(object):
+class Tee:
"""Write to a file and a stream (default: stdout) simultaneously."""
Modified: trunk/docutils/test/test_statemachine.py
===================================================================
--- trunk/docutils/test/test_statemachine.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/test/test_statemachine.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -203,7 +203,7 @@
self.assertEqual(self.sm.run(testtext), expected)
-class EmptyClass(object):
+class EmptyClass:
pass
Modified: trunk/docutils/tools/buildhtml.py
===================================================================
--- trunk/docutils/tools/buildhtml.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/tools/buildhtml.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -118,7 +118,7 @@
return source, destination
-class Struct(object):
+class Struct:
"""Stores data attributes for dotted-attribute access."""
@@ -126,7 +126,7 @@
self.__dict__.update(keywordargs)
-class Builder(object):
+class Builder:
def __init__(self):
self.publishers = {
Modified: trunk/docutils/tools/dev/create_unimap.py
===================================================================
--- trunk/docutils/tools/dev/create_unimap.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/tools/dev/create_unimap.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -18,7 +18,7 @@
math_map = {}
-class Visitor(object):
+class Visitor:
"""Node visitor for contents of unicode.xml."""
def visit_character(self, node):
Modified: trunk/docutils/tools/dev/unicode2rstsubs.py
===================================================================
--- trunk/docutils/tools/dev/unicode2rstsubs.py 2022-01-26 22:09:36 UTC (rev 8983)
+++ trunk/docutils/tools/dev/unicode2rstsubs.py 2022-01-26 22:10:06 UTC (rev 8984)
@@ -54,7 +54,7 @@
grouper.write_sets()
-class CharacterEntitySetExtractor(object):
+class CharacterEntitySetExtractor:
"""
Extracts character entity information from unicode.xml file, groups it by
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-01-27 14:22:24
|
Revision: 8985
http://sourceforge.net/p/docutils/code/8985
Author: milde
Date: 2022-01-27 14:22:21 +0000 (Thu, 27 Jan 2022)
Log Message:
-----------
Leftovers and fixes after the big clean-up.
Patch set by Adam Turner.
Modified Paths:
--------------
trunk/docutils/docs/user/smartquotes.txt
trunk/docutils/docutils/utils/math/math2html.py
trunk/docutils/docutils/utils/math/tex2unichar.py
trunk/docutils/docutils/utils/math/unichar2tex.py
trunk/docutils/docutils/writers/html4css1/__init__.py
Modified: trunk/docutils/docs/user/smartquotes.txt
===================================================================
--- trunk/docutils/docs/user/smartquotes.txt 2022-01-26 22:10:06 UTC (rev 8984)
+++ trunk/docutils/docs/user/smartquotes.txt 2022-01-27 14:22:21 UTC (rev 8985)
@@ -263,7 +263,7 @@
"'Dutch' alternative quotes"
- .. # 'nl-x-altquot2': u'””’’',
+ .. # 'nl-x-altquot2': '””’’',
:pl: .. class:: language-pl
@@ -337,7 +337,7 @@
"'Turkish' alternative quotes"
-.. 'tr-x-altquot2': u'“„‘‚', # antiquated?
+.. 'tr-x-altquot2': '“„‘‚', # antiquated?
:uk: .. class:: language-uk
Modified: trunk/docutils/docutils/utils/math/math2html.py
===================================================================
--- trunk/docutils/docutils/utils/math/math2html.py 2022-01-26 22:10:06 UTC (rev 8984)
+++ trunk/docutils/docutils/utils/math/math2html.py 2022-01-27 14:22:21 UTC (rev 8985)
@@ -176,17 +176,17 @@
}
combiningfunctions = {
- "\\'": '',
- '\\"': '',
- '\\^': '',
- '\\`': '',
- '\\~': '',
- '\\c': '',
- '\\r': '',
- '\\s': '',
- '\\textcircled': '',
- '\\textsubring': '',
- '\\v': '',
+ "\\'": '́',
+ '\\"': '̈',
+ '\\^': '̂',
+ '\\`': '̀',
+ '\\~': '̃',
+ '\\c': '̧',
+ '\\r': '̊',
+ '\\s': '̩',
+ '\\textcircled': '⃝',
+ '\\textsubring': '̥',
+ '\\v': '̌',
}
for key, value in tex2unichar.mathaccent.items():
combiningfunctions['\\'+key] = value
Modified: trunk/docutils/docutils/utils/math/tex2unichar.py
===================================================================
--- trunk/docutils/docutils/utils/math/tex2unichar.py 2022-01-26 22:10:06 UTC (rev 8984)
+++ trunk/docutils/docutils/utils/math/tex2unichar.py 2022-01-27 14:22:21 UTC (rev 8985)
@@ -61,8 +61,8 @@
'jmath': '\u0237', # ȷ LATIN SMALL LETTER DOTLESS J
'kappa': '\u03ba', # κ GREEK SMALL LETTER KAPPA
'lambda': '\u03bb', # λ GREEK SMALL LETTER LAMDA
- 'm': '\u03bc', # μ GREEK SMALL LETTER MU
- 'n': '\u03bd', # ν GREEK SMALL LETTER NU
+ 'mu': '\u03bc', # μ GREEK SMALL LETTER MU
+ 'nu': '\u03bd', # ν GREEK SMALL LETTER NU
'omega': '\u03c9', # ω GREEK SMALL LETTER OMEGA
'phi': '\u03d5', # ϕ GREEK PHI SYMBOL
'pi': '\u03c0', # π GREEK SMALL LETTER PI
@@ -69,7 +69,7 @@
'psi': '\u03c8', # ψ GREEK SMALL LETTER PSI
'rho': '\u03c1', # ρ GREEK SMALL LETTER RHO
'sigma': '\u03c3', # σ GREEK SMALL LETTER SIGMA
- 'ta': '\u03c4', # τ GREEK SMALL LETTER TAU
+ 'tau': '\u03c4', # τ GREEK SMALL LETTER TAU
'theta': '\u03b8', # θ GREEK SMALL LETTER THETA
'upsilon': '\u03c5', # υ GREEK SMALL LETTER UPSILON
'varDelta': '\U0001d6e5', # 𝛥 MATHEMATICAL ITALIC CAPITAL DELTA
Modified: trunk/docutils/docutils/utils/math/unichar2tex.py
===================================================================
--- trunk/docutils/docutils/utils/math/unichar2tex.py 2022-01-26 22:10:06 UTC (rev 8984)
+++ trunk/docutils/docutils/utils/math/unichar2tex.py 2022-01-27 14:22:21 UTC (rev 8985)
@@ -500,7 +500,7 @@
0x1d445: 'R',
0x1d446: 'S',
0x1d447: 'T',
-0x1d448: '',
+0x1d448: 'U',
0x1d449: 'V',
0x1d44a: 'W',
0x1d44b: 'X',
@@ -525,7 +525,7 @@
0x1d45f: 'r',
0x1d460: 's',
0x1d461: 't',
-0x1d462: '',
+0x1d462: 'u',
0x1d463: 'v',
0x1d464: 'w',
0x1d465: 'x',
Modified: trunk/docutils/docutils/writers/html4css1/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html4css1/__init__.py 2022-01-26 22:10:06 UTC (rev 8984)
+++ trunk/docutils/docutils/writers/html4css1/__init__.py 2022-01-27 14:22:21 UTC (rev 8985)
@@ -156,7 +156,7 @@
' content="application/xhtml+xml; charset=%s" />\n')
# encode also non-breaking space
- special_characters = dict(_html_base.HTMLTranslator.special_characters)
+ special_characters = _html_base.HTMLTranslator.special_characters.copy()
special_characters[0xa0] = ' '
# use character reference for dash (not valid in HTML5)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-01-27 14:22:34
|
Revision: 8986
http://sourceforge.net/p/docutils/code/8986
Author: milde
Date: 2022-01-27 14:22:31 +0000 (Thu, 27 Jan 2022)
Log Message:
-----------
Do not use combining Unicode characters without base in literal strings.
Add an example for LaTeX accent functions in mathematical text
to the mathematics documentation.
Modified Paths:
--------------
trunk/docutils/docs/ref/rst/mathematics.txt
trunk/docutils/docutils/utils/math/math2html.py
Modified: trunk/docutils/docs/ref/rst/mathematics.txt
===================================================================
--- trunk/docutils/docs/ref/rst/mathematics.txt 2022-01-27 14:22:21 UTC (rev 8985)
+++ trunk/docutils/docs/ref/rst/mathematics.txt 2022-01-27 14:22:31 UTC (rev 8986)
@@ -975,7 +975,7 @@
\left( \frac{3 }{2} \right)
\left( \frac{3^2}{2^4} \right)
\binom{3 }{2}
- \begin{pmatrix} a & b \\ c & d \end{pmatrix}
+ \begin{pmatrix} a & b \\ c & d \end{pmatrix}
\left( \frac{1}{\sqrt 2} \right)
\left( \int \right)
\left( \int_0 \right)
@@ -1001,7 +1001,7 @@
\left( \sum_0 \right)
\left( \prod \right)`
-
+
:`\bigl(\text{big}\bigr)`: `\left(\underline x \right)
\left( 3^2 \right)
\binom{3}{2}
@@ -1087,8 +1087,12 @@
\bigotimes_1^N
-
Text
~~~~
The text may contain non-ASCII characters: `n_\text{Stoß}`.
+
+Some text-mode LaTeX commands are supported with math_output_ "html".
+In other output formats, use literal Unicode: `\text{ç é è ë ê ñ ů ž ©}`
+to get the result of the accent macros
+`\text{\c{c} \'e \`e \"e \^e \~n \r{u} \v{z} \textcircled{c}}`.
Modified: trunk/docutils/docutils/utils/math/math2html.py
===================================================================
--- trunk/docutils/docutils/utils/math/math2html.py 2022-01-27 14:22:21 UTC (rev 8985)
+++ trunk/docutils/docutils/utils/math/math2html.py 2022-01-27 14:22:31 UTC (rev 8986)
@@ -176,17 +176,17 @@
}
combiningfunctions = {
- "\\'": '́',
- '\\"': '̈',
- '\\^': '̂',
- '\\`': '̀',
- '\\~': '̃',
- '\\c': '̧',
- '\\r': '̊',
- '\\s': '̩',
- '\\textcircled': '⃝',
- '\\textsubring': '̥',
- '\\v': '̌',
+ "\\'": '\u0301', # x́
+ '\\"': '\u0308', # ẍ
+ '\\^': '\u0302', # x̂
+ '\\`': '\u0300', # x̀
+ '\\~': '\u0303', # x̃
+ '\\c': '\u0327', # x̧
+ '\\r': '\u030a', # x̊
+ '\\s': '\u0329', # x̩
+ '\\textcircled': '\u20dd', # x⃝
+ '\\textsubring': '\u0325', # x̥
+ '\\v': '\u030c', # x̌
}
for key, value in tex2unichar.mathaccent.items():
combiningfunctions['\\'+key] = value
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-01-27 14:22:45
|
Revision: 8987
http://sourceforge.net/p/docutils/code/8987
Author: milde
Date: 2022-01-27 14:22:42 +0000 (Thu, 27 Jan 2022)
Log Message:
-----------
Use generator expressions instead of lists.
Based on a patch by Adam Turner.
Avoid deeply nested statements as function argument.
Improve readability of system message by line wrapping.
Modified Paths:
--------------
trunk/docutils/docutils/nodes.py
trunk/docutils/docutils/parsers/rst/directives/misc.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_include.py
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2022-01-27 14:22:31 UTC (rev 8986)
+++ trunk/docutils/docutils/nodes.py 2022-01-27 14:22:42 UTC (rev 8987)
@@ -603,9 +603,8 @@
return '</%s>' % self.tagname
def emptytag(self):
- return '<%s/>' % ' '.join([self.tagname] +
- ['%s="%s"' % (n, v)
- for n, v in self.attlist()])
+ attributes = ('%s="%s"' % (n, v) for n, v in self.attlist())
+ return '<%s/>' % ' '.join((self.tagname, *attributes))
def __len__(self):
return len(self.children)
@@ -1045,9 +1044,9 @@
return None
def pformat(self, indent=' ', level=0):
- return ''.join(['%s%s\n' % (indent * level, self.starttag())] +
- [child.pformat(indent, level+1)
- for child in self.children])
+ tagline = '%s%s\n' % (indent*level, self.starttag())
+ childreps = (c.pformat(indent, level+1) for c in self.children)
+ return ''.join((tagline, *childreps))
def copy(self):
obj = self.__class__(rawsource=self.rawsource, **self.attributes)
Modified: trunk/docutils/docutils/parsers/rst/directives/misc.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/misc.py 2022-01-27 14:22:31 UTC (rev 8986)
+++ trunk/docutils/docutils/parsers/rst/directives/misc.py 2022-01-27 14:22:42 UTC (rev 8987)
@@ -175,9 +175,10 @@
include_log.append((utils.relative_path(None, source),
(None, None, None, None)))
if (path, clip_options) in include_log:
- raise self.warning('circular inclusion in "%s" directive: %s'
- % (self.name, ' < '.join([path] + [pth for (pth, opt)
- in include_log[::-1]])))
+ master_paths = (pth for (pth, opt) in reversed(include_log))
+ inclusion_chain = '\n> '.join((path, *master_paths))
+ raise self.warning('circular inclusion in "%s" directive:\n%s'
+ % (self.name, inclusion_chain))
if 'parser' in self.options:
# parse into a dummy document and return created nodes
Modified: trunk/docutils/test/test_parsers/test_rst/test_directives/test_include.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_directives/test_include.py 2022-01-27 14:22:31 UTC (rev 8986)
+++ trunk/docutils/test/test_parsers/test_rst/test_directives/test_include.py 2022-01-27 14:22:42 UTC (rev 8987)
@@ -1207,7 +1207,11 @@
File "include16.txt": example of rekursive inclusion.
<system_message level="2" line="3" source="%s" type="WARNING">
<paragraph>
- circular inclusion in "include" directive: %s < %s < %s < test data
+ circular inclusion in "include" directive:
+ %s
+ > %s
+ > %s
+ > test data
<literal_block xml:space="preserve">
.. include:: include15.txt
<paragraph>
@@ -1232,7 +1236,12 @@
File "include16.txt": example of rekursive inclusion.
<system_message level="2" line="3" source="%s" type="WARNING">
<paragraph>
- circular inclusion in "include" directive: %s < %s < %s < %s < test data
+ circular inclusion in "include" directive:
+ %s
+ > %s
+ > %s
+ > %s
+ > test data
<literal_block xml:space="preserve">
.. include:: include15.txt
<paragraph>
@@ -1261,7 +1270,11 @@
File "include16.txt": example of rekursive inclusion.
<system_message level="2" line="3" source="%s" type="WARNING">
<paragraph>
- circular inclusion in "include" directive: %s < %s < %s < test data
+ circular inclusion in "include" directive:
+ %s
+ > %s
+ > %s
+ > test data
<literal_block xml:space="preserve">
.. include:: include15.txt
<paragraph>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <mi...@us...> - 2022-01-29 10:48:27
|
Revision: 8991
http://sourceforge.net/p/docutils/code/8991
Author: milde
Date: 2022-01-29 10:48:24 +0000 (Sat, 29 Jan 2022)
Log Message:
-----------
Add `reporter` to `parsers.rst.Directive` class attributes.
Allows `Directive` subclass methods to call "reporter" methods as
`self.reporter.error()` etc. instead of the lengthy
`self.statemachine.reporter.error()`.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/parsers/rst/__init__.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
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2022-01-29 10:48:14 UTC (rev 8990)
+++ trunk/docutils/HISTORY.txt 2022-01-29 10:48:24 UTC (rev 8991)
@@ -39,6 +39,7 @@
* docutils/parsers/rst/__init__.py
- use "https:" scheme in PEP and RFC base link defaults.
+ - Add `reporter` to `Directive` class attributes.
* docutils/parsers/rst/directives/__init__.py
Modified: trunk/docutils/docutils/parsers/rst/__init__.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/__init__.py 2022-01-29 10:48:14 UTC (rev 8990)
+++ trunk/docutils/docutils/parsers/rst/__init__.py 2022-01-29 10:48:24 UTC (rev 8991)
@@ -272,6 +272,8 @@
- ``state_machine`` is the state machine which controls the state which called
the directive function.
+
+ - ``reporter`` is the state machine's `reporter` instance.
Directive functions return a list of nodes which will be inserted
into the document tree at the point where the directive was
@@ -286,7 +288,7 @@
substitution definition context, typically using code like this::
if not isinstance(state, states.SubstitutionDef):
- error = state_machine.reporter.error(
+ error = self.reporter.error(
'Invalid context: the "%s" directive can only be used '
'within a substitution definition.' % (name),
nodes.literal_block(block_text, block_text), line=lineno)
@@ -323,6 +325,7 @@
self.block_text = block_text
self.state = state
self.state_machine = state_machine
+ self.reporter = state_machine.reporter
def run(self):
raise NotImplementedError('Must override run() in subclass.')
Modified: trunk/docutils/docutils/parsers/rst/directives/images.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/images.py 2022-01-29 10:48:14 UTC (rev 8990)
+++ trunk/docutils/docutils/parsers/rst/directives/images.py 2022-01-29 10:48:24 UTC (rev 8991)
@@ -153,7 +153,7 @@
figure_node += caption
elif not (isinstance(first_node, nodes.comment)
and len(first_node) == 0):
- error = self.state_machine.reporter.error(
+ error = self.reporter.error(
'Figure caption must be a paragraph or empty comment.',
nodes.literal_block(self.block_text, self.block_text),
line=self.lineno)
Modified: trunk/docutils/docutils/parsers/rst/directives/misc.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/misc.py 2022-01-29 10:48:14 UTC (rev 8990)
+++ trunk/docutils/docutils/parsers/rst/directives/misc.py 2022-01-29 10:48:24 UTC (rev 8991)
@@ -318,7 +318,7 @@
messages.append(elem)
else:
return [
- self.state_machine.reporter.error(
+ self.reporter.error(
'Error in "%s" directive: may contain a single paragraph '
'only.' % self.name, line=self.lineno)]
if node:
@@ -449,7 +449,7 @@
self.content[1:], self.content_offset, converted_role,
option_presets={}))
except states.MarkupError as detail:
- error = self.state_machine.reporter.error(
+ error = self.reporter.error(
'Error in "%s" directive:\n%s.' % (self.name, detail),
nodes.literal_block(self.block_text, self.block_text),
line=self.lineno)
@@ -458,10 +458,10 @@
try:
options['class'] = directives.class_option(new_role_name)
except ValueError as detail:
- error = self.state_machine.reporter.error(
- 'Invalid argument for "%s" directive:\n%s.'
- % (self.name, detail), nodes.literal_block(
- self.block_text, self.block_text), line=self.lineno)
+ error = self.reporter.error('Invalid argument '
+ 'for "%s" directive:\n%s.' % (self.name, detail),
+ nodes.literal_block(self.block_text, self.block_text),
+ line=self.lineno)
return messages + [error]
role = roles.CustomRole(new_role_name, base_role, options, content)
roles.register_local_role(new_role_name, role)
@@ -561,7 +561,7 @@
state_machine_kwargs=self.SMkwargs)
if (new_line_offset - self.content_offset) != len(self.content):
# incomplete parse of block?
- error = self.state_machine.reporter.error(
+ error = self.reporter.error(
'Invalid meta directive.',
nodes.literal_block(self.block_text, self.block_text),
line=self.lineno)
@@ -615,12 +615,12 @@
def run(self):
if self.content:
text = '\n'.join(self.content)
- info = self.state_machine.reporter.info(
+ info = self.reporter.info(
'Directive processed. Type="%s", arguments=%r, options=%r, '
'content:' % (self.name, self.arguments, self.options),
nodes.literal_block(text, text), line=self.lineno)
else:
- info = self.state_machine.reporter.info(
+ info = self.reporter.info(
'Directive processed. Type="%s", arguments=%r, options=%r, '
'content: None' % (self.name, self.arguments, self.options),
line=self.lineno)
@@ -633,12 +633,12 @@
# """This directive is useful only for testing purposes."""
# if content:
# text = '\n'.join(content)
-# info = state_machine.reporter.info(
+# info = reporter.info(
# 'Directive processed. Type="%s", arguments=%r, options=%r, '
# 'content:' % (name, arguments, options),
# nodes.literal_block(text, text), line=lineno)
# else:
-# info = state_machine.reporter.info(
+# info = reporter.info(
# 'Directive processed. Type="%s", arguments=%r, options=%r, '
# 'content: None' % (name, arguments, options), line=lineno)
# return [info]
Modified: trunk/docutils/docutils/parsers/rst/directives/tables.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/tables.py 2022-01-29 10:48:14 UTC (rev 8990)
+++ trunk/docutils/docutils/parsers/rst/directives/tables.py 2022-01-29 10:48:24 UTC (rev 8991)
@@ -65,33 +65,33 @@
def check_table_dimensions(self, rows, header_rows, stub_columns):
if len(rows) < header_rows:
- error = self.state_machine.reporter.error(
- '%s header row(s) specified but only %s row(s) of data '
- 'supplied ("%s" directive).'
- % (header_rows, len(rows), self.name), nodes.literal_block(
- self.block_text, self.block_text), line=self.lineno)
+ error = self.reporter.error('%s header row(s) specified but '
+ 'only %s row(s) of data supplied ("%s" directive).'
+ % (header_rows, len(rows), self.name),
+ nodes.literal_block(self.block_text, self.block_text),
+ line=self.lineno)
raise SystemMessagePropagation(error)
if len(rows) == header_rows > 0:
- error = self.state_machine.reporter.error(
- 'Insufficient data supplied (%s row(s)); no data remaining '
- 'for table body, required by "%s" directive.'
- % (len(rows), self.name), nodes.literal_block(
- self.block_text, self.block_text), line=self.lineno)
+ error = self.reporter.error('Insufficient data supplied (%s row(s)); '
+ 'no data remaining for table body, required by "%s" directive.'
+ % (len(rows), self.name),
+ nodes.literal_block(self.block_text, self.block_text),
+ line=self.lineno)
raise SystemMessagePropagation(error)
for row in rows:
if len(row) < stub_columns:
- error = self.state_machine.reporter.error(
- '%s stub column(s) specified but only %s columns(s) of '
- 'data supplied ("%s" directive).' %
- (stub_columns, len(row), self.name), nodes.literal_block(
- self.block_text, self.block_text), line=self.lineno)
+ error = self.reporter.error('%s stub column(s) specified but '
+ 'only %s columns(s) of data supplied ("%s" directive).'
+ % (stub_columns, len(row), self.name),
+ nodes.literal_block(self.block_text, self.block_text),
+ line=self.lineno)
raise SystemMessagePropagation(error)
if len(row) == stub_columns > 0:
- error = self.state_machine.reporter.error(
- 'Insufficient data supplied (%s columns(s)); no data remaining '
- 'for table body, required by "%s" directive.'
- % (len(row), self.name), nodes.literal_block(
- self.block_text, self.block_text), line=self.lineno)
+ error = self.reporter.error('Insufficient data supplied '
+ '(%s columns(s)); no data remaining for table body, required '
+ 'by "%s" directive.' % (len(row), self.name),
+ nodes.literal_block(self.block_text, self.block_text),
+ line=self.lineno)
raise SystemMessagePropagation(error)
def set_table_width(self, table_node):
@@ -106,18 +106,18 @@
if isinstance(self.widths, list):
if len(self.widths) != n_cols:
# TODO: use last value for missing columns?
- error = self.state_machine.reporter.error(
- '"%s" widths do not match the number of columns in table '
- '(%s).' % (self.name, n_cols), nodes.literal_block(
- self.block_text, self.block_text), line=self.lineno)
+ error = self.reporter.error('"%s" widths do not match the '
+ 'number of columns in table (%s).' % (self.name, n_cols),
+ nodes.literal_block(self.block_text, self.block_text),
+ line=self.lineno)
raise SystemMessagePropagation(error)
col_widths = self.widths
elif n_cols:
col_widths = [100 // n_cols] * n_cols
else:
- error = self.state_machine.reporter.error(
- 'No table data detected in CSV file.', nodes.literal_block(
- self.block_text, self.block_text), line=self.lineno)
+ error = self.reporter.error('No table data detected in CSV file.',
+ nodes.literal_block(self.block_text, self.block_text),
+ line=self.lineno)
raise SystemMessagePropagation(error)
return col_widths
@@ -132,19 +132,19 @@
def run(self):
if not self.content:
- warning = self.state_machine.reporter.warning(
- 'Content block expected for the "%s" directive; none found.'
- % self.name, nodes.literal_block(
- self.block_text, self.block_text), line=self.lineno)
+ warning = self.reporter.warning('Content block expected '
+ 'for the "%s" directive; none found.' % self.name,
+ nodes.literal_block(self.block_text, self.block_text),
+ line=self.lineno)
return [warning]
title, messages = self.make_title()
node = nodes.Element() # anonymous container for parsing
self.state.nested_parse(self.content, self.content_offset, node)
if len(node) != 1 or not isinstance(node[0], nodes.table):
- error = self.state_machine.reporter.error(
- 'Error parsing content block for the "%s" directive: exactly '
- 'one table expected.' % self.name, nodes.literal_block(
- self.block_text, self.block_text), line=self.lineno)
+ error = self.reporter.error('Error parsing content block for the '
+ '"%s" directive: exactly one table expected.' % self.name,
+ nodes.literal_block(self.block_text, self.block_text),
+ line=self.lineno)
return [error]
table_node = node[0]
table_node['classes'] += self.options.get('class', [])
@@ -240,10 +240,10 @@
if (not self.state.document.settings.file_insertion_enabled
and ('file' in self.options
or 'url' in self.options)):
- warning = self.state_machine.reporter.warning(
- 'File and URL access deactivated; ignoring "%s" '
- 'directive.' % self.name, nodes.literal_block(
- self.block_text, self.block_text), line=self.lineno)
+ warning = self.reporter.warning('File and URL access '
+ 'deactivated; ignoring "%s" directive.' % self.name,
+ nodes.literal_block(self.block_text, self.block_text),
+ line=self.lineno)
return [warning]
self.check_requirements()
title, messages = self.make_title()
@@ -264,10 +264,10 @@
return [detail.args[0]]
except csv.Error as detail:
message = str(detail)
- error = self.state_machine.reporter.error(
- 'Error with CSV data in "%s" directive:\n%s'
- % (self.name, message), nodes.literal_block(
- self.block_text, self.block_text), line=self.lineno)
+ error = self.reporter.error('Error with CSV data'
+ ' in "%s" directive:\n%s' % (self.name, message),
+ nodes.literal_block(self.block_text, self.block_text),
+ line=self.lineno)
return [error]
table = (col_widths, table_head, table_body)
table_node = self.state.build_table(table, self.content_offset,
@@ -292,10 +292,10 @@
if self.content:
# CSV data is from directive content.
if 'file' in self.options or 'url' in self.options:
- error = self.state_machine.reporter.error(
- '"%s" directive may not both specify an external file and'
- ' have content.' % self.name, nodes.literal_block(
- self.block_text, self.block_text), line=self.lineno)
+ error = self.reporter.error('"%s" directive may not both '
+ 'specify an external file and have content.' % self.name,
+ nodes.literal_block(self.block_text, self.block_text),
+ line=self.lineno)
raise SystemMessagePropagation(error)
source = self.content.source(0)
csv_data = self.content
@@ -302,11 +302,11 @@
elif 'file' in self.options:
# CSV data is from an external file.
if 'url' in self.options:
- error = self.state_machine.reporter.error(
- 'The "file" and "url" options may not be simultaneously'
- ' specified for the "%s" directive.' % self.name,
- nodes.literal_block(self.block_text, self.block_text),
- line=self.lineno)
+ error = self.reporter.error('The "file" and "url" options '
+ 'may not be simultaneously specified '
+ 'for the "%s" directive.' % self.name,
+ nodes.literal_block(self.block_text, self.block_text),
+ line=self.lineno)
raise SystemMessagePropagation(error)
source_dir = os.path.dirname(
os.path.abspath(self.state.document.current_source))
@@ -319,7 +319,7 @@
error_handler=error_handler)
csv_data = csv_file.read().splitlines()
except OSError as error:
- severe = self.state_machine.reporter.severe(
+ severe = self.reporter.severe(
'Problems with "%s" directive path:\n%s.'
% (self.name, error),
nodes.literal_block(self.block_text, self.block_text),
@@ -339,7 +339,7 @@
try:
csv_text = urlopen(source).read()
except (URLError, OSError, ValueError) as error:
- severe = self.state_machine.reporter.severe(
+ severe = self.reporter.severe(
'Problems with "%s" directive URL "%s":\n%s.'
% (self.name, self.options['url'], error),
nodes.literal_block(self.block_text, self.block_text),
@@ -351,10 +351,11 @@
input_encoding_error_handler))
csv_data = csv_file.read().splitlines()
else:
- error = self.state_machine.reporter.warning(
+ error = self.reporter.warning(
'The "%s" directive requires content; none supplied.'
- % self.name, nodes.literal_block(
- self.block_text, self.block_text), line=self.lineno)
+ % self.name,
+ nodes.literal_block(self.block_text, self.block_text),
+ line=self.lineno)
raise SystemMessagePropagation(error)
return csv_data, source
@@ -409,8 +410,8 @@
def run(self):
if not self.content:
- error = self.state_machine.reporter.error(
- 'The "%s" directive is empty; content required.' % self.name,
+ error = self.reporter.error('The "%s" directive is empty; '
+ 'content required.' % self.name,
nodes.literal_block(self.block_text, self.block_text),
line=self.lineno)
return [error]
@@ -439,7 +440,7 @@
def check_list_content(self, node):
if len(node) != 1 or not isinstance(node[0], nodes.bullet_list):
- error = self.state_machine.reporter.error(
+ error = self.reporter.error(
'Error parsing content block for the "%s" directive: '
'exactly one bullet list expected.' % self.name,
nodes.literal_block(self.block_text, self.block_text),
@@ -451,16 +452,17 @@
for item_index in range(len(list_node)):
item = list_node[item_index]
if len(item) != 1 or not isinstance(item[0], nodes.bullet_list):
- error = self.state_machine.reporter.error(
+ error = self.reporter.error(
'Error parsing content block for the "%s" directive: '
'two-level bullet list expected, but row %s does not '
'contain a second-level bullet list.'
- % (self.name, item_index + 1), nodes.literal_block(
- self.block_text, self.block_text), line=self.lineno)
+ % (self.name, item_index + 1),
+ nodes.literal_block(self.block_text, self.block_text),
+ line=self.lineno)
raise SystemMessagePropagation(error)
elif item_index:
if len(item[0]) != num_cols:
- error = self.state_machine.reporter.error(
+ error = self.reporter.error(
'Error parsing content block for the "%s" directive: '
'uniform two-level bullet list expected, but row %s '
'does not contain the same number of items as row 1 '
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <mi...@us...> - 2022-01-29 13:20:07
|
Revision: 8993
http://sourceforge.net/p/docutils/code/8993
Author: milde
Date: 2022-01-29 13:20:04 +0000 (Sat, 29 Jan 2022)
Log Message:
-----------
Fix trailing whitespace (flake warnings W293, W391).
W293 blank line contains whitespace
W391 blank line at end of file
Modified Paths:
--------------
trunk/docutils/docutils/languages/pl.py
trunk/docutils/docutils/parsers/rst/__init__.py
trunk/docutils/docutils/parsers/rst/directives/__init__.py
trunk/docutils/docutils/parsers/rst/directives/parts.py
trunk/docutils/docutils/parsers/rst/languages/pl.py
trunk/docutils/docutils/transforms/frontmatter.py
trunk/docutils/docutils/transforms/writer_aux.py
trunk/docutils/docutils/utils/roman.py
trunk/docutils/docutils/writers/pseudoxml.py
trunk/docutils/test/functional/tests/math_output_html.py
trunk/docutils/test/functional/tests/math_output_latex.py
trunk/docutils/test/local-writer.py
trunk/docutils/test/test_io.py
trunk/docutils/test/test_parsers/test_get_parser_class.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_admonitions_de.py
trunk/docutils/test/test_transforms/test_sectnum.py
trunk/docutils/test/test_transforms/test_smartquotes.py
trunk/docutils/test/test_transforms/test_strip_elements_with_class.py
trunk/docutils/tools/rst2odt.py
trunk/docutils/tox.ini
Modified: trunk/docutils/docutils/languages/pl.py
===================================================================
--- trunk/docutils/docutils/languages/pl.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/docutils/languages/pl.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -58,5 +58,3 @@
author_separators = [';', ',']
"""List of separator strings for the 'Authors' bibliographic field. Tried in
order."""
-
-
Modified: trunk/docutils/docutils/parsers/rst/__init__.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/__init__.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/docutils/parsers/rst/__init__.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -272,7 +272,7 @@
- ``state_machine`` is the state machine which controls the state which called
the directive function.
-
+
- ``reporter`` is the state machine's `reporter` instance.
Directive functions return a list of nodes which will be inserted
Modified: trunk/docutils/docutils/parsers/rst/directives/__init__.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/__init__.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/docutils/parsers/rst/directives/__init__.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -407,7 +407,7 @@
def value_or(values, other):
"""
Directive option conversion function.
-
+
The argument can be any of `values` or `argument_type`.
"""
def auto_or_other(argument):
Modified: trunk/docutils/docutils/parsers/rst/directives/parts.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/parts.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/docutils/parsers/rst/directives/parts.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -41,7 +41,7 @@
'local': directives.flag,
'backlinks': backlinks,
'class': directives.class_option}
-
+
def run(self):
if not (self.state_machine.match_titles
or isinstance(self.state_machine.node, nodes.sidebar)):
Modified: trunk/docutils/docutils/parsers/rst/languages/pl.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/pl.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/docutils/parsers/rst/languages/pl.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -97,6 +97,3 @@
'surowe': 'raw',}
"""Mapping of Polish role names to canonical role names for interpreted text.
"""
-
-
-
Modified: trunk/docutils/docutils/transforms/frontmatter.py
===================================================================
--- trunk/docutils/docutils/transforms/frontmatter.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/docutils/transforms/frontmatter.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -503,7 +503,7 @@
def authors_from_one_paragraph(self, field):
"""Return list of Text nodes with author names in `field`.
-
+
Author names must be separated by one of the "autor separators"
defined for the document language (default: ";" or ",").
"""
Modified: trunk/docutils/docutils/transforms/writer_aux.py
===================================================================
--- trunk/docutils/docutils/transforms/writer_aux.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/docutils/transforms/writer_aux.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -25,7 +25,7 @@
"""
.. warning:: This transform is not used by Docutils since Dec 2010
and will be removed in Docutils 0.21 or later.
-
+
Flatten all compound paragraphs. For example, transform ::
<compound>
@@ -41,7 +41,7 @@
"""
default_priority = 910
-
+
def __init__(self, document, startnode=None):
warnings.warn('docutils.transforms.writer_aux.Compound is deprecated'
' and will be removed in Docutils 0.21 or later.',
Modified: trunk/docutils/docutils/utils/roman.py
===================================================================
--- trunk/docutils/docutils/utils/roman.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/docutils/utils/roman.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -79,4 +79,3 @@
result += integer
index += len(numeral)
return result
-
Modified: trunk/docutils/docutils/writers/pseudoxml.py
===================================================================
--- trunk/docutils/docutils/writers/pseudoxml.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/docutils/writers/pseudoxml.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -16,7 +16,7 @@
supported = ('pprint', 'pformat', 'pseudoxml')
"""Formats this writer supports."""
-
+
settings_spec = (
'"Docutils pseudo-XML" Writer Options',
None,
Modified: trunk/docutils/test/functional/tests/math_output_html.py
===================================================================
--- trunk/docutils/test/functional/tests/math_output_html.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/test/functional/tests/math_output_html.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -12,5 +12,3 @@
# local copy of stylesheets:
# (Test runs in ``docutils/test/``, we need relative path from there.)
settings_overrides['stylesheet_dirs'] = ('.', 'functional/input/data')
-
-
Modified: trunk/docutils/test/functional/tests/math_output_latex.py
===================================================================
--- trunk/docutils/test/functional/tests/math_output_latex.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/test/functional/tests/math_output_latex.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -12,5 +12,3 @@
# local copy of stylesheets:
# (Test runs in ``docutils/test/``, we need relative path from there.)
settings_overrides['stylesheet_dirs'] = ('.', 'functional/input/data')
-
-
Modified: trunk/docutils/test/local-writer.py
===================================================================
--- trunk/docutils/test/local-writer.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/test/local-writer.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -33,5 +33,3 @@
class Translator(nodes.NodeVisitor):
def __init__(self, document):
nodes.NodeVisitor.__init__(self, document)
-
-
Modified: trunk/docutils/test/test_io.py
===================================================================
--- trunk/docutils/test/test_io.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/test/test_io.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -65,7 +65,7 @@
self.assertEqual(io.check_encoding(mock_stdout, None), None)
# encoding is invalid
self.assertEqual(io.check_encoding(mock_stdout, 'UTF-9'), None)
-
+
def test_error_string(self):
us = '\xfc' # bytes(us) fails
bs = b'\xc3\xbc' # str(bs) returns repr(bs)
@@ -77,9 +77,9 @@
self.assertEqual('ImportError: %s' % us,
io.error_string(ImportError(us)))
-
+
class InputTests(unittest.TestCase):
def test_bom(self):
Modified: trunk/docutils/test/test_parsers/test_get_parser_class.py
===================================================================
--- trunk/docutils/test/test_parsers/test_get_parser_class.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/test/test_parsers/test_get_parser_class.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -31,4 +31,3 @@
if __name__ == '__main__':
import unittest
unittest.main()
-
Modified: trunk/docutils/test/test_parsers/test_rst/test_directives/test_admonitions_de.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_directives/test_admonitions_de.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/test/test_parsers/test_rst/test_directives/test_admonitions_de.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -211,7 +211,7 @@
1 argument(s) required, 0 supplied.
<literal_block xml:space="preserve">
.. admonition::
-
+ \n\
Generic admonitions require a title.
"""],
]
Modified: trunk/docutils/test/test_transforms/test_sectnum.py
===================================================================
--- trunk/docutils/test/test_transforms/test_sectnum.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/test/test_transforms/test_sectnum.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -272,7 +272,7 @@
["""\
.. sectnum::
:start: 3
-
+ \n\
Title 1
=======
Paragraph 1.
@@ -325,7 +325,7 @@
:prefix: (5.9.
:suffix: )
:start: 3
-
+ \n\
Title 1
=======
Paragraph 1.
Modified: trunk/docutils/test/test_transforms/test_smartquotes.py
===================================================================
--- trunk/docutils/test/test_transforms/test_smartquotes.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/test/test_transforms/test_smartquotes.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -98,10 +98,10 @@
Keep quotes straight in code and math:
<literal classes="code">
print "hello"
-
+ \n\
<literal classes="code python">
print("hello")
-
+ \n\
<math>
1' 12"
.
Modified: trunk/docutils/test/test_transforms/test_strip_elements_with_class.py
===================================================================
--- trunk/docutils/test/test_transforms/test_strip_elements_with_class.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/test/test_transforms/test_strip_elements_with_class.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -38,9 +38,9 @@
.. code::
:class: spam
-
+ \n\
print("spam")
-
+ \n\
.. image:: spam.jpg
:class: spam
Modified: trunk/docutils/tools/rst2odt.py
===================================================================
--- trunk/docutils/tools/rst2odt.py 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/tools/rst2odt.py 2022-01-29 13:20:04 UTC (rev 8993)
@@ -26,4 +26,3 @@
reader = Reader()
output = publish_cmdline_to_binary(reader=reader, writer=writer,
description=description)
-
Modified: trunk/docutils/tox.ini
===================================================================
--- trunk/docutils/tox.ini 2022-01-29 10:48:46 UTC (rev 8992)
+++ trunk/docutils/tox.ini 2022-01-29 13:20:04 UTC (rev 8993)
@@ -92,12 +92,10 @@
# 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,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,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)
-#
-# F821, disabled due to use of 'settings_overrides'
per-file-ignores =
test/functional/tests/*:F821 # included config files
test/test_readers/test_pep/*:E122,E128
@@ -104,5 +102,5 @@
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_writers/test_latex2e.py:E122,E128,W291,W293 # 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.
|
|
From: <mi...@us...> - 2022-01-29 16:28:21
|
Revision: 8994
http://sourceforge.net/p/docutils/code/8994
Author: milde
Date: 2022-01-29 16:28:17 +0000 (Sat, 29 Jan 2022)
Log Message:
-----------
Fix code indentation
Check conformance to our coding policies with flake8.
Fix the following problems:
E111 indentation is not a multiple of four
E114 indentation is not a multiple of four (comment)
E115 expected an indented block (comment)
E116 unexpected indentation (comment)
E117 over-indented
E121 continuation line under-indented for hanging indent
E122 continuation line missing indentation or outdented
E124 closing bracked does not match visual indentaion
E127 continuation line over-indented for visual indent
E128 continuation line under-indented for visual indent
E131 continuation line unaligned for hanging indent
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/zh_cn.py
trunk/docutils/docutils/languages/zh_tw.py
trunk/docutils/docutils/nodes.py
trunk/docutils/docutils/parsers/__init__.py
trunk/docutils/docutils/parsers/recommonmark_wrapper.py
trunk/docutils/docutils/parsers/rst/__init__.py
trunk/docutils/docutils/parsers/rst/directives/body.py
trunk/docutils/docutils/parsers/rst/directives/misc.py
trunk/docutils/docutils/parsers/rst/languages/ar.py
trunk/docutils/docutils/parsers/rst/languages/fa.py
trunk/docutils/docutils/parsers/rst/languages/fr.py
trunk/docutils/docutils/parsers/rst/languages/he.py
trunk/docutils/docutils/parsers/rst/languages/it.py
trunk/docutils/docutils/parsers/rst/languages/ru.py
trunk/docutils/docutils/parsers/rst/languages/sk.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/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/error_reporting.py
trunk/docutils/docutils/utils/math/latex2mathml.py
trunk/docutils/docutils/utils/math/math2html.py
trunk/docutils/docutils/utils/math/tex2mathml_extern.py
trunk/docutils/docutils/utils/smartquotes.py
trunk/docutils/docutils/utils/urischemes.py
trunk/docutils/docutils/writers/_html_base.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/pygmentsformatter.py
trunk/docutils/docutils/writers/pep_html/__init__.py
trunk/docutils/docutils/writers/pseudoxml.py
trunk/docutils/docutils/writers/s5_html/__init__.py
trunk/docutils/docutils/writers/xetex/__init__.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/package_unittest.py
trunk/docutils/test/test__init__.py
trunk/docutils/test/test_dependencies.py
trunk/docutils/test/test_io.py
trunk/docutils/test/test_nodes.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_block_quotes.py
trunk/docutils/test/test_publisher.py
trunk/docutils/test/test_settings.py
trunk/docutils/test/test_statemachine.py
trunk/docutils/test/test_traversals.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_html4css1_misc.py
trunk/docutils/test/test_writers/test_html4css1_template.py
trunk/docutils/test/test_writers/test_html5_polyglot_misc.py
trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
trunk/docutils/test/test_writers/test_latex2e.py
trunk/docutils/test/test_writers/test_latex2e_misc.py
trunk/docutils/test/test_writers/test_odt.py
trunk/docutils/tools/buildhtml.py
trunk/docutils/tools/dev/generate_punctuation_chars.py
trunk/docutils/tools/dev/unicode2rstsubs.py
trunk/docutils/tools/docutils-cli.py
trunk/docutils/tools/quicktest.py
trunk/docutils/tools/rst2odt.py
trunk/docutils/tox.ini
Modified: trunk/docutils/docutils/__init__.py
===================================================================
--- trunk/docutils/docutils/__init__.py 2022-01-29 13:20:04 UTC (rev 8993)
+++ trunk/docutils/docutils/__init__.py 2022-01-29 16:28:17 UTC (rev 8994)
@@ -84,8 +84,8 @@
if releaselevel == 'final':
if not release:
raise ValueError('releaselevel "final" must not be used '
- 'with development versions (leads to wrong '
- 'version ordering of the related __version__')
+ 'with development versions (leads to wrong '
+ 'version ordering of the related __version__')
if serial != 0:
raise ValueError('"serial" must be 0 for final releases')
Modified: trunk/docutils/docutils/core.py
===================================================================
--- trunk/docutils/docutils/core.py 2022-01-29 13:20:04 UTC (rev 8993)
+++ trunk/docutils/docutils/core.py 2022-01-29 16:28:17 UTC (rev 8994)
@@ -275,7 +275,7 @@
def report_SystemMessage(self, error):
print('Exiting due to level-%s (%s) system message.' % (
- error.level, utils.Reporter.levels[error.level]),
+ error.level, utils.Reporter.levels[error.level]),
file=self._stderr)
def report_UnicodeError(self, error):
@@ -508,14 +508,18 @@
return pub.publish(enable_exit_status=enable_exit_status)
def publish_cmdline_to_binary(reader=None, reader_name='standalone',
- parser=None, parser_name='restructuredtext',
- writer=None, writer_name='pseudoxml',
- settings=None, settings_spec=None,
- settings_overrides=None, config_section=None,
- enable_exit_status=True, argv=None,
- usage=default_usage, description=default_description,
- destination=None, destination_class=io.BinaryFileOutput
- ):
+ parser=None, parser_name='restructuredtext',
+ writer=None, writer_name='pseudoxml',
+ settings=None,
+ settings_spec=None,
+ settings_overrides=None,
+ config_section=None,
+ enable_exit_status=True,
+ argv=None,
+ usage=default_usage,
+ description=default_description,
+ destination=None,
+ destination_class=io.BinaryFileOutput):
"""
Set up & run a `Publisher` for command-line-based file I/O (input and
output file paths taken automatically from the command line). Return the
@@ -533,7 +537,7 @@
(along with command-line option descriptions).
"""
pub = Publisher(reader, parser, writer, settings=settings,
- destination_class=destination_class)
+ destination_class=destination_class)
pub.set_components(reader_name, parser_name, writer_name)
output = pub.publish(
argv, usage, description, settings_spec, settings_overrides,
Modified: trunk/docutils/docutils/frontend.py
===================================================================
--- trunk/docutils/docutils/frontend.py 2022-01-29 13:20:04 UTC (rev 8993)
+++ trunk/docutils/docutils/frontend.py 2022-01-29 16:28:17 UTC (rev 8994)
@@ -162,7 +162,7 @@
return value
def validate_comma_separated_list(setting, value, option_parser,
- config_parser=None, config_section=None):
+ config_parser=None, config_section=None):
"""Check/normalize list arguments (split at "," and strip whitespace).
"""
# `value` may be ``bytes``, ``str``, or a ``list`` (when given as
@@ -207,7 +207,7 @@
return value
def validate_smartquotes_locales(setting, value, option_parser,
- config_parser=None, config_section=None):
+ config_parser=None, config_section=None):
"""Check/normalize a comma separated list of smart quote definitions.
Return a list of (language-tag, quotes) string tuples."""
@@ -236,7 +236,7 @@
quotes = multichar_quotes
elif len(quotes) != 4:
raise ValueError('Invalid value "%s". Please specify 4 quotes\n'
- ' (primary open/close; secondary open/close).'
+ ' (primary open/close; secondary open/close).'
% item.encode('ascii', 'backslashreplace'))
lc_quotes.append((lang, quotes))
return lc_quotes
@@ -281,8 +281,7 @@
# opt_spec is ("<help>", [<option strings>], {<keyword args>})
opt_name = [opt_string[2:].replace('-', '_')
for opt_string in opt_spec[1]
- if opt_string.startswith('--')
- ][0]
+ if opt_string.startswith('--')][0]
if opt_name in exclude:
continue
if opt_name in replace.keys():
Modified: trunk/docutils/docutils/io.py
===================================================================
--- trunk/docutils/docutils/io.py 2022-01-29 13:20:04 UTC (rev 8993)
+++ trunk/docutils/docutils/io.py 2022-01-29 16:28:17 UTC (rev 8994)
@@ -281,7 +281,7 @@
except TypeError:
if isinstance(data, str): # destination may expect bytes
self.destination.write(data.encode(self.encoding,
- self.encoding_errors))
+ self.encoding_errors))
elif self.destination in (sys.stderr, sys.stdout):
self.destination.buffer.write(data) # write bytes to raw stream
else:
@@ -422,9 +422,9 @@
self.opened = True
self.autoclose = autoclose
if handle_io_errors is not None:
- warnings.warn('io.FileOutput: initialization argument '
- '"handle_io_errors" is ignored and will be removed in '
- 'Docutils 1.2.', DeprecationWarning, stacklevel=2)
+ warnings.warn('io.FileOutput: init argument "handle_io_errors" '
+ 'is ignored and will be removed in '
+ 'Docutils 1.2.', DeprecationWarning, stacklevel=2)
if mode is not None:
self.mode = mode
self._stderr = ErrorOutput()
@@ -436,9 +436,9 @@
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 '
- 'mode "%s"' % (self.destination.mode, mode),
- file=self._stderr)
+ print('Warning: Destination mode "%s" differs from specified '
+ 'mode "%s"' % (self.destination.mode, mode),
+ file=self._stderr)
if not destination_path:
try:
self.destination_path = self.destination.name
@@ -482,10 +482,12 @@
except AttributeError:
if check_encoding(self.destination,
self.encoding) is False:
- raise ValueError('Encoding of %s (%s) differs \n'
+ raise ValueError(
+ 'Encoding of %s (%s) differs \n'
' from specified encoding (%s)' %
(self.destination_path or 'destination',
- self.destination.encoding, self.encoding))
+ self.destination.encoding,
+ self.encoding))
else:
raise err
except (UnicodeError, LookupError) as err:
Modified: trunk/docutils/docutils/languages/zh_cn.py
===================================================================
--- trunk/docutils/docutils/languages/zh_cn.py 2022-01-29 13:20:04 UTC (rev 8993)
+++ trunk/docutils/docutils/languages/zh_cn.py 2022-01-29 16:28:17 UTC (rev 8994)
@@ -61,6 +61,6 @@
'\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-01-29 13:20:04 UTC (rev 8993)
+++ trunk/docutils/docutils/languages/zh_tw.py 2022-01-29 16:28:17 UTC (rev 8994)
@@ -60,6 +60,6 @@
'\uff1b', # ';'
'\uff0c', # ','
'\u3001', # '、'
- ]
+ ]
"""List of separator strings for the 'Authors' bibliographic field. Tried in
order."""
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2022-01-29 13:20:04 UTC (rev 8993)
+++ trunk/docutils/docutils/nodes.py 2022-01-29 16:28:17 UTC (rev 8994)
@@ -670,7 +670,7 @@
def astext(self):
return self.child_text_separator.join(
- [child.astext() for child in self.children])
+ [child.astext() for child in self.children])
def non_default_attributes(self):
atts = {}
@@ -1125,7 +1125,7 @@
if text != '':
textnode = Text(text)
Element.__init__(self, rawsource, textnode, *children,
- **attributes)
+ **attributes)
else:
Element.__init__(self, rawsource, *children, **attributes)
@@ -1385,8 +1385,9 @@
else:
prefix = id_prefix + auto_id_prefix
if prefix.endswith('%'):
- prefix = '%s%s-' % (prefix[:-1], suggested_prefix
- or make_id(node.tagname))
+ prefix = '%s%s-' % (prefix[:-1],
+ suggested_prefix
+ or make_id(node.tagname))
while True:
self.id_counter[prefix] += 1
id = '%s%d' % (prefix, self.id_counter[prefix])
@@ -1448,9 +1449,9 @@
old_node = self.ids[old_id]
if 'refuri' in node:
refuri = node['refuri']
- if old_node['names'] \
- and 'refuri' in old_node \
- and old_node['refuri'] == refuri:
+ if (old_node['names']
+ and 'refuri' in old_node
+ and old_node['refuri'] == refuri):
level = 1 # just inform if refuri's identical
if level > 1:
dupname(old_node, name)
@@ -1542,8 +1543,8 @@
name = whitespace_normalize_name(def_name)
if name in self.substitution_defs:
msg = self.reporter.error(
- 'Duplicate substitution definition name: "%s".' % name,
- base_node=subdef)
+ 'Duplicate substitution definition name: "%s".' % name,
+ base_node=subdef)
if msgnode is not None:
msgnode += msg
oldnode = self.substitution_defs[name]
@@ -1574,7 +1575,7 @@
def copy(self):
obj = self.__class__(self.settings, self.reporter,
- **self.attributes)
+ **self.attributes)
obj.source = self.source
obj.line = self.line
return obj
@@ -1796,7 +1797,7 @@
def astext(self):
line = self.get('line', '')
return '%s:%s: (%s/%s) %s' % (self['source'], line, self['type'],
- self['level'], Element.astext(self))
+ self['level'], Element.astext(self))
class pending(Special, Invisible, Element):
@@ -1839,11 +1840,10 @@
"""Detail data (dictionary) required by the pending operation."""
def pformat(self, indent=' ', level=0):
- internals = [
- '.. internal attributes:',
- ' .transform: %s.%s' % (self.transform.__module__,
- self.transform.__name__),
- ' .details:']
+ internals = ['.. internal attributes:',
+ ' .transform: %s.%s' % (self.transform.__module__,
+ self.transform.__name__),
+ ' .details:']
details = sorted(self.details.items())
for key, value in details:
if isinstance(value, Node):
@@ -1850,8 +1850,9 @@
internals.append('%7s%s:' % ('', key))
internals.extend(['%9s%s' % ('', line)
for line in value.pformat().splitlines()])
- elif value and isinstance(value, list) \
- and isinstance(value[0], Node):
+ elif (value
+ and isinstance(value, list)
+ and isinstance(value[0], Node)):
internals.append('%7s%s:' % ('', key))
for v in value:
internals.extend(['%9s%s' % ('', line)
@@ -1864,7 +1865,7 @@
def copy(self):
obj = self.__class__(self.transform, self.details, self.rawsource,
- **self.attributes)
+ **self.attributes)
obj._document = self._document
obj.source = self.source
obj.line = self.line
@@ -2229,8 +2230,8 @@
id = id.translate(_non_id_translate)
# get rid of non-ascii characters.
# 'ascii' lowercase to prevent problems with turkish locale.
- id = unicodedata.normalize('NFKD', id).\
- encode('ascii', 'ignore').decode('ascii')
+ id = unicodedata.normalize(
+ 'NFKD', id).encode('ascii', 'ignore').decode('ascii')
# shrink runs of whitespace and replace by hyphen
id = _non_id_chars.sub('-', ' '.join(id.split()))
id = _non_id_at_ends.sub('', id)
Modified: trunk/docutils/docutils/parsers/__init__.py
===================================================================
--- trunk/docutils/docutils/parsers/__init__.py 2022-01-29 13:20:04 UTC (rev 8993)
+++ trunk/docutils/docutils/parsers/__init__.py 2022-01-29 16:28:17 UTC (rev 8994)
@@ -39,7 +39,8 @@
['--line-length-limit'],
{'metavar': '<length>', 'type': 'int', 'default': 10000,
'validator': frontend.validate_nonnegative_int}),
- ))
+ )
+ )
component_type = 'parser'
config_section = 'parsers'
Modified: trunk/docutils/docutils/parsers/recommonmark_wrapper.py
===================================================================
--- trunk/docutils/docutils/parsers/recommonmark_wrapper.py 2022-01-29 13:20:04 UTC (rev 8993)
+++ trunk/docutils/docutils/parsers/recommonmark_wrapper.py 2022-01-29 16:28:17 UTC (rev 8994)
@@ -44,6 +44,11 @@
pending_xref = nodes.pending
+# auxiliary function for `document.findall()`
+def is_literal(node):
+ return isinstance(node, (nodes.literal, nodes.literal_block))
+
+
class Parser(CommonMarkParser):
"""MarkDown parser based on recommonmark.
@@ -94,8 +99,7 @@
i += 1
# add "code" class argument to literal elements (inline and block)
- for node in document.findall(lambda n: isinstance(n,
- (nodes.literal, nodes.literal_block))):
+ for node in document.findall(is_literal):
if 'code' not in node['classes']:
node['classes'].append('code')
# move "language" argument to classes
Modified: trunk/docutils/docutils/parsers/rst/__init__.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/__init__.py 2022-01-29 13:20:04 UTC (rev 8993)
+++ trunk/docutils/docutils/parsers/rst/__init__.py 2022-01-29 16:28:17 UTC (rev 8994)
@@ -143,7 +143,8 @@
['--character-level-inline-markup'],
{'action': 'store_true', 'default': False,
'dest': 'character_level_inline_markup'}),
- ))
+ )
+ )
config_section = 'restructuredtext parser'
config_section_dependencies = ('parsers',)
Modified: trunk/docutils/docutils/parsers/rst/directives/body.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/body.py 2022-01-29 13:20:04 UTC (rev 8993)
+++ trunk/docutils/docutils/parsers/rst/directives/body.py 2022-01-29 16:28:17 UTC (rev 8994)
@@ -45,7 +45,7 @@
textnodes, more_messages = self.state.inline_text(
self.options['subtitle'], self.lineno)
titles.append(nodes.subtitle(self.options['subtitle'], '',
- *textnodes))
+ *textnodes))
messages.extend(more_messages)
else:
titles = []
@@ -137,7 +137,7 @@
option_spec = {'class': directives.class_option,
'name': directives.unchanged,
'number-lines': directives.unchanged # integer or None
- }
+ }
has_content = True
def run(self):
@@ -193,9 +193,10 @@
class MathBlock(Directive):
option_spec = {'class': directives.class_option,
- 'name': directives.unchanged}
+ 'name': directives.unchanged,
## TODO: Add Sphinx' ``mathbase.py`` option 'nowrap'?
# 'nowrap': directives.flag,
+ }
has_content = True
def run(self):
Modified: trunk/docutils/docutils/parsers/rst/directives/misc.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/misc.py 2022-01-29 13:20:04 UTC (rev 8993)
+++ trunk/docutils/docutils/parsers/rst/directives/misc.py 2022-01-29 16:28:17 UTC (rev 8994)
@@ -80,7 +80,7 @@
(self.name, path))
except OSError as error:
raise self.severe('Problems with "%s" directive path:\n%s.' %
- (self.name, io.error_string(error)))
+ (self.name, io.error_string(error)))
else:
self.state.document.settings.record_dependencies.add(path)
@@ -128,8 +128,9 @@
text = rawtext.expandtabs(tab_width)
else:
text = rawtext
- literal_block = nodes.literal_block(rawtext, source=path,
- classes=self.options.get('class', []))
+ literal_block = nodes.literal_block(
+ rawtext, source=path,
+ classes=self.options.get('class', []))
literal_block.line = 1
self.add_name(literal_block)
if 'number-lines' in self.options:
@@ -260,7 +261,7 @@
text = raw_file.read()
except UnicodeError as error:
raise self.severe('Problem with "%s" directive:\n%s'
- % (self.name, io.error_string(error)))
+ % (self.name, io.error_string(error)))
attributes['source'] = path
elif 'url' in self.options:
source = self.options['url']
@@ -273,7 +274,9 @@
raw_text = urlopen(source).read()
except (URLError, OSError) as error:
raise self.severe('Problems with "%s" directive URL "%s":\n%s.'
- % (self.name, self.options['url'], io.error_string(error)))
+ % (self.name,
+ self.options['url'],
+ io.error_string(error)))
raw_file = io.StringInput(source=raw_text, source_path=source,
encoding=encoding,
error_handler=e_handler)
@@ -289,7 +292,7 @@
raw_node = nodes.raw('', text, classes=self.options.get('class', []),
**attributes)
(raw_node.source,
- raw_node.line) = self.state_machine.get_source_and_line(self.lineno)
+ raw_node.line) = self.state_machine.get_source_and_line(self.lineno)
return [raw_node]
@@ -364,7 +367,7 @@
decoded = directives.unicode_code(code)
except ValueError as error:
raise self.error('Invalid character code: %s\n%s'
- % (code, io.error_string(error)))
+ % (code, io.error_string(error)))
element += nodes.Text(decoded)
return element.children
@@ -444,10 +447,10 @@
'supported (specified by "%r" role).' % (self.name, base_role))
try:
converted_role = convert_directive_function(base_role)
- (arguments, options, content, content_offset) = (
- self.state.parse_directive_block(
- self.content[1:], self.content_offset, converted_role,
- option_presets={}))
+ (arguments, options, content, content_offset
+ ) = self.state.parse_directive_block(
+ self.content[1:], self.content_offset,
+ converted_role, option_presets={})
except states.MarkupError as detail:
error = self.reporter.error(
'Error in "%s" directive:\n%s.' % (self.name, detail),
@@ -458,8 +461,9 @@
try:
options['class'] = directives.class_option(new_role_name)
except ValueError as detail:
- error = self.reporter.error('Invalid argument '
- 'for "%s" directive:\n%s.' % (self.name, detail),
+ error = self.reporter.error(
+ 'Invalid argument for "%s" directive:\n%s.'
+ % (self.name, detail),
nodes.literal_block(self.block_text, self.block_text),
line=self.lineno)
return messages + [error]
@@ -516,8 +520,8 @@
def parsemeta(self, match):
name = self.parse_field_marker(match)
name = utils.unescape(utils.escape2null(name))
- indented, indent, line_offset, blank_finish = \
- self.state_machine.get_first_known_indented(match.end())
+ (indented, indent, line_offset, blank_finish
+ ) = self.state_machine.get_first_known_indented(match.end())
node = nodes.meta()
node['content'] = utils.unescape(utils.escape2null(
' '.join(indented)))
Modified: trunk/docutils/docutils/parsers/rst/languages/ar.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/ar.py 2022-01-29 13:20:04 UTC (rev 8993)
+++ trunk/docutils/docutils/parsers/rst/languages/ar.py 2022-01-29 16:28:17 UTC (rev 8994)
@@ -15,57 +15,57 @@
__docformat__ = 'reStructuredText'
directives = {
- # language-dependent: fixed
- 'تنبيه': 'attention',
- 'احتیاط': 'caution',
- 'كود': 'code',
- 'خطر': 'danger',
- 'خطأ': 'error',
- 'تلميح': 'hint',
- 'مهم': 'important',
- 'ملاحظة': 'note',
- 'نصيحة': 'tip',
- 'تحذير': 'warning',
- 'تذكير': 'admonition',
- 'شريط-جانبي': 'sidebar',
- 'موضوع': 'topic',
- 'قالب-سطري': 'line-block',
- 'لفظ-حرفي': 'parsed-literal',
- 'معيار': 'rubric',
- 'فكرة-الكتاب': 'epigraph',
- 'تمييز': 'highlights',
- 'نقل-قول': 'pull-quote',
- 'ترکیب': 'compound',
- 'وعاء': 'container',
- #'questions': 'questions',
- 'جدول': 'table',
- 'جدول-csv': 'csv-table',
- 'جدول-قوائم': 'list-table',
- #'qa': 'questions',
- #'faq': 'questions',
- 'ميتا': 'meta',
- 'رياضيات': 'math',
- #'imagemap': 'imagemap',
- 'صورة': 'image',
- 'رسم-توضيحي': 'figure',
- 'تضمين': 'include',
- 'خام': 'raw',
- 'تبديل': 'replace',
- 'یونیکد': 'unicode',
- 'تاریخ': 'date',
- 'كائن': 'class',
- 'قانون': 'role',
- 'قانون-افتراضي': 'default-role',
- 'عنوان': 'title',
- 'المحتوى': 'contents',
- 'رقم-الفصل': 'sectnum',
- 'رقم-القسم': 'sectnum',
- 'رأس-الصفحة': 'header',
- 'هامش': 'footer',
- #'footnotes': 'footnotes',
- #'citations': 'citations',
- '': 'target-notes',
- }
+ # language-dependent: fixed
+ 'تنبيه': 'attention',
+ 'احتیاط': 'caution',
+ 'كود': 'code',
+ 'خطر': 'danger',
+ 'خطأ': 'error',
+ 'تلميح': 'hint',
+ 'مهم': 'important',
+ 'ملاحظة': 'note',
+ 'نصيحة': 'tip',
+ 'تحذير': 'warning',
+ 'تذكير': 'admonition',
+ 'شريط-جانبي': 'sidebar',
+ 'موضوع': 'topic',
+ 'قالب-سطري': 'line-block',
+ 'لفظ-حرفي': 'parsed-literal',
+ 'معيار': 'rubric',
+ 'فكرة-الكتاب': 'epigraph',
+...
[truncated message content] |
|
From: <mi...@us...> - 2022-01-29 22:26:13
|
Revision: 8995
http://sourceforge.net/p/docutils/code/8995
Author: milde
Date: 2022-01-29 22:26:10 +0000 (Sat, 29 Jan 2022)
Log Message:
-----------
Fix trailing whitespace (non-Python files).
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/MANIFEST.in
trunk/docutils/docs/dev/distributing.txt
trunk/docutils/docs/dev/repository.txt
trunk/docutils/docs/dev/todo.txt
trunk/docutils/docs/dev/website.txt
trunk/docutils/docs/howto/rst-directives.txt
trunk/docutils/docs/peps/pep-0258.txt
trunk/docutils/docs/ref/rst/definitions.txt
trunk/docutils/docs/user/emacs.txt
trunk/docutils/docs/user/html.txt
trunk/docutils/docs/user/links.txt
trunk/docutils/docs/user/rst/demo.txt
trunk/docutils/docs/user/rst/quickref.html
trunk/docutils/docs/user/tools.txt
trunk/docutils/docutils/writers/pep_html/pep.css
trunk/docutils/docutils/writers/s5_html/themes/big-black/framing.css
trunk/docutils/docutils/writers/s5_html/themes/big-black/pretty.css
trunk/docutils/docutils/writers/s5_html/themes/big-white/framing.css
trunk/docutils/docutils/writers/s5_html/themes/big-white/pretty.css
trunk/docutils/docutils/writers/s5_html/themes/default/framing.css
trunk/docutils/docutils/writers/s5_html/themes/default/pretty.css
trunk/docutils/docutils/writers/s5_html/themes/default/s5-core.css
trunk/docutils/docutils/writers/s5_html/themes/default/slides.js
trunk/docutils/docutils/writers/s5_html/themes/medium-black/pretty.css
trunk/docutils/docutils/writers/s5_html/themes/medium-white/framing.css
trunk/docutils/docutils/writers/s5_html/themes/medium-white/pretty.css
trunk/docutils/docutils/writers/s5_html/themes/small-black/pretty.css
trunk/docutils/docutils/writers/s5_html/themes/small-white/framing.css
trunk/docutils/docutils/writers/s5_html/themes/small-white/pretty.css
trunk/docutils/test/data/config_2.txt
trunk/docutils/test/functional/expected/ui/default/framing.css
trunk/docutils/test/functional/expected/ui/default/pretty.css
trunk/docutils/test/functional/expected/ui/default/s5-core.css
trunk/docutils/test/functional/expected/ui/default/slides.js
trunk/docutils/test/functional/expected/ui/small-black/framing.css
trunk/docutils/test/functional/expected/ui/small-black/pretty.css
trunk/docutils/test/functional/expected/ui/small-black/s5-core.css
trunk/docutils/test/functional/expected/ui/small-black/slides.js
trunk/docutils/test/functional/input/compact_lists.txt
trunk/docutils/test/functional/input/cyrillic.txt
trunk/docutils/test/functional/input/data/classes_latex.txt
trunk/docutils/test/functional/input/data/comprehensive-math-test.txt
trunk/docutils/test/functional/input/data/embed_images.txt
trunk/docutils/test/functional/input/data/latex-problematic.txt
trunk/docutils/test/functional/input/data/video.txt
trunk/docutils/test/functional/input/latex_leavevmode.txt
trunk/docutils/test/functional/input/odt_basic.txt
trunk/docutils/test/functional/input/odt_classifier.txt
trunk/docutils/test/functional/input/odt_custom_headfoot.txt
trunk/docutils/test/functional/input/odt_footnotes.txt
trunk/docutils/test/functional/input/odt_header_footer.txt
trunk/docutils/test/functional/input/odt_literal_block.txt
trunk/docutils/test/functional/input/standalone_rst_manpage.txt
trunk/docutils/test/test_parsers/test_rst/includes/include14.txt
trunk/docutils/test/test_parsers/test_rst/test_directives/include10.txt
trunk/docutils/tools/docutils.conf
trunk/docutils/tools/editors/emacs/IDEAS.rst
trunk/docutils/tools/editors/emacs/README.txt
trunk/docutils/tox.ini
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/HISTORY.txt 2022-01-29 22:26:10 UTC (rev 8995)
@@ -37,7 +37,7 @@
.. _"include" directive: docs/ref/rst/directives.html#include
* docutils/parsers/rst/__init__.py
-
+
- use "https:" scheme in PEP and RFC base link defaults.
- Add `reporter` to `Directive` class attributes.
@@ -65,8 +65,8 @@
* docutils/writers/pep_html/
- - use "https:" scheme in "python_home" URL default.
-
+ - use "https:" scheme in "python_home" URL default.
+
* test/DocutilsTestSupport.py
- exception_data() returns None if no exception was raised.
Modified: trunk/docutils/MANIFEST.in
===================================================================
--- trunk/docutils/MANIFEST.in 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/MANIFEST.in 2022-01-29 22:26:10 UTC (rev 8995)
@@ -5,7 +5,7 @@
recursive-include licenses *
recursive-include tools *
recursive-include test *
-exclude test/alltests.out test/record.txt
+exclude test/alltests.out test/record.txt
prune test/functional/output
include test/functional/output/README.txt
global-exclude *.pyc *~ __pycache__ .DS_Store
Modified: trunk/docutils/docs/dev/distributing.txt
===================================================================
--- trunk/docutils/docs/dev/distributing.txt 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docs/dev/distributing.txt 2022-01-29 22:26:10 UTC (rev 8995)
@@ -28,12 +28,12 @@
Docutils has the following dependencies:
-* Python 3.7 or later is required.
+* Python 3.7 or later is required.
Use ">= Python 3.7" in the dependencies.
* Docutils may optionally make use of the PIL (`Python Imaging
Library`_ or Pillow_). If PIL is present, it is automatically
- detected by Docutils.
+ detected by Docutils.
* Docutils recommends the `Pygments`_ syntax hightlighter. If available, it
is used for highlighting the content of `code directives`_ and roles as
@@ -43,7 +43,7 @@
* Docutils can use the `recommonmark`_ parser to parse input in
the Markdown format (new in 0.17).
-.. _Python Imaging Library:
+.. _Python Imaging Library:
https://en.wikipedia.org/wiki/Python_Imaging_Library
.. _Pillow: https://pypi.org/project/Pillow/
.. _Pygments: https://pygments.org/
Modified: trunk/docutils/docs/dev/repository.txt
===================================================================
--- trunk/docutils/docs/dev/repository.txt 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docs/dev/repository.txt 2022-01-29 22:26:10 UTC (rev 8995)
@@ -148,7 +148,7 @@
__ https://setuptools.pypa.io/en/latest/userguide/development_mode.html
#development-mode
-
+
.. _install manually:
3. Install "manually".
Modified: trunk/docutils/docs/dev/todo.txt
===================================================================
--- trunk/docutils/docs/dev/todo.txt 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docs/dev/todo.txt 2022-01-29 22:26:10 UTC (rev 8995)
@@ -93,7 +93,7 @@
Sourceforge supports multiple Git repositories per project, so we can
switch the version control system independent of the decision on an
-eventual switch of the host.
+eventual switch of the host.
Cf. https://sourceforge.net/p/forge/documentation/Git/
General
Modified: trunk/docutils/docs/dev/website.txt
===================================================================
--- trunk/docutils/docs/dev/website.txt 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docs/dev/website.txt 2022-01-29 22:26:10 UTC (rev 8995)
@@ -9,7 +9,7 @@
:Copyright: This document has been placed in the public domain.
The Docutils web site, <https://docutils.sourceforge.io/>, is
-maintained by the ``docutils-update.local`` script, run by project
+maintained by the ``docutils-update.local`` script, run by project
maintainers on their local machines. The script
will process any .txt file which is newer than the corresponding .html
file in the local copy of the project's web directory and upload the changes
@@ -48,7 +48,7 @@
(TBA)
-.. hint::
+.. hint::
Anyone with checkin privileges can be a web-site maintainer. You need to
set up the directories for a local website build.
@@ -92,10 +92,10 @@
#. Remove to-be-generated HTML files from
``sandbox/infrastructure/htmlfiles.lst``.
-
+
#. Removing files and directories from SVN will not trigger their removal
from the web site. Files and directories must be manually removed from
- sourceforge.net (under ``/home/project-web/docutils/htdocs/``).
+ sourceforge.net (under ``/home/project-web/docutils/htdocs/``).
..
Modified: trunk/docutils/docs/howto/rst-directives.txt
===================================================================
--- trunk/docutils/docs/howto/rst-directives.txt 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docs/howto/rst-directives.txt 2022-01-29 22:26:10 UTC (rev 8995)
@@ -377,7 +377,7 @@
from docutils.parsers.rst import Directive
def align(argument):
- """Conversion function for the "align" option."""
+ """Conversion function for the "align" option."""
return directives.choice(argument, ('left', 'center', 'right'))
class Image(Directive):
Modified: trunk/docutils/docs/peps/pep-0258.txt
===================================================================
--- trunk/docutils/docs/peps/pep-0258.txt 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docs/peps/pep-0258.txt 2022-01-29 22:26:10 UTC (rev 8995)
@@ -836,17 +836,17 @@
This would break "``from __future__ import``" statements introduced
in Python 2.1 for multiple module docstrings (main docstring plus
additional docstring(s)). The Python Reference Manual specifies:
-
+
A future statement must appear near the top of the module. The
only lines that can appear before a future statement are:
-
+
* the module docstring (if any),
* comments,
* blank lines, and
* other future statements.
-
+
Resolution?
-
+
1. Should we search for docstrings after a ``__future__``
statement? Very ugly.
Modified: trunk/docutils/docs/ref/rst/definitions.txt
===================================================================
--- trunk/docutils/docs/ref/rst/definitions.txt 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docs/ref/rst/definitions.txt 2022-01-29 22:26:10 UTC (rev 8995)
@@ -165,7 +165,7 @@
The "s5defs.txt_" standard definition file contains interpreted text
roles (classes) and other definitions for documents destined to become
-`S5/HTML slide shows`_.
+`S5/HTML slide shows`_.
.. _s5defs.txt: ../../../docutils/parsers/rst/include/s5defs.txt
.. _S5/HTML slide shows: ../../user/slide-shows.html
Modified: trunk/docutils/docs/user/emacs.txt
===================================================================
--- trunk/docutils/docs/user/emacs.txt 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docs/user/emacs.txt 2022-01-29 22:26:10 UTC (rev 8995)
@@ -589,12 +589,12 @@
structures docutils will parse them into. You can use to run the
active region through ``rst2pseudoxml.py`` and have the output
automatically be displayed in a new buffer.
-
+
* ``rst-compile-pdf-preview`` (``C-c C-c C-p``)
Convert the current document to PDF and launch a viewer on the
results.
-
+
* ``rst-compile-slides-preview`` (``C-c C-c C-s``): Convert the
current document to S5 slides and view in a web browser.
Modified: trunk/docutils/docs/user/html.txt
===================================================================
--- trunk/docutils/docs/user/html.txt 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docs/user/html.txt 2022-01-29 22:26:10 UTC (rev 8995)
@@ -128,13 +128,13 @@
================ =========== ============== ================= ===========
html4css1_ html4, rst2html4.py, `XHTML 1 `CSS 1`_
html_ rst2html.py Transitional`_
-
+
pep_html_ .. rstpep2html.py `XHTML 1 `CSS 1`_
Transitional`_
-
+
s5_html_ s5 rst2s5.py `XHTML 1 `CSS 1`_
Transitional`_
-
+
html5_polyglot_ html5 rst2html5.py `HTML5`_ `CSS 3`_
================ =========== ============== ================= ===========
Modified: trunk/docutils/docs/user/links.txt
===================================================================
--- trunk/docutils/docs/user/links.txt 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docs/user/links.txt 2022-01-29 22:26:10 UTC (rev 8995)
@@ -63,7 +63,7 @@
* Gunnar Schwant's DocFactory_ is a wxPython GUI application for
Docutils.
-
+
.. _DocFactory: https://docutils.sourceforge.io/sandbox/gschwant/docfactory/doc/
* ReSTedit_ by Bill Bumgarner is a Docutils GUI for Mac OS X.
@@ -96,7 +96,7 @@
* `rst2pdf (reportlab)`__ is a tool to go directly from
reStructuredText to PDF, via ReportLab__. No LaTeX installation
is required.
-
+
__ https://pypi.org/project/rst2pdf/
__ https://pypi.org/project/reportlab/
@@ -104,7 +104,7 @@
producing LaTeX, compiling the LaTeX file, getting the produced
output to the destination location and finally deleting all the
messy temporary files that this process generates.
-
+
__ https://docutils.sourceforge.io/sandbox/blais/rst2pdf/
* `rst2pdf (rubber)`__ is a front end for the generation of PDF
@@ -111,7 +111,7 @@
documents from a reStructuredText source via LaTeX in one step
cleaning up intermediate files. It uses the rubber__ Python wrapper
for LaTeX and friends.
-
+
__ https://docutils.sourceforge.io/sandbox/rst2pdf/README.html
__ https://launchpad.net/rubber
@@ -133,7 +133,7 @@
It can generate complete web sites (interlinked and indexed HTML pages),
ePub, LaTeX, and others from a set of rST source files.
-
+
.. _Sphinx: https://www.sphinx-doc.org
__ https://www.sphinx-doc.org/en/master/examples.html
@@ -186,7 +186,7 @@
* Pandoc_ is a document converter that can write Markdown_,
reStructuredText, HTML, LaTeX, RTF, DocBook XML, and S5.
-
+
.. _Pandoc: https://pandoc.org/
* restxsl_ by Michael Alyn Miller, lets you transform reStructuredText
@@ -207,7 +207,7 @@
extracts information from reStructuredText documents and stores it
in a database. Python knowledge is required to write extractor
functions and to retrieve the data from the database again.
-
+
.. _Nabu: https://github.com/blais/nabu
* The `pickle writer`_ by Martin Blais pickles the document tree to a binary
@@ -237,11 +237,11 @@
Convert other formats to reStructuredText:
* recommonmark_ is a Markdown_ (CommonMark_) parser for
- docutils originally created by Luca Barbato.
-
- Docutils "markdown" parser (new in Docutils 0.17) is a wrapper
+ docutils originally created by Luca Barbato.
+
+ Docutils "markdown" parser (new in Docutils 0.17) is a wrapper
around recommonmark.
-
+
.. _recommonmark: https://github.com/rtfd/recommonmark
.. _Markdown: https://daringfireball.net/projects/markdown/syntax
.. _CommonMark: https://commonmark.org/
@@ -255,7 +255,7 @@
* xml2rst_, an XSLT stylesheet written by Stefan Merten, converts XML
dumps of the document tree (e.g. created with rst2xml.py) back to
reStructuredText.
-
+
.. _xml2rst: http://www.merten-home.de/FreeSoftware/xml2rst/index.html
* xhtml2rest_, written by Antonios Christofides, is a simple utility
@@ -362,7 +362,7 @@
can be written with it too).
The `Python documentation`_ is based on reStructuredText and Sphinx.
-
+
.. _Python documentation: https://docs.python.org/
* Trac_, a project management and bug/issue tracking system, supports
@@ -418,7 +418,7 @@
* InkSlide_ quick and easy presentations using Inkscape_. InkSlide uses
reStructuredText for markup, although it renders only a subset of rst.
-
+
.. _InkSlide: http://wiki.inkscape.org/wiki/index.php/InkSlide
.. _Inkscape: http://inkscape.org/
@@ -428,4 +428,3 @@
.. _rst2outline: https://docutils.sourceforge.io/sandbox/rst2outline/
* Pandoc_ can also be used to produce slides
-
Modified: trunk/docutils/docs/user/rst/demo.txt
===================================================================
--- trunk/docutils/docs/user/rst/demo.txt 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docs/user/rst/demo.txt 2022-01-29 22:26:10 UTC (rev 8995)
@@ -474,7 +474,7 @@
:subtitle: Optional Subtitle
This is a sidebar. It is for text outside the flow of the main
- text.
+ text.
.. rubric:: This is a rubric inside a sidebar
@@ -509,7 +509,7 @@
Connecting... OK
Transmitting data... OK
Disconnecting... OK
-
+
and thus consists of a simple paragraph, a literal block, and
another simple paragraph. Nonetheless it is semantically *one*
paragraph.
Modified: trunk/docutils/docs/user/rst/quickref.html
===================================================================
--- trunk/docutils/docs/user/rst/quickref.html 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docs/user/rst/quickref.html 2022-01-29 22:26:10 UTC (rev 8995)
@@ -192,7 +192,7 @@
<li>The end-string must be immediately preceded by non-whitespace.
<li>The end-string must end a text block (end of document or
followed by a blank line) or be immediately followed by whitespace
- or any of <samp>' " . , : ; ! ? - ) ] } / \</samp>
+ or any of <samp>' " . , : ; ! ? - ) ] } / \</samp>
or <samp>></samp>.
<li>If a start-string is immediately preceded by one of
<samp>' " ( [ {</samp> or <samp><</samp>, it must not be
Modified: trunk/docutils/docs/user/tools.txt
===================================================================
--- trunk/docutils/docs/user/tools.txt 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docs/user/tools.txt 2022-01-29 22:26:10 UTC (rev 8995)
@@ -30,7 +30,7 @@
toolname [options] [<source> [<destination>]]
See rst2html4.py_ for examples.
-Each tool has a "``--help``" option which lists the
+Each tool has a "``--help``" option which lists the
`command-line options`_ and arguments it supports.
Processing can also be customized with `configuration files`_.
Modified: trunk/docutils/docutils/writers/pep_html/pep.css
===================================================================
--- trunk/docutils/docutils/writers/pep_html/pep.css 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docutils/writers/pep_html/pep.css 2022-01-29 22:26:10 UTC (rev 8995)
@@ -9,7 +9,7 @@
*/
/* "! important" is used here to override other ``margin-top`` and
- ``margin-bottom`` styles that are later in the stylesheet or
+ ``margin-bottom`` styles that are later in the stylesheet or
more specific. See http://www.w3.org/TR/CSS1#the-cascade */
.first {
margin-top: 0 ! important }
Modified: trunk/docutils/docutils/writers/s5_html/themes/big-black/framing.css
===================================================================
--- trunk/docutils/docutils/writers/s5_html/themes/big-black/framing.css 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docutils/writers/s5_html/themes/big-black/framing.css 2022-01-29 22:26:10 UTC (rev 8995)
@@ -1,6 +1,6 @@
/* The following styles size, place, and layer the slide components.
Edit these if you want to change the overall slide layout.
- The commented lines can be uncommented (and modified, if necessary)
+ The commented lines can be uncommented (and modified, if necessary)
to help you with the rearrangement process. */
/* target = 1024x768 */
Modified: trunk/docutils/docutils/writers/s5_html/themes/big-black/pretty.css
===================================================================
--- trunk/docutils/docutils/writers/s5_html/themes/big-black/pretty.css 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docutils/writers/s5_html/themes/big-black/pretty.css 2022-01-29 22:26:10 UTC (rev 8995)
@@ -29,7 +29,7 @@
html>body div#controls {position: fixed; padding: 0 0 1em 0; top: auto;}
div#controls form {position: absolute; bottom: 0; right: 0; width: 100%;
margin: 0; padding: 0;}
-#controls #navLinks a {padding: 0; margin: 0 0.5em;
+#controls #navLinks a {padding: 0; margin: 0 0.5em;
border: none; color: #888; cursor: pointer;}
#controls #navList {height: 1em;}
#controls #navList #jumplist {position: absolute; bottom: 0; right: 0;
Modified: trunk/docutils/docutils/writers/s5_html/themes/big-white/framing.css
===================================================================
--- trunk/docutils/docutils/writers/s5_html/themes/big-white/framing.css 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docutils/writers/s5_html/themes/big-white/framing.css 2022-01-29 22:26:10 UTC (rev 8995)
@@ -1,7 +1,7 @@
/* This file has been placed in the public domain. */
/* The following styles size, place, and layer the slide components.
Edit these if you want to change the overall slide layout.
- The commented lines can be uncommented (and modified, if necessary)
+ The commented lines can be uncommented (and modified, if necessary)
to help you with the rearrangement process. */
/* target = 1024x768 */
Modified: trunk/docutils/docutils/writers/s5_html/themes/big-white/pretty.css
===================================================================
--- trunk/docutils/docutils/writers/s5_html/themes/big-white/pretty.css 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docutils/writers/s5_html/themes/big-white/pretty.css 2022-01-29 22:26:10 UTC (rev 8995)
@@ -29,7 +29,7 @@
html>body div#controls {position: fixed; padding: 0 0 1em 0; top: auto;}
div#controls form {position: absolute; bottom: 0; right: 0; width: 100%;
margin: 0; padding: 0;}
-#controls #navLinks a {padding: 0; margin: 0 0.5em;
+#controls #navLinks a {padding: 0; margin: 0 0.5em;
border: none; color: #005; cursor: pointer;}
#controls #navList {height: 1em;}
#controls #navList #jumplist {position: absolute; bottom: 0; right: 0;
Modified: trunk/docutils/docutils/writers/s5_html/themes/default/framing.css
===================================================================
--- trunk/docutils/docutils/writers/s5_html/themes/default/framing.css 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docutils/writers/s5_html/themes/default/framing.css 2022-01-29 22:26:10 UTC (rev 8995)
@@ -1,7 +1,7 @@
/* This file has been placed in the public domain. */
/* The following styles size, place, and layer the slide components.
Edit these if you want to change the overall slide layout.
- The commented lines can be uncommented (and modified, if necessary)
+ The commented lines can be uncommented (and modified, if necessary)
to help you with the rearrangement process. */
/* target = 1024x768 */
Modified: trunk/docutils/docutils/writers/s5_html/themes/default/pretty.css
===================================================================
--- trunk/docutils/docutils/writers/s5_html/themes/default/pretty.css 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docutils/writers/s5_html/themes/default/pretty.css 2022-01-29 22:26:10 UTC (rev 8995)
@@ -41,7 +41,7 @@
html>body div#controls {position: fixed; padding: 0 0 1em 0; top: auto;}
div#controls form {position: absolute; bottom: 0; right: 0; width: 100%;
margin: 0; padding: 0;}
-#controls #navLinks a {padding: 0; margin: 0 0.5em;
+#controls #navLinks a {padding: 0; margin: 0 0.5em;
background: #005; border: none; color: #779; cursor: pointer;}
#controls #navList {height: 1em;}
#controls #navList #jumplist {position: absolute; bottom: 0; right: 0;
Modified: trunk/docutils/docutils/writers/s5_html/themes/default/s5-core.css
===================================================================
--- trunk/docutils/docutils/writers/s5_html/themes/default/s5-core.css 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docutils/writers/s5_html/themes/default/s5-core.css 2022-01-29 22:26:10 UTC (rev 8995)
@@ -3,7 +3,7 @@
The system will likely break if you do. */
div#header, div#footer, div#controls, .slide {position: absolute;}
-html>body div#header, html>body div#footer,
+html>body div#header, html>body div#footer,
html>body div#controls, html>body .slide {position: fixed;}
.handout {display: none;}
.layout {display: block;}
Modified: trunk/docutils/docutils/writers/s5_html/themes/default/slides.js
===================================================================
--- trunk/docutils/docutils/writers/s5_html/themes/default/slides.js 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docutils/writers/s5_html/themes/default/slides.js 2022-01-29 22:26:10 UTC (rev 8995)
@@ -66,7 +66,7 @@
var children = node.childNodes;
for (var i = 0; i < children.length; ++i) {
result += nodeValue(children[i]);
- }
+ }
}
else if (node.nodeType == 3) {
result = node.nodeValue;
@@ -118,8 +118,8 @@
cs = document.currentSlide;
footer = document.footer.childNodes;
}
- cs.innerHTML = '<span id="csHere">' + snum + '<\/span> ' +
- '<span id="csSep">\/<\/span> ' +
+ cs.innerHTML = '<span id="csHere">' + snum + '<\/span> ' +
+ '<span id="csSep">\/<\/span> ' +
'<span id="csTotal">' + (smax-1) + '<\/span>';
if (snum == 0) {
vis = 'hidden';
@@ -129,7 +129,7 @@
if (footer_nodes[i].nodeType == 1) {
footer_nodes[i].style.visibility = vis;
}
- }
+ }
}
function go(step) {
@@ -305,7 +305,7 @@
target = window.event.srcElement;
e = window.event;
} else target = e.target;
- if (target.href != null || hasValue(target.rel, 'external') || isParentOrSelf(target, 'controls') || isParentOrSelf(target,'embed') || isParentOrSelf(target, 'object')) return true;
+ if (target.href != null || hasValue(target.rel, 'external') || isParentOrSelf(target, 'controls') || isParentOrSelf(target,'embed') || isParentOrSelf(target, 'object')) return true;
if (!e.which || e.which == 1) {
if (!incrementals[snum] || incpos >= incrementals[snum].length) {
go(1);
@@ -466,7 +466,7 @@
function getIncrementals(obj) {
var incrementals = new Array();
- if (!obj)
+ if (!obj)
return incrementals;
var children = obj.childNodes;
for (var i = 0; i < children.length; i++) {
Modified: trunk/docutils/docutils/writers/s5_html/themes/medium-black/pretty.css
===================================================================
--- trunk/docutils/docutils/writers/s5_html/themes/medium-black/pretty.css 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docutils/writers/s5_html/themes/medium-black/pretty.css 2022-01-29 22:26:10 UTC (rev 8995)
@@ -19,7 +19,7 @@
.slide img.leader {display: block; margin: 0 auto;}
.slide tt {font-size: 90%;}
-div#footer {font-family: sans-serif; color: #AAA;
+div#footer {font-family: sans-serif; color: #AAA;
font-size: 0.5em; font-weight: bold; padding: 1em 0;}
#footer h1 {display: block; padding: 0 1em;}
#footer h2 {display: block; padding: 0.8em 1em 0;}
@@ -35,7 +35,7 @@
html>body div#controls {position: fixed; padding: 0 0 1em 0; top: auto;}
div#controls form {position: absolute; bottom: 0; right: 0; width: 100%;
margin: 0; padding: 0;}
-#controls #navLinks a {padding: 0; margin: 0 0.5em;
+#controls #navLinks a {padding: 0; margin: 0 0.5em;
border: none; color: #888; cursor: pointer;}
#controls #navList {height: 1em;}
#controls #navList #jumplist {position: absolute; bottom: 0; right: 0;
Modified: trunk/docutils/docutils/writers/s5_html/themes/medium-white/framing.css
===================================================================
--- trunk/docutils/docutils/writers/s5_html/themes/medium-white/framing.css 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docutils/writers/s5_html/themes/medium-white/framing.css 2022-01-29 22:26:10 UTC (rev 8995)
@@ -1,7 +1,7 @@
/* This file has been placed in the public domain. */
/* The following styles size, place, and layer the slide components.
Edit these if you want to change the overall slide layout.
- The commented lines can be uncommented (and modified, if necessary)
+ The commented lines can be uncommented (and modified, if necessary)
to help you with the rearrangement process. */
/* target = 1024x768 */
Modified: trunk/docutils/docutils/writers/s5_html/themes/medium-white/pretty.css
===================================================================
--- trunk/docutils/docutils/writers/s5_html/themes/medium-white/pretty.css 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docutils/writers/s5_html/themes/medium-white/pretty.css 2022-01-29 22:26:10 UTC (rev 8995)
@@ -19,7 +19,7 @@
.slide img.leader {display: block; margin: 0 auto;}
.slide tt {font-size: 90%;}
-div#footer {font-family: sans-serif; color: #444;
+div#footer {font-family: sans-serif; color: #444;
font-size: 0.5em; font-weight: bold; padding: 1em 0;}
#footer h1 {display: block; padding: 0 1em;}
#footer h2 {display: block; padding: 0.8em 1em 0;}
@@ -35,7 +35,7 @@
html>body div#controls {position: fixed; padding: 0 0 1em 0; top: auto;}
div#controls form {position: absolute; bottom: 0; right: 0; width: 100%;
margin: 0; padding: 0;}
-#controls #navLinks a {padding: 0; margin: 0 0.5em;
+#controls #navLinks a {padding: 0; margin: 0 0.5em;
border: none; color: #888; cursor: pointer;}
#controls #navList {height: 1em;}
#controls #navList #jumplist {position: absolute; bottom: 0; right: 0;
Modified: trunk/docutils/docutils/writers/s5_html/themes/small-black/pretty.css
===================================================================
--- trunk/docutils/docutils/writers/s5_html/themes/small-black/pretty.css 2022-01-29 16:28:17 UTC (rev 8994)
+++ trunk/docutils/docutils/writers/s5_html/themes/small-black/pretty.css 2022-01-29 22:26:10 UTC (rev 8995)
@@ -19,7 +19,7 @@
.slide img.leader {display: block; margin: 0 auto;}
.slide tt {font-size: 90%;}
-div#footer {font-family: sans-serif; color: #AAA;
+div#footer {font-family: sans-serif; color: #AAA;
font-size: 0.5em; font-weight: bold; padding: 1em 0;}
#footer h1 {display: block; padding: 0 1em;}
#footer h2 {display: block; padding: 0.8em 1em 0;}
@@ -35,7 +35,7 @@
html>body div#controls {position: fixed; padding: 0 0 1em 0; top: auto;}
div#controls form {pos...
[truncated message content] |
|
From: <mi...@us...> - 2022-02-03 18:03:49
|
Revision: 8997
http://sourceforge.net/p/docutils/code/8997
Author: milde
Date: 2022-02-03 18:03:47 +0000 (Thu, 03 Feb 2022)
Log Message:
-----------
Fix FilterMessages transform [bug:#435].
The "Messages" transform no longer tests for to-be-ignored messages
but inserts all `system-messages` without parent into a
"System Messages" section.
This allows the "FilterMessages" transform to find and convert
matching `problematic` nodes (but now it also has to remove the
"System Messages" section if empty).
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/transforms/universal.py
Added Paths:
-----------
trunk/docutils/test/test_transforms/test_filter_messages.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2022-02-03 14:13:03 UTC (rev 8996)
+++ trunk/docutils/HISTORY.txt 2022-02-03 18:03:47 UTC (rev 8997)
@@ -49,6 +49,10 @@
- Don't use mutable default values for function arguments. Fixes bug #430.
+* docutils/transforms/universal.py
+
+ - Fix bug 435: invalid references in `problematic` nodes with report_level=4.
+
* docutils/utils/__init__.py
- decode_path() returns `str` instance instead of `nodes.reprunicode`.
@@ -69,7 +73,7 @@
* test/DocutilsTestSupport.py
- - exception_data() returns None if no exception was raised.
+ - exception_data() now returns None if no exception was raised.
- recommonmark_wrapper only imported if upstream parser is present.
* test/test_parsers/test_rst/test_directives/test_tables.py
Modified: trunk/docutils/docutils/transforms/universal.py
===================================================================
--- trunk/docutils/docutils/transforms/universal.py 2022-02-03 14:13:03 UTC (rev 8996)
+++ trunk/docutils/docutils/transforms/universal.py 2022-02-03 18:03:47 UTC (rev 8997)
@@ -121,11 +121,7 @@
def apply(self):
unfiltered = self.document.transform_messages
- threshold = self.document.reporter.report_level
- messages = []
- for msg in unfiltered:
- if msg['level'] >= threshold and not msg.parent:
- messages.append(msg)
+ messages = [msg for msg in unfiltered if not msg.parent]
if messages:
section = nodes.section(classes=['system-messages'])
# @@@ get this from the language module?
@@ -145,6 +141,9 @@
"""
Remove system messages below verbosity threshold.
+
+ Convert <problematic> nodes referencing removed messages to <Text>.
+ Remove "System Messages" section if empty.
"""
default_priority = 870
@@ -153,6 +152,16 @@
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
+ del(self.document.ids[node['ids'][0]])
+ except (IndexError):
+ pass
+ for node in tuple(self.document.findall(nodes.problematic)):
+ if node['refid'] not in self.document.ids:
+ node.parent.replace(node, nodes.Text(node.astext()))
+ for node in self.document.findall(nodes.section):
+ if "system-messages" in node['classes'] and len(node) == 1:
+ node.parent.remove(node)
class TestMessages(Transform):
Added: trunk/docutils/test/test_transforms/test_filter_messages.py
===================================================================
--- trunk/docutils/test/test_transforms/test_filter_messages.py (rev 0)
+++ trunk/docutils/test/test_transforms/test_filter_messages.py 2022-02-03 18:03:47 UTC (rev 8997)
@@ -0,0 +1,75 @@
+#!/usr/bin/env python3
+
+# $Id$
+# :Copyright: © 2021 Günter Milde.
+# :Maintainer: doc...@li...
+# :License: Released under the terms of the `2-Clause BSD license`_, in short:
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.
+# This file is offered as-is, without any warranty.
+#
+# .. _2-Clause BSD license: https://opensource.org/licenses/BSD-2-Clause
+
+"""
+Tests for docutils.transforms.universal.FilterMessages.
+"""
+
+if __name__ == '__main__':
+ import __init__
+from test_transforms import DocutilsTestSupport
+from docutils.transforms.universal import Messages, FilterMessages
+from docutils.transforms.references import Substitutions
+from docutils.parsers.rst import Parser
+
+
+def suite():
+ parser = Parser()
+ settings = {'report_level': 5} # filter all system messages
+ s = DocutilsTestSupport.TransformTestSuite(
+ parser, suite_settings=settings)
+ s.generateTests(totest)
+ return s
+
+totest = {}
+
+totest['system_message_sections'] = ((Substitutions, Messages, FilterMessages), [
+["""\
+.. unknown-directive:: block markup is filtered without trace.
+""",
+"""\
+<document source="test data">
+"""],
+["""\
+Invalid *inline markup is restored to text.
+""",
+"""\
+<document source="test data">
+ <paragraph>
+ Invalid \n\
+ *
+ inline markup is restored to text.
+"""],
+["""\
+This |unknown substitution| will generate a system message, thanks to
+the "Substitutions" transform. The "Messages" transform will
+generate a "System Messages" section and the "FilterMessages" transform
+will remove it.
+""",
+"""\
+<document source="test data">
+ <paragraph>
+ This \n\
+ |unknown substitution|
+ will generate a system message, thanks to
+ the "Substitutions" transform. The "Messages" transform will
+ generate a "System Messages" section and the "FilterMessages" transform
+ will remove it.
+"""],
+])
+
+
+if __name__ == '__main__':
+ import unittest
+ unittest.main(defaultTest='suite')
Property changes on: trunk/docutils/test/test_transforms/test_filter_messages.py
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-02-05 14:12:52
|
Revision: 8999
http://sourceforge.net/p/docutils/code/8999
Author: milde
Date: 2022-02-05 14:12:49 +0000 (Sat, 05 Feb 2022)
Log Message:
-----------
Clean up docutils.frontend before the switch to arparse.
Mark as provisional.
Import the configparser module, not its objects.
Use super()
Add deprecation notices and documentation.
OptionParser.get_standard_config_files()
decorate as class function
simplify
OptionParser.get_config_file_settings():
rename the ConfigParser instance to avoid ambiguity
adapt to changes in ConfigParser.read()
ConfigParser
Use mapping interface.
ConfigParser.read()
* simplify:
- configparser.ConfigParser.read() supports an `encoding` parameter
since Python 3.2.
- use isinstance()
* make upstream-compatible:
- make the `option_parser` parameter optional
- return list of actually parsed files (instead of saving as attribute)
ConfigParser.get_section()
It is Easier to Ask for Forgiveness than Permission
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/frontend.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2022-02-05 14:12:41 UTC (rev 8998)
+++ trunk/docutils/HISTORY.txt 2022-02-05 14:12:49 UTC (rev 8999)
@@ -122,6 +122,10 @@
Release 0.18 (2021-10-26)
=========================
+* docutils/frontend.py
+ - mark as provisional (will switch from using "optparse" to "argparse").
+ - remove hack for the now obsolete "mod_python" Apache module.
+
* docutils/nodes.py
- Don't change a list while looping over it (in
Modified: trunk/docutils/docutils/frontend.py
===================================================================
--- trunk/docutils/docutils/frontend.py 2022-02-05 14:12:41 UTC (rev 8998)
+++ trunk/docutils/docutils/frontend.py 2022-02-05 14:12:49 UTC (rev 8999)
@@ -5,6 +5,13 @@
"""
Command-line and common processing for Docutils front-end tools.
+This module is provisional.
+Major changes will happen with the switch from the deprecated
+"optparse" module to "arparse".
+
+Applications should use the high-level API provided by `docutils.core`.
+See https://docutils.sourceforge.io/docs/api/runtime-settings.html.
+
Exports the following classes:
* `OptionParser`: Standard Docutils command-line processing.
@@ -31,7 +38,7 @@
import codecs
-from configparser import RawConfigParser
+import configparser
import optparse
from optparse import SUPPRESS_HELP
import os
@@ -308,7 +315,7 @@
def update(self, other_dict, option_parser):
if isinstance(other_dict, Values):
other_dict = other_dict.__dict__
- other_dict = other_dict.copy()
+ 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)
@@ -339,7 +346,7 @@
evaluate the 'overrides' option.
Extends `optparse.Option.process`.
"""
- result = optparse.Option.process(self, opt, value, values, parser)
+ result = super().process(opt, value, values, parser)
setting = self.dest
if setting:
if self.validator:
@@ -365,7 +372,7 @@
Common settings (defined below) and component-specific settings must not
conflict. Short options are reserved for common settings, and components
- are restrict to using long options.
+ are restricted to using long options.
"""
standard_config_files = [
@@ -598,15 +605,15 @@
self.version = self.version_template
# Make an instance copy (it will be modified):
self.relative_path_settings = list(self.relative_path_settings)
- self.components = (self,) + tuple(components)
+ self.components = (self, *components)
self.populate_from_components(self.components)
- self.set_defaults_from_dict(defaults or {})
+ self.defaults.update(defaults or {})
if read_config_files and not self.defaults['_disable_config']:
try:
config_settings = self.get_standard_config_settings()
except ValueError as err:
self.error(err)
- self.set_defaults_from_dict(config_settings.__dict__)
+ self.defaults.update(config_settings.__dict__)
def populate_from_components(self, components):
"""
@@ -639,26 +646,15 @@
if component and component.settings_default_overrides:
self.defaults.update(component.settings_default_overrides)
- def get_standard_config_files(self):
+ @classmethod
+ def get_standard_config_files(cls):
"""Return list of config files, from environment or standard."""
try:
config_files = os.environ['DOCUTILSCONFIG'].split(os.pathsep)
except KeyError:
- config_files = self.standard_config_files
+ config_files = cls.standard_config_files
+ return [os.path.expanduser(f) for f in config_files if f.strip()]
- # If 'HOME' is not set, expandvars() requires the 'pwd' module which is
- # not available under certain environments, for example, within
- # mod_python. The publisher ends up in here, and we need to publish
- # from within mod_python. Therefore we need to avoid expanding when we
- # are in those environments.
- expand = os.path.expanduser
- if 'HOME' not in os.environ:
- try:
- import pwd
- except ImportError:
- expand = lambda x: x
- return [expand(f) for f in config_files if f.strip()]
-
def get_standard_config_settings(self):
settings = Values()
for filename in self.get_standard_config_files():
@@ -667,9 +663,9 @@
def get_config_file_settings(self, config_file):
"""Returns a dictionary containing appropriate config file settings."""
- parser = ConfigParser()
- parser.read(config_file, self)
- self.config_files.extend(parser._files)
+ config_parser = ConfigParser()
+ # parse config file, add filename if found and successfull read.
+ self.config_files += config_parser.read(config_file, self)
base_path = os.path.dirname(config_file)
applied = set()
settings = Values()
@@ -681,7 +677,7 @@
if section in applied:
continue
applied.add(section)
- settings.update(parser.get_section(section), self)
+ settings.update(config_parser.get_section(section), self)
make_paths_absolute(
settings.__dict__, self.relative_path_settings, base_path)
return settings.__dict__
@@ -711,6 +707,7 @@
return source, destination
def set_defaults_from_dict(self, defaults):
+ # not used, deprecated, will be removed
self.defaults.update(defaults)
def get_default_values(self):
@@ -736,14 +733,26 @@
raise KeyError('No option with dest == %r.' % dest)
-class ConfigParser(RawConfigParser):
+class ConfigParser(configparser.RawConfigParser):
+ """Parser for Docutils configuration files.
+ See https://docutils.sourceforge.io/docs/user/config.html.
+
+ Option key normalization includes conversion of '-' to '_'.
+
+ Config file encoding is "utf-8". Encoding errors are reported
+ and the affected file(s) skipped.
+
+ This class is provisional and will change in future versions.
+ """
+
old_settings = {
'pep_stylesheet': ('pep_html writer', 'stylesheet'),
'pep_stylesheet_path': ('pep_html writer', 'stylesheet_path'),
'pep_template': ('pep_html writer', 'template')}
"""{old setting: (new section, new setting)} mapping, used by
- `handle_old_config`, to convert settings from the old [options] section."""
+ `handle_old_config`, to convert settings from the old [options] section.
+ """
old_warning = """
The "[option]" section is deprecated. Support for old-format configuration
@@ -757,34 +766,29 @@
Skipping "%s" configuration file.
"""
- def __init__(self, *args, **kwargs):
- RawConfigParser.__init__(self, *args, **kwargs)
-
- self._files = []
- """List of paths of configuration files read."""
-
- self._stderr = io.ErrorOutput()
- """Wrapper around sys.stderr catching en-/decoding errors"""
-
- def read(self, filenames, option_parser):
- if type(filenames) == str:
+ def read(self, filenames, option_parser=None):
+ # Currently, if a `docutils.frontend.OptionParser` instance is
+ # supplied, setting values are validated.
+ if option_parser is not None:
+ warnings.warn('frontend.ConfigParser.read(): parameter '
+ '"option_parser" will be removed '
+ 'in Docutils 0.21 or later.',
+ PendingDeprecationWarning, stacklevel=2)
+ read_ok = []
+ if isinstance(filenames, str):
filenames = [filenames]
for filename in filenames:
+ # Config files are UTF-8-encoded:
try:
- # Config files are UTF-8-encoded:
- with open(filename, encoding='utf-8') as fp:
- try:
- RawConfigParser.read_file(self, fp, filename)
- except UnicodeDecodeError:
- self._stderr.write(self.not_utf8_error
- % (filename, filename))
- continue
- except OSError:
+ read_ok += super().read(filename, encoding='utf-8')
+ except UnicodeDecodeError:
+ sys.stderr.write(self.not_utf8_error % (filename, filename))
continue
- self._files.append(filename)
- if self.has_section('options'):
+ if 'options' in self:
self.handle_old_config(filename)
- self.validate_settings(filename, option_parser)
+ if option_parser is not None:
+ self.validate_settings(filename, option_parser)
+ return read_ok
def handle_old_config(self, filename):
warnings.warn_explicit(self.old_warning, ConfigDeprecationWarning,
@@ -834,21 +838,28 @@
def optionxform(self, optionstr):
"""
- Transform '-' to '_' so the cmdline form of option names can be used.
+ Lowercase and transform '-' to '_'.
+
+ So the cmdline form of option names can be used in config files.
"""
return optionstr.lower().replace('-', '_')
def get_section(self, section):
"""
- Return a given section as a dictionary (empty if the section
- doesn't exist).
+ Return a given section as a dictionary.
+
+ Return empty dictionary if the section doesn't exist.
+
+ Deprecated. Use the configparser "Mapping Protocol Access" and
+ catch KeyError.
"""
- section_dict = {}
- if self.has_section(section):
- for option in self.options(section):
- section_dict[option] = self.get(section, option)
- return section_dict
+ warnings.warn('frontend.OptionParser.get_section() '
+ 'will be removed in Docutils 0.22 or later.',
+ PendingDeprecationWarning, stacklevel=2)
+ try:
+ return dict(self[section])
+ except KeyError:
+ return {}
-
class ConfigDeprecationWarning(FutureWarning):
"""Warning for deprecated configuration file features."""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-02-10 09:10:29
|
Revision: 9006
http://sourceforge.net/p/docutils/code/9006
Author: milde
Date: 2022-02-10 09:10:25 +0000 (Thu, 10 Feb 2022)
Log Message:
-----------
More detailled import error for missing components.
Modified Paths:
--------------
trunk/docutils/docutils/parsers/__init__.py
trunk/docutils/docutils/readers/__init__.py
trunk/docutils/docutils/writers/__init__.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_include.py
Modified: trunk/docutils/docutils/parsers/__init__.py
===================================================================
--- trunk/docutils/docutils/parsers/__init__.py 2022-02-10 09:10:03 UTC (rev 9005)
+++ trunk/docutils/docutils/parsers/__init__.py 2022-02-10 09:10:25 UTC (rev 9006)
@@ -75,7 +75,7 @@
# 3rd-party Markdown parsers
'recommonmark': 'docutils.parsers.recommonmark_wrapper',
'myst': 'myst_parser.docutils_',
- # 'myst': 'docutils.parsers.myst_wrapper',
+ #'pycmark': works out of the box
# TODO: the following two could be either of the above
'commonmark': 'docutils.parsers.recommonmark_wrapper',
'markdown': 'docutils.parsers.recommonmark_wrapper',
@@ -83,9 +83,9 @@
def get_parser_class(parser_name):
"""Return the Parser class from the `parser_name` module."""
- parser_name = parser_name.lower()
+ name = parser_name.lower()
try:
- module = import_module(_parser_aliases.get(parser_name, parser_name))
+ module = import_module(_parser_aliases.get(name, name))
except ImportError as err:
- raise ImportError('Parser "%s" missing. %s' % (parser_name, err))
+ raise ImportError(f'Parser "{parser_name}" not found. {err}')
return module.Parser
Modified: trunk/docutils/docutils/readers/__init__.py
===================================================================
--- trunk/docutils/docutils/readers/__init__.py 2022-02-10 09:10:03 UTC (rev 9005)
+++ trunk/docutils/docutils/readers/__init__.py 2022-02-10 09:10:25 UTC (rev 9006)
@@ -101,11 +101,13 @@
def get_reader_class(reader_name):
"""Return the Reader class from the `reader_name` module."""
- reader_name = reader_name.lower()
- if reader_name in _reader_aliases:
- reader_name = _reader_aliases[reader_name]
+ name = reader_name.lower()
+ name = _reader_aliases.get(name, name)
try:
- module = import_module('docutils.readers.'+reader_name)
+ module = import_module('docutils.readers.'+name)
except ImportError:
- module = import_module(reader_name)
+ try:
+ module = import_module(name)
+ except ImportError as err:
+ raise ImportError(f'Reader "{reader_name}" not found. {err}')
return module.Reader
Modified: trunk/docutils/docutils/writers/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/__init__.py 2022-02-10 09:10:03 UTC (rev 9005)
+++ trunk/docutils/docutils/writers/__init__.py 2022-02-10 09:10:25 UTC (rev 9006)
@@ -138,14 +138,13 @@
def get_writer_class(writer_name):
"""Return the Writer class from the `writer_name` module."""
- writer_name = writer_name.lower()
- if writer_name in _writer_aliases:
- writer_name = _writer_aliases[writer_name]
+ name = writer_name.lower()
+ name = _writer_aliases.get(name, name)
try:
- module = import_module('docutils.writers.'+writer_name)
+ module = import_module('docutils.writers.'+name)
except ImportError:
try:
- module = import_module(writer_name)
+ module = import_module(name)
except ImportError as err:
- raise ImportError('No writer named "%s".' % writer_name)
+ raise ImportError(f'Writer "{writer_name}" not found. {err}')
return module.Writer
Modified: trunk/docutils/test/test_parsers/test_rst/test_directives/test_include.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_directives/test_include.py 2022-02-10 09:10:03 UTC (rev 9005)
+++ trunk/docutils/test/test_parsers/test_rst/test_directives/test_include.py 2022-02-10 09:10:25 UTC (rev 9006)
@@ -207,7 +207,7 @@
<paragraph>
Error in "include" directive:
invalid option value: (option: "parser"; value: \'sillyformat\')
- Parser "sillyformat" missing. No module named 'sillyformat'.
+ Parser "sillyformat" not found. No module named 'sillyformat'.
<literal_block xml:space="preserve">
.. include:: test_parsers/test_rst/test_directives/include1.txt
:parser: sillyformat
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-02-19 23:32:45
|
Revision: 9009
http://sourceforge.net/p/docutils/code/9009
Author: milde
Date: 2022-02-19 23:32:41 +0000 (Sat, 19 Feb 2022)
Log Message:
-----------
Write table column widths with 3 digits precision. Fixes bug #444.
Bug #444 reports visible effects of rounding errors with the current
rounding to integer percentages (e.g. 7 columns 13% and one 9% for
8 columns of equal width).
Allow a fractional part (1 digit) when table column widths are
written as percentages in the "colgroup".
Use f-string literal to format coefficient as percentage.
CSS allows decimal numbers (since CSS1) in the specification
of percentages.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/test/functional/expected/standalone_rst_html5.html
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2022-02-11 14:47:51 UTC (rev 9008)
+++ trunk/docutils/HISTORY.txt 2022-02-19 23:32:41 UTC (rev 9009)
@@ -66,6 +66,7 @@
* docutils/writers/_html_base.py
- Add 'html writers' to `config_section_dependencies`. Fixes bug #443.
+ - Write table column widths with 3 digits precision. Fixes bug #444.
* docutils/writers/pep_html/
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2022-02-11 14:47:51 UTC (rev 9008)
+++ trunk/docutils/docutils/writers/_html_base.py 2022-02-19 23:32:41 UTC (rev 9009)
@@ -679,12 +679,12 @@
'colwidths-grid' not in self.settings.table_style
and 'colwidths-given' not in node.parent.parent['classes']):
return
+ self.body.append(self.starttag(node, 'colgroup'))
total_width = sum(node['colwidth'] for node in self.colspecs)
- self.body.append(self.starttag(node, 'colgroup'))
for node in self.colspecs:
- colwidth = int(node['colwidth'] * 100.0 / total_width + 0.5)
+ colwidth = node['colwidth'] / total_width
self.body.append(self.emptytag(node, 'col',
- style='width: %i%%' % colwidth))
+ style=f'width: {colwidth:.1%}'))
self.body.append('</colgroup>\n')
def visit_comment(self, node,
Modified: trunk/docutils/test/functional/expected/standalone_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/standalone_rst_html5.html 2022-02-11 14:47:51 UTC (rev 9008)
+++ trunk/docutils/test/functional/expected/standalone_rst_html5.html 2022-02-19 23:32:41 UTC (rev 9009)
@@ -1169,9 +1169,9 @@
<table class="test" style="width: 95%;">
<caption>list table with integral header</caption>
<colgroup>
-<col style="width: 26%" />
-<col style="width: 21%" />
-<col style="width: 53%" />
+<col style="width: 26.3%" />
+<col style="width: 21.1%" />
+<col style="width: 52.6%" />
</colgroup>
<thead>
<tr><th class="head stub"><p>Treat</p></th>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-03-03 22:15:03
|
Revision: 9015
http://sourceforge.net/p/docutils/code/9015
Author: milde
Date: 2022-03-03 22:15:00 +0000 (Thu, 03 Mar 2022)
Log Message:
-----------
Fix whitespace before/after delimiters and colon.
Flake rules
E201 whitespace after '('
E202 whitespace before '}'
E203 whitespace before ':'
E211 whitespace before '('
Exception: : as binary operator in extended slices
(cf. https://www.python.org/dev/peps/pep-0008/#pet-peeves).
Modified Paths:
--------------
trunk/docutils/docutils/languages/he.py
trunk/docutils/docutils/languages/sv.py
trunk/docutils/docutils/parsers/rst/languages/he.py
trunk/docutils/docutils/parsers/rst/states.py
trunk/docutils/docutils/statemachine.py
trunk/docutils/docutils/transforms/parts.py
trunk/docutils/docutils/utils/math/math2html.py
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/docutils/writers/html4css1/__init__.py
trunk/docutils/docutils/writers/latex2e/__init__.py
trunk/docutils/docutils/writers/odf_odt/__init__.py
trunk/docutils/docutils/writers/odf_odt/pygmentsformatter.py
trunk/docutils/docutils/writers/s5_html/__init__.py
trunk/docutils/test/test_parsers/test_rst/test_tables.py
trunk/docutils/test/test_settings.py
trunk/docutils/test/test_transforms/test_doctitle.py
trunk/docutils/test/test_writers/test_html4css1_parts.py
trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
trunk/docutils/tools/quicktest.py
trunk/docutils/tools/test/test_buildhtml.py
trunk/docutils/tox.ini
Modified: trunk/docutils/docutils/languages/he.py
===================================================================
--- trunk/docutils/docutils/languages/he.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/docutils/languages/he.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -30,7 +30,7 @@
'attention': '\u05ea\u05e9\u05d5\u05de\u05ea \u05dc\u05d1',
'caution': '\u05d6\u05d4\u05d9\u05e8\u05d5\u05ea',
'danger': '\u05e1\u05db\u05e0\u05d4',
- 'error': '\u05e9\u05d2\u05d9\u05d0\u05d4' ,
+ 'error': '\u05e9\u05d2\u05d9\u05d0\u05d4',
'hint': '\u05e8\u05de\u05d6',
'important': '\u05d7\u05e9\u05d5\u05d1',
'note': '\u05d4\u05e2\u05e8\u05d4',
Modified: trunk/docutils/docutils/languages/sv.py
===================================================================
--- trunk/docutils/docutils/languages/sv.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/docutils/languages/sv.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -35,7 +35,7 @@
'note': 'Notera',
'tip': 'Tips',
'warning': 'Varning',
- 'contents': 'Innehåll' }
+ 'contents': 'Innehåll'}
"""Mapping of node class name to label text."""
bibliographic_fields = {
@@ -51,7 +51,7 @@
'datum': 'date',
'copyright': 'copyright',
'dedikation': 'dedication',
- 'sammanfattning': 'abstract' }
+ 'sammanfattning': 'abstract'}
"""Swedish (lowcased) to canonical name mapping for bibliographic fields."""
author_separators = [';', ',']
Modified: trunk/docutils/docutils/parsers/rst/languages/he.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/he.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/docutils/parsers/rst/languages/he.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -21,7 +21,7 @@
'\u05d6\u05d4\u05d9\u05e8\u05d5\u05ea': 'caution',
'code (translation required)': 'code',
'\u05e1\u05db\u05e0\u05d4': 'danger',
- '\u05e9\u05d2\u05d9\u05d0\u05d4' : 'error',
+ '\u05e9\u05d2\u05d9\u05d0\u05d4': 'error',
'\u05e8\u05de\u05d6': 'hint',
'\u05d7\u05e9\u05d5\u05d1': 'important',
'\u05d4\u05e2\u05e8\u05d4': 'note',
Modified: trunk/docutils/docutils/parsers/rst/states.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/states.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/docutils/parsers/rst/states.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -1356,8 +1356,8 @@
break # yes; keep `format`
else: # shouldn't happen
raise ParserError('enumerator format not matched')
- text = groupdict[format][self.enum.formatinfo[format].start
- :self.enum.formatinfo[format].end]
+ text = groupdict[format][self.enum.formatinfo[format].start # noqa: E203
+ : self.enum.formatinfo[format].end]
if text == '#':
sequence = '#'
elif expected_sequence:
@@ -1408,8 +1408,8 @@
if result:
next_enumerator, auto_enumerator = result
try:
- if ( next_line.startswith(next_enumerator) or
- next_line.startswith(auto_enumerator) ):
+ if (next_line.startswith(next_enumerator)
+ or next_line.startswith(auto_enumerator)):
return 1
except TypeError:
pass
@@ -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])
+ initial_line_offset : self.state_machine.line_offset + 1]) # noqa: E203
try:
arguments, options, content, content_offset = (
self.parse_directive_block(indented, line_offset,
@@ -2554,11 +2554,11 @@
"""Enumerated list item."""
format, sequence, text, ordinal = self.parse_enumerator(
match, self.parent['enumtype'])
- if ( format != self.format
- or (sequence != '#' and (sequence != self.parent['enumtype']
- or self.auto
- or ordinal != (self.lastordinal + 1)))
- or not self.is_enumerated_list_item(ordinal, sequence, format)):
+ if (format != self.format
+ or (sequence != '#' and (sequence != self.parent['enumtype']
+ or self.auto
+ or ordinal != (self.lastordinal + 1)))
+ or not self.is_enumerated_list_item(ordinal, sequence, format)):
# different enumeration: new list
self.invalid_input()
if sequence == '#':
Modified: trunk/docutils/docutils/statemachine.py
===================================================================
--- trunk/docutils/docutils/statemachine.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/docutils/statemachine.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -1144,8 +1144,9 @@
self.items[i.start:i.stop] = item.items
assert len(self.data) == len(self.items), 'data mismatch'
if self.parent:
- self.parent[(i.start or 0) + self.parent_offset
- : (i.stop or len(self)) + self.parent_offset] = item
+ k = (i.start or 0) + self.parent_offset
+ l = (i.stop or len(self)) + self.parent_offset
+ self.parent[k:l] = item
else:
self.data[i] = item
if self.parent:
@@ -1162,8 +1163,9 @@
del self.data[i.start:i.stop]
del self.items[i.start:i.stop]
if self.parent:
- del self.parent[(i.start or 0) + self.parent_offset
- : (i.stop or len(self)) + self.parent_offset]
+ k = (i.start or 0) + self.parent_offset
+ l = (i.stop or len(self)) + self.parent_offset
+ del self.parent[k:l]
def __add__(self, other):
if isinstance(other, ViewList):
Modified: trunk/docutils/docutils/transforms/parts.py
===================================================================
--- trunk/docutils/docutils/transforms/parts.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/docutils/transforms/parts.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -128,8 +128,8 @@
suggested_prefix='toc-entry')
entry = nodes.paragraph('', '', reference)
item = nodes.list_item('', entry)
- if ( self.backlinks in ('entry', 'top')
- and title.next_node(nodes.reference) is None):
+ if (self.backlinks in ('entry', 'top')
+ and title.next_node(nodes.reference) is None):
if self.backlinks == 'entry':
title['refid'] = ref_id
elif self.backlinks == 'top':
Modified: trunk/docutils/docutils/utils/math/math2html.py
===================================================================
--- trunk/docutils/docutils/utils/math/math2html.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/docutils/utils/math/math2html.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -1301,7 +1301,7 @@
"Extract the next string of the given length, or None if not enough text."
if self.pos + length > len(self.text):
return None
- return self.text[self.pos : self.pos + length]
+ return self.text[self.pos : self.pos + length] # noqa: E203
class Container:
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/docutils/writers/_html_base.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -1414,8 +1414,8 @@
atts = {'class': 'reference'}
if 'refuri' in node:
atts['href'] = node['refuri']
- if ( self.settings.cloak_email_addresses
- and atts['href'].startswith('mailto:')):
+ if (self.settings.cloak_email_addresses
+ and atts['href'].startswith('mailto:')):
atts['href'] = self.cloak_mailto(atts['href'])
self.in_mailto = True
atts['class'] += ' external'
Modified: trunk/docutils/docutils/writers/html4css1/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html4css1/__init__.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/docutils/writers/html4css1/__init__.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -458,8 +458,8 @@
atts['class'] = 'docinfo-name'
else:
atts['class'] = 'field-name'
- if ( self.settings.field_name_limit
- and len(node.astext()) > self.settings.field_name_limit):
+ if (self.settings.field_name_limit
+ and len(node.astext()) > self.settings.field_name_limit):
atts['colspan'] = 2
self.context.append('</tr>\n'
+ self.starttag(node.parent, 'tr', '',
@@ -674,8 +674,8 @@
# use table for option list
def visit_option_group(self, node):
atts = {}
- if ( self.settings.option_limit
- and len(node.astext()) > self.settings.option_limit):
+ if (self.settings.option_limit
+ and len(node.astext()) > self.settings.option_limit):
atts['colspan'] = 2
self.context.append('</tr>\n<tr><td> </td>')
else:
@@ -733,9 +733,9 @@
return False
parent_length = len([n for n in node.parent if not isinstance(
n, (nodes.Invisible, nodes.label))])
- if ( self.compact_simple
- or self.compact_field_list
- or self.compact_p and parent_length == 1):
+ if (self.compact_simple
+ or self.compact_field_list
+ or self.compact_p and parent_length == 1):
return True
return False
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -3054,7 +3054,7 @@
pass
_thead_depth = 0
- def thead_depth (self):
+ def thead_depth(self):
return self._thead_depth
def visit_thead(self, node):
Modified: trunk/docutils/docutils/writers/odf_odt/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/odf_odt/__init__.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/docutils/writers/odf_odt/__init__.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -2840,11 +2840,11 @@
self.in_paragraph = False
self.set_to_parent()
if self.in_header:
- self.header_content.append( self.current_element[-1] )
- self.current_element.remove( self.current_element[-1] )
+ self.header_content.append(self.current_element[-1])
+ self.current_element.remove(self.current_element[-1])
elif self.in_footer:
- self.footer_content.append( self.current_element[-1] )
- self.current_element.remove( self.current_element[-1] )
+ self.footer_content.append(self.current_element[-1])
+ self.current_element.remove(self.current_element[-1])
def visit_problematic(self, node):
pass
Modified: trunk/docutils/docutils/writers/odf_odt/pygmentsformatter.py
===================================================================
--- trunk/docutils/docutils/writers/odf_odt/pygmentsformatter.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/docutils/writers/odf_odt/pygmentsformatter.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -19,7 +19,7 @@
self.rststyle_function = rststyle_function
self.escape_function = escape_function
- def rststyle(self, name, parameters=( )):
+ def rststyle(self, name, parameters=()):
return self.rststyle_function(name, parameters)
Modified: trunk/docutils/docutils/writers/s5_html/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/s5_html/__init__.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/docutils/writers/s5_html/__init__.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -207,8 +207,8 @@
for f in os.listdir(path): # copy all files from each theme
if f == self.base_theme_file:
continue # ... except the "__base__" file
- if ( self.copy_file(f, path, dest)
- and f in self.required_theme_files):
+ if (self.copy_file(f, path, dest)
+ and f in self.required_theme_files):
required_files_copied[f] = 1
if default:
break # "default" theme has no base theme
Modified: trunk/docutils/test/test_parsers/test_rst/test_tables.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_tables.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/test/test_parsers/test_rst/test_tables.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -571,7 +571,7 @@
| (The first cell of this table may expand |
| to accommodate long filesystem paths.) |
+------------------------------------------------------------------------------+
-""") % ('\n'.join('| %-70s |' % include2[part * 70 : (part + 1) * 70]
+""") % ('\n'.join('| %-70s |' % include2[part * 70 : (part + 1) * 70] # noqa: E203
for part in range(len(include2) // 70 + 1))),
"""\
<document source="test data">
@@ -606,7 +606,7 @@
Something afterwards.
And more.
-""") % ('\n'.join('| %-70s |' % include2[part * 70 : (part + 1) * 70]
+""") % ('\n'.join('| %-70s |' % include2[part * 70 : (part + 1) * 70] # noqa: E203
for part in range(len(include2) // 70 + 1))),
"""\
<document source="test data">
@@ -1274,7 +1274,7 @@
Note The first row of this table may expand
to accommodate long filesystem paths.
========= =====================================================================
-""" % ('\n'.join(' %-65s' % include2[part * 65 : (part + 1) * 65]
+""" % ('\n'.join(' %-65s' % include2[part * 65 : (part + 1) * 65] # noqa: E203
for part in range(len(include2) // 65 + 1))),
"""\
<document source="test data">
Modified: trunk/docutils/test/test_settings.py
===================================================================
--- trunk/docutils/test/test_settings.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/test/test_settings.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -272,15 +272,15 @@
self.assertEqual(pathdict['spam'], 'spam')
boolean_settings = (
- (True, True ),
- ('1', True ),
- ('on', True ),
- ('yes', True ),
- ('true', True ),
- ('0', False ),
- ('off', False ),
- ('no', False ),
- ('false', False ),
+ (True, True),
+ ('1', True),
+ ('on', True),
+ ('yes', True),
+ ('true', True),
+ ('0', False),
+ ('off', False),
+ ('no', False),
+ ('false', False),
)
def test_validate_boolean(self):
for t in self.boolean_settings:
@@ -300,10 +300,10 @@
def test_validate_colon_separated_string_list(self):
tests = (
- ('a', ['a',] ),
- ('a:b', ['a', 'b'] ),
- (['a',], ['a',] ),
- (['a', 'b:c'], ['a', 'b', 'c'] ),
+ ('a', ['a',]),
+ ('a:b', ['a', 'b']),
+ (['a',], ['a',]),
+ (['a', 'b:c'], ['a', 'b', 'c']),
)
for t in tests:
self.assertEqual(
@@ -312,10 +312,10 @@
def test_validate_comma_separated_list(self):
tests = (
- ('a', ['a',] ),
- ('a,b', ['a', 'b'] ),
- (['a',], ['a',] ),
- (['a', 'b,c'], ['a', 'b', 'c'] ),
+ ('a', ['a',]),
+ ('a,b', ['a', 'b']),
+ (['a',], ['a',]),
+ (['a', 'b,c'], ['a', 'b', 'c']),
)
for t in tests:
self.assertEqual(
@@ -324,10 +324,10 @@
def test_validate_url_trailing_slash(self):
tests = (
- ('', './' ),
- (None, './' ),
- ('http://example.org', 'http://example.org/' ),
- ('http://example.org/', 'http://example.org/' ),
+ ('', './'),
+ (None, './'),
+ ('http://example.org', 'http://example.org/'),
+ ('http://example.org/', 'http://example.org/'),
)
for t in tests:
self.assertEqual(
Modified: trunk/docutils/test/test_transforms/test_doctitle.py
===================================================================
--- trunk/docutils/test/test_transforms/test_doctitle.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/test/test_transforms/test_doctitle.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -21,7 +21,7 @@
required_arguments = 0
optional_arguments = 0
final_argument_whitespace = True
- option_spec = { }
+ option_spec = {}
has_content = False
def run(self):
Modified: trunk/docutils/test/test_writers/test_html4css1_parts.py
===================================================================
--- trunk/docutils/test/test_writers/test_html4css1_parts.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/test/test_writers/test_html4css1_parts.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -197,7 +197,7 @@
"""]
])
-totest['No title promotion'] = ({'doctitle_xform' : 0,
+totest['No title promotion'] = ({'doctitle_xform': 0,
'stylesheet_path': '',
'embed_stylesheet': 0}, [
["""\
Modified: trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
===================================================================
--- trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/test/test_writers/test_html5_polyglot_parts.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -205,7 +205,7 @@
"""]
])
-totest['No title promotion'] = ({'doctitle_xform' : 0,
+totest['No title promotion'] = ({'doctitle_xform': 0,
'stylesheet_path': '',
'embed_stylesheet': 0}, [
["""\
Modified: trunk/docutils/tools/quicktest.py
===================================================================
--- trunk/docutils/tools/quicktest.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/tools/quicktest.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -96,7 +96,7 @@
%s
%s],
]
-""" % ( tq, escape(input.rstrip()), tq, tq, escape(output.rstrip()), tq )
+""" % (tq, escape(input.rstrip()), tq, tq, escape(output.rstrip()), tq)
def escape(text):
"""
@@ -111,7 +111,7 @@
'rawxml': _rawxml,
'styledxml': _styledxml,
'xml': _prettyxml,
- 'pretty' : _pretty,
+ 'pretty': _pretty,
'test': _test}
def format(outputFormat, input, document, optargs):
Modified: trunk/docutils/tools/test/test_buildhtml.py
===================================================================
--- trunk/docutils/tools/test/test_buildhtml.py 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/tools/test/test_buildhtml.py 2022-03-03 22:15:00 UTC (rev 9015)
@@ -57,19 +57,19 @@
return dirs, files
class BuildHtmlTests(unittest.TestCase):
- tree = ( "_tmp_test_tree",
- "_tmp_test_tree/one.txt",
- "_tmp_test_tree/two.txt",
- "_tmp_test_tree/dir1",
- "_tmp_test_tree/dir1/one.txt",
- "_tmp_test_tree/dir1/two.txt",
- "_tmp_test_tree/dir2",
- "_tmp_test_tree/dir2/one.txt",
- "_tmp_test_tree/dir2/two.txt",
- "_tmp_test_tree/dir2/sub",
- "_tmp_test_tree/dir2/sub/one.txt",
- "_tmp_test_tree/dir2/sub/two.txt",
- )
+ tree = ("_tmp_test_tree",
+ "_tmp_test_tree/one.txt",
+ "_tmp_test_tree/two.txt",
+ "_tmp_test_tree/dir1",
+ "_tmp_test_tree/dir1/one.txt",
+ "_tmp_test_tree/dir1/two.txt",
+ "_tmp_test_tree/dir2",
+ "_tmp_test_tree/dir2/one.txt",
+ "_tmp_test_tree/dir2/two.txt",
+ "_tmp_test_tree/dir2/sub",
+ "_tmp_test_tree/dir2/sub/one.txt",
+ "_tmp_test_tree/dir2/sub/two.txt",
+ )
def setUp(self):
self.root = tempfile.mkdtemp()
@@ -94,14 +94,14 @@
def test_1(self):
opts = ["--dry-run", self.root]
- dirs, files = process_and_return_filelist( opts )
+ dirs, files = process_and_return_filelist(opts)
self.assertEqual(files.count("one.txt"), 4)
def test_local(self):
opts = ["--dry-run", "--local", self.root]
- dirs, files = process_and_return_filelist( opts )
- self.assertEqual( len(dirs), 1)
- self.assertEqual( files, [])
+ dirs, files = process_and_return_filelist(opts)
+ self.assertEqual(len(dirs), 1)
+ self.assertEqual(files, [])
if __name__ == '__main__':
unittest.main()
Modified: trunk/docutils/tox.ini
===================================================================
--- trunk/docutils/tox.ini 2022-03-03 22:14:41 UTC (rev 9014)
+++ trunk/docutils/tox.ini 2022-03-03 22:15:00 UTC (rev 9015)
@@ -31,10 +31,6 @@
E129, # visually indented line with same indent as next logical line
# allowed by PEP8
- E201, # whitespace after '('
- E202, # whitespace before '}'
- E203, # whitespace before ':'
- E211, # whitespace before '('
E221, # multiple spaces before operator
E222, # multiple spaces after operator
E225, # missing whitespace around operator
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-03-03 22:16:15
|
Revision: 9018
http://sourceforge.net/p/docutils/code/9018
Author: milde
Date: 2022-03-03 22:16:12 +0000 (Thu, 03 Mar 2022)
Log Message:
-----------
Fix missing whitespace after ',' or ':'.
flake8 rule E231.
Mostly trailing commas in list and dictionary literals.
Modified Paths:
--------------
trunk/docutils/docutils/parsers/rst/directives/__init__.py
trunk/docutils/docutils/parsers/rst/directives/tables.py
trunk/docutils/docutils/parsers/rst/languages/af.py
trunk/docutils/docutils/parsers/rst/languages/ca.py
trunk/docutils/docutils/parsers/rst/languages/cs.py
trunk/docutils/docutils/parsers/rst/languages/da.py
trunk/docutils/docutils/parsers/rst/languages/de.py
trunk/docutils/docutils/parsers/rst/languages/en.py
trunk/docutils/docutils/parsers/rst/languages/fi.py
trunk/docutils/docutils/parsers/rst/languages/fr.py
trunk/docutils/docutils/parsers/rst/languages/gl.py
trunk/docutils/docutils/parsers/rst/languages/he.py
trunk/docutils/docutils/parsers/rst/languages/it.py
trunk/docutils/docutils/parsers/rst/languages/ja.py
trunk/docutils/docutils/parsers/rst/languages/ko.py
trunk/docutils/docutils/parsers/rst/languages/lt.py
trunk/docutils/docutils/parsers/rst/languages/lv.py
trunk/docutils/docutils/parsers/rst/languages/nl.py
trunk/docutils/docutils/parsers/rst/languages/pl.py
trunk/docutils/docutils/parsers/rst/languages/pt_br.py
trunk/docutils/docutils/parsers/rst/languages/ru.py
trunk/docutils/docutils/parsers/rst/languages/sk.py
trunk/docutils/docutils/parsers/rst/languages/sv.py
trunk/docutils/docutils/parsers/rst/languages/zh_cn.py
trunk/docutils/docutils/parsers/rst/languages/zh_tw.py
trunk/docutils/docutils/parsers/rst/states.py
trunk/docutils/docutils/readers/__init__.py
trunk/docutils/docutils/transforms/frontmatter.py
trunk/docutils/docutils/utils/__init__.py
trunk/docutils/docutils/utils/math/latex2mathml.py
trunk/docutils/docutils/utils/math/math2html.py
trunk/docutils/docutils/utils/urischemes.py
trunk/docutils/docutils/writers/__init__.py
trunk/docutils/docutils/writers/latex2e/__init__.py
trunk/docutils/docutils/writers/pep_html/__init__.py
trunk/docutils/test/local_dummy_lang.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_code_long.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_code_none.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_replace_fr.py
trunk/docutils/test/test_parsers/test_rst/test_interpreted_fr.py
trunk/docutils/test/test_settings.py
trunk/docutils/test/test_transforms/test_docinfo.py
trunk/docutils/test/test_writers/test_html4css1_misc.py
trunk/docutils/test/test_writers/test_html4css1_template.py
trunk/docutils/test/test_writers/test_html5_polyglot_misc.py
trunk/docutils/test/test_writers/test_s5.py
trunk/docutils/tools/buildhtml.py
trunk/docutils/tox.ini
Modified: trunk/docutils/docutils/parsers/rst/directives/__init__.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/__init__.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/directives/__init__.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -64,7 +64,8 @@
'default-role': ('misc', 'DefaultRole'),
'title': ('misc', 'Title'),
'date': ('misc', 'Date'),
- 'restructuredtext-test-directive': ('misc', 'TestDirective'),}
+ 'restructuredtext-test-directive': ('misc', 'TestDirective'),
+ }
"""Mapping of directive name to (module name, class name). The
directive name is canonical & must be lowercase. Language-dependent
names are defined in the ``language`` subpackage."""
Modified: trunk/docutils/docutils/parsers/rst/directives/tables.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/tables.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/directives/tables.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -192,7 +192,7 @@
# text field quote/unquote char:
'quote': directives.single_char_or_unicode,
# char used to escape delim & quote as-needed:
- 'escape': directives.single_char_or_unicode,}
+ 'escape': directives.single_char_or_unicode}
class DocutilsDialect(csv.Dialect):
Modified: trunk/docutils/docutils/parsers/rst/languages/af.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/af.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/af.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -101,6 +101,7 @@
'uri-verwysing': 'uri-reference',
'uri': 'uri-reference',
'url': 'uri-reference',
- 'rou': 'raw',}
+ 'rou': 'raw',
+ }
"""Mapping of Afrikaans role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/ca.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/ca.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/ca.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -120,6 +120,7 @@
'refer\u00E8ncia-uri': 'uri-reference',
'uri': 'uri-reference',
'url': 'uri-reference',
- 'cru': 'raw',}
+ 'cru': 'raw',
+ }
"""Mapping of Catalan role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/cs.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/cs.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/cs.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -103,6 +103,7 @@
'uri-reference (translation required)': 'uri-reference',
'uri (translation required)': 'uri-reference',
'url (translation required)': 'uri-reference',
- 'raw (translation required)': 'raw',}
+ 'raw (translation required)': 'raw',
+ }
"""Mapping of Czech role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/da.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/da.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/da.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -107,6 +107,7 @@
'uri-reference': 'uri-reference',
'uri': 'uri-reference',
'url': 'uri-reference',
- 'rå': 'raw',}
+ 'rå': 'raw',
+ }
"""Mapping of Danish role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/de.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/de.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/de.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -99,6 +99,7 @@
'ziel': 'target',
'uri-referenz': 'uri-reference',
'unverändert': 'raw',
- 'roh': 'raw',}
+ 'roh': 'raw',
+ }
"""Mapping of German role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/en.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/en.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/en.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -105,6 +105,7 @@
'uri-reference': 'uri-reference',
'uri': 'uri-reference',
'url': 'uri-reference',
- 'raw': 'raw',}
+ 'raw': 'raw',
+ }
"""Mapping of English role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/fi.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/fi.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/fi.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -92,6 +92,7 @@
'substitution-reference (translation required)': 'substitution-reference',
'kohde': 'target',
'uri-reference (translation required)': 'uri-reference',
- 'raw (translation required)': 'raw',}
+ 'raw (translation required)': 'raw',
+ }
"""Mapping of Finnish role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/fr.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/fr.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/fr.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -98,6 +98,7 @@
'substitution-r\u00E9f\u00E9rence': 'substitution-reference',
'lien': 'target',
'uri-r\u00E9f\u00E9rence': 'uri-reference',
- 'brut': 'raw',}
+ 'brut': 'raw',
+ }
"""Mapping of French role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/gl.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/gl.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/gl.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -105,6 +105,7 @@
'referencia-uri': 'uri-reference',
'uri': 'uri-reference',
'url': 'uri-reference',
- 'cru': 'raw',}
+ 'cru': 'raw',
+ }
"""Mapping of Galician role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/he.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/he.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/he.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -103,6 +103,7 @@
'uri-reference': 'uri-reference',
'uri': 'uri-reference',
'url': 'uri-reference',
- 'raw': 'raw',}
+ 'raw': 'raw',
+ }
"""Mapping of English role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/it.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/it.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/it.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -92,6 +92,7 @@
'riferimento-sostituzione': 'substitution-reference',
'destinazione': 'target',
'riferimento-uri': 'uri-reference',
- 'grezzo': 'raw',}
+ 'grezzo': 'raw',
+ }
"""Mapping of Italian role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/ja.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/ja.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/ja.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -113,6 +113,7 @@
'uri参照': 'uri-reference',
'uri': 'uri-reference',
'url': 'uri-reference',
- '生': 'raw',}
+ '生': 'raw',
+ }
"""Mapping of Japanese role names to canonical role names for interpreted
text."""
Modified: trunk/docutils/docutils/parsers/rst/languages/ko.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/ko.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/ko.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -105,6 +105,7 @@
'uri-참조': 'uri-reference',
'uri': 'uri-reference',
'url': 'uri-reference',
- 'raw': 'raw',}
+ 'raw': 'raw',
+ }
"""Mapping of Korean role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/lt.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/lt.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/lt.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -103,6 +103,7 @@
'uri-nuoroda': 'uri-reference',
'uri': 'uri-reference',
'url': 'uri-reference',
- 'žalia': 'raw',}
+ 'žalia': 'raw',
+ }
"""Mapping of English role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/lv.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/lv.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/lv.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -102,6 +102,7 @@
'atsauce-uz-uri': 'uri-reference',
'uri': 'uri-reference',
'url': 'uri-reference',
- 'burtiski': 'raw',}
+ 'burtiski': 'raw',
+ }
"""Mapping of English role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/nl.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/nl.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/nl.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -107,6 +107,7 @@
'uri-referentie': 'uri-reference',
'uri': 'uri-reference',
'url': 'uri-reference',
- 'onbewerkt': 'raw',}
+ 'onbewerkt': 'raw',
+ }
"""Mapping of Dutch role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/pl.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/pl.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/pl.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -94,6 +94,7 @@
'referencja-uri': 'uri-reference',
'uri': 'uri-reference',
'url': 'uri-reference',
- 'surowe': 'raw',}
+ 'surowe': 'raw',
+ }
"""Mapping of Polish role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/pt_br.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/pt_br.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/pt_br.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -103,6 +103,7 @@
'refer\u00EAncia-a-uri': 'uri-reference',
'uri': 'uri-reference',
'url': 'uri-reference',
- 'cru': 'raw',}
+ 'cru': 'raw',
+ }
"""Mapping of Brazilian Portuguese role names to canonical role names
for interpreted text."""
Modified: trunk/docutils/docutils/parsers/rst/languages/ru.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/ru.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/ru.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -58,7 +58,8 @@
'тема': 'topic',
'эпиграф': 'epigraph',
'header (translation required)': 'header',
- 'footer (translation required)': 'footer',}
+ 'footer (translation required)': 'footer',
+ }
"""Russian name to registered (in directives/__init__.py) directive name
mapping."""
@@ -83,6 +84,7 @@
'ссылка-на-сноску': 'footnote-reference',
'цитатная-ссылка': 'citation-reference',
'цель': 'target',
- 'сырой': 'raw',}
+ 'сырой': 'raw',
+ }
"""Mapping of Russian role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/sk.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/sk.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/sk.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -90,6 +90,7 @@
'substitution-reference (translation required)': 'substitution-reference',
'target (translation required)': 'target',
'uri-reference (translation required)': 'uri-reference',
- 'raw (translation required)': 'raw',}
+ 'raw (translation required)': 'raw',
+ }
"""Mapping of Slovak role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/sv.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/sv.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/sv.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -89,6 +89,7 @@
'ersättnings-referens': 'substitution-reference',
'mål': 'target',
'uri-referens': 'uri-reference',
- 'rå': 'raw',}
+ 'rå': 'raw',
+ }
"""Mapping of Swedish role names to canonical role names for interpreted text.
"""
Modified: trunk/docutils/docutils/parsers/rst/languages/zh_cn.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/zh_cn.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/zh_cn.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -98,6 +98,7 @@
'uri-reference (translation required)': 'uri-reference',
'uri (translation required)': 'uri-reference',
'url (translation required)': 'uri-reference',
- 'raw (translation required)': 'raw',}
+ 'raw (translation required)': 'raw',
+ }
"""Mapping of Simplified Chinese role names to canonical role names
for interpreted text."""
Modified: trunk/docutils/docutils/parsers/rst/languages/zh_tw.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/zh_tw.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/languages/zh_tw.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -103,6 +103,7 @@
'uri-reference (translation required)': 'uri-reference',
'uri (translation required)': 'uri-reference',
'url (translation required)': 'uri-reference',
- 'raw (translation required)': 'raw',}
+ 'raw (translation required)': 'raw',
+ }
"""Mapping of Traditional Chinese role names to canonical role names for
interpreted text."""
Modified: trunk/docutils/docutils/parsers/rst/states.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/states.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/parsers/rst/states.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -1094,7 +1094,7 @@
'loweralpha': '[a-z]',
'upperalpha': '[A-Z]',
'lowerroman': '[ivxlcdm]+',
- 'upperroman': '[IVXLCDM]+',}
+ 'upperroman': '[IVXLCDM]+'}
enum.converters = {'arabic': int,
'loweralpha': _loweralpha_to_int,
'upperalpha': _upperalpha_to_int,
Modified: trunk/docutils/docutils/readers/__init__.py
===================================================================
--- trunk/docutils/docutils/readers/__init__.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/readers/__init__.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -30,10 +30,9 @@
config_section = 'readers'
def get_transforms(self):
- return Component.get_transforms(self) + [
- universal.Decorations,
- universal.ExposeInternals,
- universal.StripComments,]
+ return Component.get_transforms(self) + [universal.Decorations,
+ universal.ExposeInternals,
+ universal.StripComments]
def __init__(self, parser=None, parser_name=None):
"""
Modified: trunk/docutils/docutils/transforms/frontmatter.py
===================================================================
--- trunk/docutils/docutils/transforms/frontmatter.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/transforms/frontmatter.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -471,7 +471,7 @@
(re.compile(r'\$' r'Date: (\d\d\d\d)[-/](\d\d)[-/](\d\d)[ T][\d:]+'
r'[^$]* \$', re.IGNORECASE), r'\1-\2-\3'),
(re.compile(r'\$' r'RCSfile: (.+),v \$', re.IGNORECASE), r'\1'),
- (re.compile(r'\$[a-zA-Z]+: (.+) \$'), r'\1'),]
+ (re.compile(r'\$[a-zA-Z]+: (.+) \$'), r'\1')]
def extract_authors(self, field, name, docinfo):
try:
Modified: trunk/docutils/docutils/utils/__init__.py
===================================================================
--- trunk/docutils/docutils/utils/__init__.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/utils/__init__.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -608,7 +608,7 @@
[3, 6, 9]
"""
- return [i for i,c in enumerate(text) if unicodedata.combining(c)]
+ return [i for i, c in enumerate(text) if unicodedata.combining(c)]
def column_indices(text):
"""Indices of Unicode string `text` when skipping combining characters.
@@ -752,7 +752,7 @@
'alpha': 'a',
'beta': 'b',
'candidate': 'rc',
- 'final': '',}
+ 'final': ''}
def version_identifier(version_info=None):
"""
Modified: trunk/docutils/docutils/utils/math/latex2mathml.py
===================================================================
--- trunk/docutils/docutils/utils/math/latex2mathml.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/utils/math/latex2mathml.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -44,10 +44,10 @@
# special case: Capital Greek letters: (upright in TeX style)
greek_capitals = {
- 'Phi':'\u03a6', 'Xi':'\u039e', 'Sigma':'\u03a3',
- 'Psi':'\u03a8', 'Delta':'\u0394', 'Theta':'\u0398',
- 'Upsilon':'\u03d2', 'Pi':'\u03a0', 'Omega':'\u03a9',
- 'Gamma':'\u0393', 'Lambda':'\u039b'}
+ 'Phi': '\u03a6', 'Xi': '\u039e', 'Sigma': '\u03a3',
+ 'Psi': '\u03a8', 'Delta': '\u0394', 'Theta': '\u0398',
+ 'Upsilon': '\u03d2', 'Pi': '\u03a0', 'Omega': '\u03a9',
+ 'Gamma': '\u0393', 'Lambda': '\u039b'}
# functions -> <mi>
functions = {# functions with a space in the name
@@ -160,8 +160,8 @@
# special cases
thick_operators = {# style='font-weight: bold;'
- 'thicksim': '\u223C', # ∼
- 'thickapprox':'\u2248', # ≈
+ 'thicksim': '\u223C', # ∼
+ 'thickapprox': '\u2248', # ≈
}
small_operators = {# mathsize='75%'
Modified: trunk/docutils/docutils/utils/math/math2html.py
===================================================================
--- trunk/docutils/docutils/utils/math/math2html.py 2022-03-03 22:15:34 UTC (rev 9017)
+++ trunk/docutils/docutils/utils/math/math2html.py 2022-03-03 22:16:12 UTC (rev 9018)
@@ -82,24 +82,23 @@
"Configuration class from elyxer.config file"
extracttext = {
- 'allowed': ['FormulaConstant',],
- 'extracted': [
- 'AlphaCommand',
- 'Bracket',
- 'BracketCommand',
- 'CombiningFunction',
- 'EmptyCommand',
- 'FontFunction',
- 'Formula',
- 'FormulaNumber',
- 'FormulaSymbol',
- 'OneParamFunction',
- 'OversetFunction',
- 'RawText',
- 'SpacedCommand',
- 'SymbolFunction',
- 'TextFunction',
- 'UndersetFunction',
+ 'allowed': ['FormulaConstant'],
+ 'extracted': ['AlphaCommand',
+ 'Bracket',
+ 'BracketCommand',
+ 'CombiningFunction',
+ 'EmptyCommand',
+ 'FontFunction',
+ 'Formula',
+ 'FormulaNumber',
+ 'FormulaSymbol',
+ 'OneParamFunction',
+ 'OversetFunction',
+ 'RawText',
+ 'SpacedCommand',
+ 'SymbolFunction',
+ 'TextFunction',
+ 'UndersetFunction',
],
}
@@ -153,16 +152,16 @@
'rowseparator': r'\\',
}
- bigbrackets = {'(': ['⎛', '⎜', '⎝',],
- ')': ['⎞', '⎟', '⎠',],
- '[': ['⎡', '⎢', '⎣',],
- ']': ['⎤', '⎥', '⎦',],
- '{': ['⎧', '⎪', '⎨', '⎩',],
- '}': ['⎫', '⎪', '⎬', '⎭',],
+ bigbrackets = {'(': ['⎛', '⎜', '⎝'],
+ ')': ['⎞', '⎟', '⎠'],
+ '[': ['⎡', '⎢', '⎣'],
+ ']': ['⎤', '⎥', '⎦'],
+ '{': ['⎧', '⎪', '⎨', '⎩'],
+ '}': ['⎫', '⎪', '⎬', '⎭'],
# TODO: 2-row brackets with ⎰⎱ (\lmoustache \rmoustache)
- '|': ['|',], # 007C VERTICAL LINE
- # '|': ['⎮',], # 23AE INTEGRAL EXTENSION
- # '|': ['⎪',], # 23AA CURLY BRACKET EXTENSION
+ '|': ['|'], # 007C VERTICAL LINE
+ # '|': ['⎮'], # 23AE INTEGRAL EXTENSION
+ # '|': ['⎪'], # 23AA CURLY BRACKET EXTENSION
'‖': ['‖'], # 2016 DOUBLE VERTICAL LINE
# '∥': ['∥'], # 2225 PARALLEL TO
}
@@ -324,10 +323,10 @@
}
environments = {
- 'align': ['r', 'l',],
- 'eqnarray': ['r', 'c', 'l',],
- 'gathered': ['l', 'l',],
- 'smallmatrix': ['c', 'c',],
+ 'align': ['r', 'l'],
+ 'eqnarray': ['r', 'c', 'l'],
+ 'gathered': ['l', 'l'],
+ 'smallmatrix': ['c', 'c'],
}
fontfunctions = {
@@ -361,51 +360,51 @@
}
hybridfunctions = {
- '\\addcontentsline': ['{$p!}{$q!}{$r!}', 'f0{}', 'ignored',],
- '\\addtocontents': ['{$p!}{$q!}', 'f0{}', 'ignored',],
- '\\backmatter': ['', 'f0{}', 'ignored',],
- '\\binom': ['{$1}{$2}', 'f2{(}f0{f1{$1}f1{$2}}f2{)}', 'span class="binom"', 'span class="binomstack"', 'span class="bigdelimiter size2"',],
- '\\boxed': ['{$1}', 'f0{$1}', 'span class="boxed"',],
- '\\cfrac': ['[$p!]{$1}{$2}', 'f0{f3{(}f1{$1}f3{)/(}f2{$2}f3{)}}', 'span class="fullfraction"', 'span class="numerator align-$p"', 'span class="denominator"', 'span class="ignored"',],
- '\\color': ['{$p!}{$1}', 'f0{$1}', 'span style="color: $p;"',],
- '\\colorbox': ['{$p!}{$1}', 'f0{$1}', 'span class="colorbox" style="background: $p;"',],
- '\\dbinom': ['{$1}{$2}', '(f0{f1{f2{$1}}f1{f2{ }}f1{f2{$2}}})', 'span class="binomial"', 'span class="binomrow"', 'span class="binomcell"',],
- '\\dfrac': ['{$1}{$2}', 'f0{f3{(}f1{$1}f3{)/(}f2{$2}f3{)}}', 'span class="fullfraction"', 'span class="numerator"', 'span class="denominator"', 'span class="ignored"',],
- '\\displaystyle': ['{$1}', 'f0{$1}', 'span class="displaystyle"',],
- '\\fancyfoot': ['[$p!]{$q!}', 'f0{}', 'ignored',],
- '\\fancyhead': ['[$p!]{$q!}', 'f0{}', 'ignored',],
- '\\fbox': ['{$1}', 'f0{$1}', 'span class="fbox"',],
- '\\fboxrule': ['{$p!}', 'f0{}', 'ignored',],
- '\\fboxsep': ['{$p!}', 'f0{}', 'ignored',],
- '\\fcolorbox': ['{$p!}{$q!}{$1}', 'f0{$1}', 'span class="boxed" style="border-color: $p; background: $q;"',],
- '\\frac': ['{$1}{$2}', 'f0{f3{(}f1{$1}f3{)/(}f2{$2}f3{)}}', 'span class="fraction"', 'span class="numerator"', 'span class="denominator"', 'span class="ignored"',],
- '\\framebox': ['[$p!][$q!]{$1}', 'f0{$1}', 'span class="framebox align-$q" style="width: $p;"',],
- '\\frontmatter': ['', 'f0{}', 'ignored',],
- '\\href': ['[$o]{$u!}{$t!}', 'f0{$t}', 'a href="$u"',],
- '\\hspace': ['{$p!}', 'f0{ }', 'span class="hspace" style="width: $p;"',],
- '\\leftroot': ['{$p!}', 'f0{ }', 'span class="leftroot" style="width: $p;px"',],
+ '\\addcontentsline': ['{$p!}{$q!}{$r!}', 'f0{}', 'ignored'],
+ '\\addtocontents': ['{$p!}{$q!}', 'f0{}', 'ignored'],
+ '\\backmatter': ['', 'f0{}', 'ignored'],
+ '\\binom': ['{$1}{$2}', 'f2{(}f0{f1{$1}f1{$2}}f2{)}', 'span class="binom"', 'span class="binomstack"', 'span class="bigdelimiter size2"'],
+ '\\boxed': ['{$1}', 'f0{$1}', 'span class="boxed"'],
+ '\\cfrac': ['[$p!]{$1}{$2}', 'f0{f3{(}f1{$1}f3{)/(}f2{$2}f3{)}}', 'span class="fullfraction"', 'span class="numerator align-$p"', 'span class="denominator"', 'span class="ignored"'],
+ '\\color': ['{$p!}{$1}', 'f0{$1}', 'span style="color: $p;"'],
+ '\\colorbox': ['{$p!}{$1}', 'f0{$1}', 'span class="colorbox" style="background: $p;"'],
+ '\\dbinom': ['{$1}{$2}', '(f0{f1{f2{$1}}f1{f2{ }}f1{f2{$2}}})', 'span class="binomial"', 'span class="binomrow"', 'span class="binomcell"'],
+ '\\dfrac': ['{$1}{$2}', 'f0{f3{(}f1{$1}f3{)/(}f2{$2}f3{)}}', 'span class="fullfraction"', 'span class="numerator"', 'span class="denominator"', 'span class="ignored"'],
+ '\\displaystyle': ['{$1}', 'f0{$1}', 'span class="displaystyle"'],
+ '\\fancyfoot': ['[$p!]{$q!}', 'f0{}', 'ignored'],
+ '\\fancyhead': ['[$p!]{$q!}', 'f0{}', 'ignored'],
+ '\\fbox': ['{$1}', 'f0{$1}', 'span class="fbox"'],
+ '\\fboxrule': ['{$p!}', 'f0{}', 'ignored'],
+ '\\fboxsep': ['{$p!}', 'f0{}', 'ignored'],
+ '\\fcolorbox': ['{$p!}{$q!}{$1}', 'f0{$1}', 'span class="boxed" style="border-color: $p; background: $q;"'],
+ '\\frac': ['{$1}{$2}', 'f0{f3{(}f1{$1}f3{)/(}f2{$2}f3{)}}', 'span class="fraction"', 'span class="numerator"', 'span class="denominator"', 'span class="ignored"'],
+ '\\framebox': ['[$p!][$q!]{$1}', 'f0{$1}', 'span class="framebox align-$q" style="width: $p;"'],
+ '\\frontmatter': ['', 'f0{}', 'ignored'],
+ '\\href': ['[$o]{$u!}{$t!}', 'f0{$t}', 'a href="$u"'],
+ '\\hspace': ['{$p!}', 'f0{ }', 'span class="hspace" style="width: $p;"'],
+ '\\leftroot': ['{$p!}', 'f0{ }', 'span class="leftroot" style="width: $p;px"'],
# TOD...
[truncated message content] |
|
From: <mi...@us...> - 2022-03-03 22:16:26
|
Revision: 9019
http://sourceforge.net/p/docutils/code/9019
Author: milde
Date: 2022-03-03 22:16:23 +0000 (Thu, 03 Mar 2022)
Log Message:
-----------
Fix multiple spaces after ',' or ':'.
flake rule E241.
Allow exception for data collections where this facilitates
editing and comprehension.
Modified Paths:
--------------
trunk/docutils/docutils/languages/he.py
trunk/docutils/docutils/languages/sv.py
trunk/docutils/docutils/statemachine.py
trunk/docutils/docutils/utils/__init__.py
trunk/docutils/docutils/utils/punctuation_chars.py
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/test/test_dependencies.py
trunk/docutils/tox.ini
Modified: trunk/docutils/docutils/languages/he.py
===================================================================
--- trunk/docutils/docutils/languages/he.py 2022-03-03 22:16:12 UTC (rev 9018)
+++ trunk/docutils/docutils/languages/he.py 2022-03-03 22:16:23 UTC (rev 9019)
@@ -19,7 +19,7 @@
'authors': '\u05de\u05d7\u05d1\u05e8\u05d9',
'organization': '\u05d0\u05e8\u05d2\u05d5\u05df',
'address': '\u05db\u05ea\u05d5\u05d1\u05ea',
- 'contact': '\u05d0\u05d9\u05e9 \u05e7\u05e9\u05e8',
+ 'contact': '\u05d0\u05d9\u05e9 \u05e7\u05e9\u05e8',
'version': '\u05d2\u05e8\u05e1\u05d4',
'revision': '\u05de\u05d4\u05d3\u05d5\u05e8\u05d4',
'status': '\u05e1\u05d8\u05d8\u05d5\u05e1',
Modified: trunk/docutils/docutils/languages/sv.py
===================================================================
--- trunk/docutils/docutils/languages/sv.py 2022-03-03 22:16:12 UTC (rev 9018)
+++ trunk/docutils/docutils/languages/sv.py 2022-03-03 22:16:23 UTC (rev 9019)
@@ -14,44 +14,44 @@
__docformat__ = 'reStructuredText'
labels = {
- 'author': 'Författare',
- 'authors': 'Författare',
+ 'author': 'Författare',
+ 'authors': 'Författare',
'organization': 'Organisation',
- 'address': 'Adress',
- 'contact': 'Kontakt',
- 'version': 'Version',
- 'revision': 'Revision',
- 'status': 'Status',
- 'date': 'Datum',
- 'copyright': 'Copyright',
- 'dedication': 'Dedikation',
- 'abstract': 'Sammanfattning',
- 'attention': 'Observera!',
- 'caution': 'Akta!', # 'Varning' already used for 'warning'
- 'danger': 'FARA!',
- 'error': 'Fel',
- 'hint': 'Vink',
- 'important': 'Viktigt',
- 'note': 'Notera',
- 'tip': 'Tips',
- 'warning': 'Varning',
- 'contents': 'Innehåll'}
+ 'address': 'Adress',
+ 'contact': 'Kontakt',
+ 'version': 'Version',
+ 'revision': 'Revision',
+ 'status': 'Status',
+ 'date': 'Datum',
+ 'copyright': 'Copyright',
+ 'dedication': 'Dedikation',
+ 'abstract': 'Sammanfattning',
+ 'attention': 'Observera!',
+ 'caution': 'Akta!', # 'Varning' already used for 'warning'
+ 'danger': 'FARA!',
+ 'error': 'Fel',
+ 'hint': 'Vink',
+ 'important': 'Viktigt',
+ 'note': 'Notera',
+ 'tip': 'Tips',
+ 'warning': 'Varning',
+ 'contents': 'Innehåll'}
"""Mapping of node class name to label text."""
bibliographic_fields = {
# 'Author' and 'Authors' identical in Swedish; assume the plural:
'författare': 'authors',
- ' n/a': 'author',
- 'organisation': 'organization',
- 'adress': 'address',
- 'kontakt': 'contact',
- 'version': 'version',
- 'revision': 'revision',
- 'status': 'status',
- 'datum': 'date',
- 'copyright': 'copyright',
- 'dedikation': 'dedication',
- 'sammanfattning': 'abstract'}
+ ' n/a': 'author',
+ 'organisation': 'organization',
+ 'adress': 'address',
+ 'kontakt': 'contact',
+ 'version': 'version',
+ 'revision': 'revision',
+ 'status': 'status',
+ 'datum': 'date',
+ 'copyright': 'copyright',
+ 'dedikation': 'dedication',
+ 'sammanfattning': 'abstract'}
"""Swedish (lowcased) to canonical name mapping for bibliographic fields."""
author_separators = [';', ',']
Modified: trunk/docutils/docutils/statemachine.py
===================================================================
--- trunk/docutils/docutils/statemachine.py 2022-03-03 22:16:12 UTC (rev 9018)
+++ trunk/docutils/docutils/statemachine.py 2022-03-03 22:16:23 UTC (rev 9019)
@@ -1128,7 +1128,7 @@
def __getitem__(self, i):
if isinstance(i, slice):
- assert i.step in (None, 1), 'cannot handle slice with stride'
+ assert i.step in (None, 1), 'cannot handle slice with stride'
return self.__class__(self.data[i.start:i.stop],
items=self.items[i.start:i.stop],
parent=self, parent_offset=i.start or 0)
Modified: trunk/docutils/docutils/utils/__init__.py
===================================================================
--- trunk/docutils/docutils/utils/__init__.py 2022-03-03 22:16:12 UTC (rev 9018)
+++ trunk/docutils/docutils/utils/__init__.py 2022-03-03 22:16:23 UTC (rev 9019)
@@ -749,10 +749,10 @@
release_level_abbreviations = {
- 'alpha': 'a',
- 'beta': 'b',
+ 'alpha': 'a',
+ 'beta': 'b',
'candidate': 'rc',
- 'final': ''}
+ 'final': ''}
def version_identifier(version_info=None):
"""
Modified: trunk/docutils/docutils/utils/punctuation_chars.py
===================================================================
--- trunk/docutils/docutils/utils/punctuation_chars.py 2022-03-03 22:16:12 UTC (rev 9018)
+++ trunk/docutils/docutils/utils/punctuation_chars.py 2022-03-03 22:16:23 UTC (rev 9019)
@@ -94,7 +94,7 @@
# --------------------------
quote_pairs = {# open char: matching closing characters # usage example
- u'\xbb': u'\xbb', # » » Swedish
+ u'\xbb': u'\xbb', # » » Swedish
u'\u2018': u'\u201a', # ‘ ‚ Albanian/Greek/Turkish
u'\u2019': u'\u2019', # ’ ’ Swedish
u'\u201a': u'\u2018\u2019', # ‚ ‘ German ‚ ’ Polish
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2022-03-03 22:16:12 UTC (rev 9018)
+++ trunk/docutils/docutils/writers/_html_base.py 2022-03-03 22:16:23 UTC (rev 9019)
@@ -1178,10 +1178,10 @@
# HTML and MathML also convert the math_code.
# HTML container
math_tags = {# math_output: (block, inline, class-arguments)
- 'mathml': ('div', '', ''),
- 'html': ('div', 'span', 'formula'),
- 'mathjax': ('div', 'span', 'math'),
- 'latex': ('pre', 'tt', 'math'),
+ 'html': ('div', 'span', 'formula'),
+ 'latex': ('pre', 'tt', 'math'),
+ 'mathml': ('div', '', ''),
+ 'mathjax': ('div', 'span', 'math'),
}
def visit_math(self, node, math_env=''):
@@ -1196,10 +1196,10 @@
clsarg = self.math_tags[self.math_output][2]
# LaTeX container
wrappers = {# math_mode: (inline, block)
- 'mathml': ('$%s$', '\\begin{%s}\n%s\n\\end{%s}'),
- 'html': ('$%s$', '\\begin{%s}\n%s\n\\end{%s}'),
+ 'html': ('$%s$', '\\begin{%s}\n%s\n\\end{%s}'),
+ 'latex': (None, None),
+ 'mathml': ('$%s$', '\\begin{%s}\n%s\n\\end{%s}'),
'mathjax': (r'\(%s\)', '\\begin{%s}\n%s\n\\end{%s}'),
- 'latex': (None, None),
}
wrapper = wrappers[self.math_output][math_env != '']
if (self.math_output == 'mathml'
Modified: trunk/docutils/test/test_dependencies.py
===================================================================
--- trunk/docutils/test/test_dependencies.py 2022-03-03 22:16:12 UTC (rev 9018)
+++ trunk/docutils/test/test_dependencies.py 2022-03-03 22:16:23 UTC (rev 9019)
@@ -19,10 +19,10 @@
# docutils.utils.DependencyList records POSIX paths,
# i.e. "/" as a path separator even on Windows (not os.path.join).
paths = {'include': 'data/include.txt', # included rst file
- 'raw': 'data/raw.txt', # included raw "HTML file"
+ 'raw': 'data/raw.txt', # included raw "HTML file"
'scaled-image': '../docs/user/rst/images/biohazard.png',
'figure-image': '../docs/user/rst/images/title.png',
- 'stylesheet': 'data/stylesheet.txt',
+ 'stylesheet': 'data/stylesheet.txt',
}
# avoid latex writer future warnings:
Modified: trunk/docutils/tox.ini
===================================================================
--- trunk/docutils/tox.ini 2022-03-03 22:16:12 UTC (rev 9018)
+++ trunk/docutils/tox.ini 2022-03-03 22:16:23 UTC (rev 9019)
@@ -38,8 +38,6 @@
# whitespace around the operators with the lowest priority(ies).
# Use your own judgment; …"
- #E231, # missing whitespace after ','
- E241, # multiple spaces after ':'
E251, # unexpected spaces around keyword / parameter equals
E261, # at least two spaces before inline comment
E262, # inline comment should start with '# '
@@ -81,10 +79,17 @@
# complex regexp definitions
docutils/parsers/rst/states.py:E121,E128
# module with 3rd-party origin
- docutils/utils/math/math2html.py:E111,E114,E123 # leave indentation for now
+ docutils/utils/math/math2html.py:E111,E114,E123,E241
# generated auxiliary files
docutils/utils/math/unichar2tex.py:E122
docutils/utils/math/tex2unichar.py:E123
+ # allow aligning values in data-collections
+ docutils/utils/smartquotes.py:E241
+ docutils/utils/roman.py:E241
+ docutils/utils/math/latex2mathml.py:E241
+ docutils/writers/latex2e/__init__.py:E241
+ docutils/writers/xetex/__init__.py:E241
+
# included configuration files referencing externally defined variables
test/functional/tests/*:F821
# don't indent list delimiters in lists of test samples (multi-line strings)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-03-03 22:16:38
|
Revision: 9020
http://sourceforge.net/p/docutils/code/9020
Author: milde
Date: 2022-03-03 22:16:35 +0000 (Thu, 03 Mar 2022)
Log Message:
-----------
Fix unexpected spaces around equals indicating keyword arguments.
flake8 rule E251
Modified Paths:
--------------
trunk/docutils/docutils/nodes.py
trunk/docutils/docutils/utils/math/math2html.py
trunk/docutils/docutils/writers/_html_base.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/test/test_writers/test_latex2e.py
trunk/docutils/tools/dev/generate_punctuation_chars.py
trunk/docutils/tools/docutils-cli.py
trunk/docutils/tox.ini
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2022-03-03 22:16:23 UTC (rev 9019)
+++ trunk/docutils/docutils/nodes.py 2022-03-03 22:16:35 UTC (rev 9020)
@@ -780,7 +780,7 @@
value = [value]
self.append_attr_list(attr, value)
- def replace_attr(self, attr, value, force = True):
+ def replace_attr(self, attr, value, force=True):
"""
If self[attr] does not exist or force is True or omitted, set
self[attr] to value, otherwise do nothing.
@@ -789,7 +789,7 @@
if force or self.get(attr) is None:
self[attr] = value
- def copy_attr_convert(self, attr, value, replace = True):
+ def copy_attr_convert(self, attr, value, replace=True):
"""
If attr is an attribute of self, set self[attr] to
[self[attr], value], otherwise set self[attr] to value.
@@ -839,8 +839,8 @@
if self.get(attr) is not value:
self.replace_attr(attr, value, replace)
- def update_all_atts(self, dict_, update_fun = copy_attr_consistent,
- replace = True, and_source = False):
+ def update_all_atts(self, dict_, update_fun=copy_attr_consistent,
+ replace=True, and_source=False):
"""
Updates all attributes from node or dictionary `dict_`.
@@ -877,8 +877,8 @@
for att in filter(filter_fun, dict_):
update_fun(self, att, dict_[att], replace)
- def update_all_atts_consistantly(self, dict_, replace = True,
- and_source = False):
+ def update_all_atts_consistantly(self, dict_, replace=True,
+ and_source=False):
"""
Updates all attributes from node or dictionary `dict_`.
@@ -898,8 +898,8 @@
self.update_all_atts(dict_, Element.copy_attr_consistent, replace,
and_source)
- def update_all_atts_concatenating(self, dict_, replace = True,
- and_source = False):
+ def update_all_atts_concatenating(self, dict_, replace=True,
+ and_source=False):
"""
Updates all attributes from node or dictionary `dict_`.
@@ -922,8 +922,8 @@
self.update_all_atts(dict_, Element.copy_attr_concatenate, replace,
and_source)
- def update_all_atts_coercion(self, dict_, replace = True,
- and_source = False):
+ def update_all_atts_coercion(self, dict_, replace=True,
+ and_source=False):
"""
Updates all attributes from node or dictionary `dict_`.
@@ -947,7 +947,7 @@
self.update_all_atts(dict_, Element.copy_attr_coerce, replace,
and_source)
- def update_all_atts_convert(self, dict_, and_source = False):
+ def update_all_atts_convert(self, dict_, and_source=False):
"""
Updates all attributes from node or dictionary `dict_`.
@@ -966,7 +966,7 @@
on the value of update_fun.
"""
self.update_all_atts(dict_, Element.copy_attr_convert,
- and_source = and_source)
+ and_source=and_source)
def clear(self):
self.children = []
Modified: trunk/docutils/docutils/utils/math/math2html.py
===================================================================
--- trunk/docutils/docutils/utils/math/math2html.py 2022-03-03 22:16:23 UTC (rev 9019)
+++ trunk/docutils/docutils/utils/math/math2html.py 2022-03-03 22:16:35 UTC (rev 9020)
@@ -1107,11 +1107,11 @@
"Glob a bit of text up until (excluding) any excluded character."
return self.glob(lambda: self.current() not in excluded)
- def pushending(self, ending, optional = False):
+ def pushending(self, ending, optional=False):
"Push a new ending to the bottom"
self.endinglist.add(ending, optional)
- def popending(self, expected = None):
+ def popending(self, expected=None):
"Pop the ending found at the current position"
if self.isout() and self.leavepending:
return expected
@@ -1134,7 +1134,7 @@
def __init__(self):
self.endings = []
- def add(self, ending, optional = False):
+ def add(self, ending, optional=False):
"Add a new ending to the list"
self.endings.append(PositionEnding(ending, optional))
@@ -1325,7 +1325,7 @@
html = [html]
return html
- def escape(self, line, replacements = EscapeConfig.entities):
+ def escape(self, line, replacements=EscapeConfig.entities):
"Escape a line with replacements from a map"
pieces = sorted(replacements.keys())
# do them in order
@@ -1406,7 +1406,7 @@
while len(container.contents) > 0:
self.contents.insert(index, container.contents.pop())
- def tree(self, level = 0):
+ def tree(self, level=0):
"Show in a tree"
Trace.debug(" " * level + str(self))
for container in self.contents:
@@ -1673,7 +1673,7 @@
self.add(FormulaConstant(constant))
return self
- def complete(self, contents, tag, breaklines = False):
+ def complete(self, contents, tag, breaklines=False):
"Set the constant and the tag"
self.contents = contents
self.output = TaggedOutput().settag(tag, breaklines)
@@ -1681,7 +1681,7 @@
def selfcomplete(self, tag):
"Set the self-closing tag, no contents (as in <hr/>)."
- self.output = TaggedOutput().settag(tag, empty = True)
+ self.output = TaggedOutput().settag(tag, empty=True)
return self
class FormulaConstant(Constant):
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2022-03-03 22:16:23 UTC (rev 9019)
+++ trunk/docutils/docutils/writers/_html_base.py 2022-03-03 22:16:35 UTC (rev 9020)
@@ -517,7 +517,7 @@
def visit_address(self, node):
self.visit_docinfo_item(node, 'address', meta=False)
self.body.append(self.starttag(node, 'pre',
- suffix= '', CLASS='address'))
+ suffix='', CLASS='address'))
def depart_address(self, node):
self.body.append('\n</pre>\n')
Modified: trunk/docutils/docutils/writers/html4css1/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html4css1/__init__.py 2022-03-03 22:16:23 UTC (rev 9019)
+++ trunk/docutils/docutils/writers/html4css1/__init__.py 2022-03-03 22:16:35 UTC (rev 9020)
@@ -40,40 +40,40 @@
# use a copy of the parent spec with some modifications
settings_spec = frontend.filter_settings_spec(
writers._html_base.Writer.settings_spec,
- template =
- ('Template file. (UTF-8 encoded, default: "%s")' % default_template,
- ['--template'],
- {'default': default_template, 'metavar': '<file>'}),
- stylesheet_path =
- ('Comma separated list of stylesheet paths. '
- 'Relative paths are expanded if a matching file is found in '
- 'the --stylesheet-dirs. With --link-stylesheet, '
- 'the path is rewritten relative to the output HTML file. '
- '(default: "%s")' % ','.join(default_stylesheets),
- ['--stylesheet-path'],
- {'metavar': '<file[,file,...]>', 'overrides': 'stylesheet',
- 'validator': frontend.validate_comma_separated_list,
- 'default': default_stylesheets}),
- stylesheet_dirs =
- ('Comma-separated list of directories where stylesheets are found. '
- 'Used by --stylesheet-path when expanding relative path arguments. '
- '(default: "%s")' % ','.join(default_stylesheet_dirs),
- ['--stylesheet-dirs'],
- {'metavar': '<dir[,dir,...]>',
- 'validator': frontend.validate_comma_separated_list,
- 'default': default_stylesheet_dirs}),
- initial_header_level =
- ('Specify the initial header level. Does not affect document '
- 'title & subtitle (see --no-doc-title). (default: 1 for "<h1>")',
- ['--initial-header-level'],
- {'choices': '1 2 3 4 5 6'.split(), 'default': '1',
- 'metavar': '<level>'}),
- xml_declaration =
- ('Prepend an XML declaration (default). ',
- ['--xml-declaration'],
- {'default': True, 'action': 'store_true',
- 'validator': frontend.validate_boolean}),
- )
+ template=(
+ 'Template file. (UTF-8 encoded, default: "%s")' % default_template,
+ ['--template'],
+ {'default': default_template, 'metavar': '<file>'}),
+ stylesheet_path=(
+ 'Comma separated list of stylesheet paths. '
+ 'Relative paths are expanded if a matching file is found in '
+ 'the --stylesheet-dirs. With --link-stylesheet, '
+ 'the path is rewritten relative to the output HTML file. '
+ '(default: "%s")' % ','.join(default_stylesheets),
+ ['--stylesheet-path'],
+ {'metavar': '<file[,file,...]>', 'overrides': 'stylesheet',
+ 'validator': frontend.validate_comma_separated_list,
+ 'default': default_stylesheets}),
+ stylesheet_dirs=(
+ 'Comma-separated list of directories where stylesheets are found. '
+ 'Used by --stylesheet-path when expanding relative path arguments. '
+ '(default: "%s")' % ','.join(default_stylesheet_dirs),
+ ['--stylesheet-dirs'],
+ {'metavar': '<dir[,dir,...]>',
+ 'validator': frontend.validate_comma_separated_list,
+ 'default': default_stylesheet_dirs}),
+ initial_header_level=(
+ 'Specify the initial header level. Does not affect document '
+ 'title & subtitle (see --no-doc-title). (default: 1 for "<h1>")',
+ ['--initial-header-level'],
+ {'choices': '1 2 3 4 5 6'.split(), 'default': '1',
+ 'metavar': '<level>'}),
+ xml_declaration=(
+ 'Prepend an XML declaration (default). ',
+ ['--xml-declaration'],
+ {'default': True, 'action': 'store_true',
+ 'validator': frontend.validate_boolean}),
+ )
settings_spec = settings_spec + (
'HTML4 Writer Options',
'',
Modified: trunk/docutils/docutils/writers/html5_polyglot/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2022-03-03 22:16:23 UTC (rev 9019)
+++ trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2022-03-03 22:16:35 UTC (rev 9020)
@@ -47,38 +47,39 @@
# use a copy of the parent spec with some modifications
settings_spec = frontend.filter_settings_spec(
writers._html_base.Writer.settings_spec,
- template =
- ('Template file. (UTF-8 encoded, default: "%s")' % default_template,
- ['--template'],
- {'default': default_template, 'metavar': '<file>'}),
- stylesheet_path =
- ('Comma separated list of stylesheet paths. '
- 'Relative paths are expanded if a matching file is found in '
- 'the --stylesheet-dirs. With --link-stylesheet, '
- 'the path is rewritten relative to the output HTML file. '
- '(default: "%s")' % ','.join(default_stylesheets),
- ['--stylesheet-path'],
- {'metavar': '<file[,file,...]>', 'overrides': 'stylesheet',
- 'validator': frontend.validate_comma_separated_list,
- 'default': default_stylesheets}),
- stylesheet_dirs =
- ('Comma-separated list of directories where stylesheets are found. '
- 'Used by --stylesheet-path when expanding relative path arguments. '
- '(default: "%s")' % ','.join(default_stylesheet_dirs),
- ['--stylesheet-dirs'],
- {'metavar': '<dir[,dir,...]>',
- 'validator': frontend.validate_comma_separated_list,
- 'default': default_stylesheet_dirs}),
- initial_header_level =
- ('Specify the initial header level. Does not affect document '
- 'title & subtitle (see --no-doc-title). (default: 2 for "<h2>")',
- ['--initial-header-level'],
- {'choices': '1 2 3 4 5 6'.split(), 'default': '2',
- 'metavar': '<level>'}),
- no_xml_declaration =
- ('Omit the XML declaration.',
- ['--no-xml-declaration'],
- {'dest': 'xml_declaration', 'action': 'store_false'}),
+ template=(
+ 'Template file. (UTF-8 encoded, default: "%s")'
+ % default_template,
+ ['--template'],
+ {'default': default_template, 'metavar': '<file>'}),
+ stylesheet_path=(
+ 'Comma separated list of stylesheet paths. '
+ 'Relative paths are expanded if a matching file is found in '
+ 'the --stylesheet-dirs. With --link-stylesheet, '
+ 'the path is rewritten relative to the output HTML file. '
+ '(default: "%s")' % ','.join(default_stylesheets),
+ ['--stylesheet-path'],
+ {'metavar': '<file[,file,...]>', 'overrides': 'stylesheet',
+ 'validator': frontend.validate_comma_separated_list,
+ 'default': default_stylesheets}),
+ stylesheet_dirs=(
+ 'Comma-separated list of directories where stylesheets are found. '
+ 'Used by --stylesheet-path when expanding relative path arguments. '
+ '(default: "%s")' % ','.join(default_stylesheet_dirs),
+ ['--stylesheet-dirs'],
+ {'metavar': '<dir[,dir,...]>',
+ 'validator': frontend.validate_comma_separated_list,
+ 'default': default_stylesheet_dirs}),
+ initial_header_level=(
+ 'Specify the initial header level. Does not affect document '
+ 'title & subtitle (see --no-doc-title). (default: 2 for "<h2>")',
+ ['--initial-header-level'],
+ {'choices': '1 2 3 4 5 6'.split(), 'default': '2',
+ 'metavar': '<level>'}),
+ no_xml_declaration=(
+ 'Omit the XML declaration.',
+ ['--no-xml-declaration'],
+ {'dest': 'xml_declaration', 'action': 'store_false'}),
)
settings_spec = settings_spec + (
'HTML5 Writer Options',
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2022-03-03 22:16:23 UTC (rev 9019)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2022-03-03 22:16:35 UTC (rev 9020)
@@ -276,7 +276,7 @@
except IOError:
templatepath = os.path.join(self.default_template_path,
templatepath)
- with open(templatepath, encoding= 'utf8') as fp:
+ with open(templatepath, encoding='utf8') as fp:
template = fp.read()
# fill template
self.assemble_parts() # create dictionary of parts
Modified: trunk/docutils/test/test_writers/test_latex2e.py
===================================================================
--- trunk/docutils/test/test_writers/test_latex2e.py 2022-03-03 22:16:23 UTC (rev 9019)
+++ trunk/docutils/test/test_writers/test_latex2e.py 2022-03-03 22:16:35 UTC (rev 9020)
@@ -59,24 +59,24 @@
$titledata""")
parts = dict(
-head_prefix = r"""\documentclass[a4paper]{article}
+head_prefix=r"""\documentclass[a4paper]{article}
""",
-requirements = r"""\usepackage{ifthen}
+requirements=r"""\usepackage{ifthen}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
""",
-latex_preamble = r"""% PDF Standard Fonts
+latex_preamble=r"""% PDF Standard Fonts
\usepackage{mathptmx} % Times
\usepackage[scaled=.90]{helvet}
\usepackage{courier}
""",
-longtable = r"""\usepackage{longtable,ltcaption,array}
+longtable=r"""\usepackage{longtable,ltcaption,array}
\setlength{\extrarowheight}{2pt}
\newlength{\DUtablewidth} % internal use in tables
""",
-stylesheet = '',
-fallbacks = '',
-fallbacks_highlight = r"""
+stylesheet='',
+fallbacks='',
+fallbacks_highlight=r"""
% basic code highlight:
\providecommand*\DUrolecomment[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}}
\providecommand*\DUroledeleted[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}}
@@ -92,7 +92,7 @@
\fi%
}
""",
-pdfsetup = r"""
+pdfsetup=r"""
% hyperlinks:
\ifthenelse{\isundefined{\hypersetup}}{
\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref}
@@ -100,12 +100,12 @@
\urlstyle{same} % normal text font (alternatives: tt, rm, sf)
}{}
""",
-titledata = '')
+titledata='')
head = head_template.substitute(parts)
head_table = head_template.substitute(
- dict(parts, requirements = parts['requirements'] + parts['longtable']))
+ dict(parts, requirements=parts['requirements'] + parts['longtable']))
head_booktabs = head_template.substitute(
dict(parts, requirements=parts['requirements']
@@ -116,7 +116,7 @@
+ '\\usepackage{textcomp} % text symbol macros\n'))
head_alltt = head_template.substitute(
- dict(parts, requirements = parts['requirements']
+ dict(parts, requirements=parts['requirements']
+ '\\usepackage{alltt}\n'))
@@ -150,8 +150,8 @@
totest['spanish quote'] = [
[".. role:: language-es\n\nUnd damit :language-es:`basta`!",
-head_template.substitute(dict(parts, requirements =
-r"""\usepackage{ifthen}
+head_template.substitute(dict(parts,
+requirements=r"""\usepackage{ifthen}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish,english]{babel}
@@ -165,9 +165,9 @@
totest['code role'] = [
[':code:`x=1`',
-head_template.substitute(dict(parts, requirements = parts['requirements']
+head_template.substitute(dict(parts, requirements=parts['requirements']
+ '\\usepackage{color}\n',
- fallbacks = parts['fallbacks_highlight']))
+ fallbacks=parts['fallbacks_highlight']))
+ r"""
\texttt{\DUrole{code}{x=1}}
@@ -408,7 +408,7 @@
-------------
""",
# expected output
-head_template.substitute(dict(parts, requirements = parts['requirements'] +
+head_template.substitute(dict(parts, requirements=parts['requirements'] +
r"""\setcounter{secnumdepth}{0}
""")) + r"""
some text
@@ -927,8 +927,8 @@
head_template.substitute(
dict(
parts,
- requirements = parts['requirements'] + parts['longtable'],
- fallbacks = r"""
+ requirements=parts['requirements'] + parts['longtable'],
+ fallbacks=r"""
% class handling for environments (block-level elements)
% \begin{DUclass}{spam} tries \DUCLASSspam and
% \end{DUclass}{spam} tries \endDUCLASSspam
@@ -1042,7 +1042,7 @@
""",
head_template.substitute(
dict(parts,
- fallbacks = r"""
+ fallbacks=r"""
% class handling for environments (block-level elements)
% \begin{DUclass}{spam} tries \DUCLASSspam and
% \end{DUclass}{spam} tries \endDUCLASSspam
@@ -1110,8 +1110,8 @@
totest_stylesheet['two-styles'] = [
# input
["""two stylesheet links in the header""",
-head_template.substitute(dict(parts, stylesheet =
-r"""\usepackage{data/spam}
+head_template.substitute(dict(parts,
+stylesheet=r"""\usepackage{data/spam}
\input{data/ham.tex}
""")) + r"""
two stylesheet links in the header
@@ -1123,8 +1123,8 @@
totest_stylesheet_embed['two-styles'] = [
# input
["""two stylesheets embedded in the header""",
-head_template.substitute(dict(parts, stylesheet =
-r"""% Cannot embed stylesheet:
+head_template.substitute(dict(parts,
+stylesheet=r"""% Cannot embed stylesheet:
% [Errno 2] No such file or directory: 'data/spam.sty'
% embedded stylesheet: data/ham.tex
\newcommand{\ham}{wonderful ham}
Modified: trunk/docutils/tools/dev/generate_punctuation_chars.py
===================================================================
--- trunk/docutils/tools/dev/generate_punctuation_chars.py 2022-03-03 22:16:23 UTC (rev 9019)
+++ trunk/docutils/tools/dev/generate_punctuation_chars.py 2022-03-03 22:16:35 UTC (rev 9020)
@@ -276,7 +276,7 @@
return ''.join(l2)
-def wrap_string(s, startstring= "('", endstring = "')", wrap=67):
+def wrap_string(s, startstring="('", endstring="')", wrap=67):
"""Line-wrap a unicode string literal definition."""
c = len(startstring)
contstring = "'\n" + ' '*(len(startstring)-2) + "'"
Modified: trunk/docutils/tools/docutils-cli.py
===================================================================
--- trunk/docutils/tools/docutils-cli.py 2022-03-03 22:16:23 UTC (rev 9019)
+++ trunk/docutils/tools/docutils-cli.py 2022-03-03 22:16:35 UTC (rev 9020)
@@ -90,7 +90,7 @@
publish_cmdline(reader_name=args.reader,
parser_name=args.parser,
writer_name=args.writer,
- settings_spec = settings_spec,
+ settings_spec=settings_spec,
description=description,
argv=remainder)
except ImportError as error:
Modified: trunk/docutils/tox.ini
===================================================================
--- trunk/docutils/tox.ini 2022-03-03 22:16:23 UTC (rev 9019)
+++ trunk/docutils/tox.ini 2022-03-03 22:16:35 UTC (rev 9020)
@@ -38,7 +38,6 @@
# whitespace around the operators with the lowest priority(ies).
# Use your own judgment; …"
- E251, # unexpected spaces around keyword / parameter equals
E261, # at least two spaces before inline comment
E262, # inline comment should start with '# '
E265, # block comment should start with '# '
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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
...
[truncated message content] |
|
From: <mi...@us...> - 2022-03-04 15:55:03
|
Revision: 9022
http://sourceforge.net/p/docutils/code/9022
Author: milde
Date: 2022-03-04 15:54:56 +0000 (Fri, 04 Mar 2022)
Log Message:
-----------
Ensure comments start with '# '
flake rules
E262: inline comment should start with '# '
E265: block comment should start with '# '
E266: too many leading '#' for block comment
Exception for latex2e (legacy convention to mark disabled code with ##).
Modified Paths:
--------------
trunk/docutils/docutils/core.py
trunk/docutils/docutils/parsers/__init__.py
trunk/docutils/docutils/parsers/rst/directives/__init__.py
trunk/docutils/docutils/parsers/rst/directives/body.py
trunk/docutils/docutils/parsers/rst/languages/af.py
trunk/docutils/docutils/parsers/rst/languages/ar.py
trunk/docutils/docutils/parsers/rst/languages/ca.py
trunk/docutils/docutils/parsers/rst/languages/cs.py
trunk/docutils/docutils/parsers/rst/languages/da.py
trunk/docutils/docutils/parsers/rst/languages/de.py
trunk/docutils/docutils/parsers/rst/languages/en.py
trunk/docutils/docutils/parsers/rst/languages/eo.py
trunk/docutils/docutils/parsers/rst/languages/es.py
trunk/docutils/docutils/parsers/rst/languages/fa.py
trunk/docutils/docutils/parsers/rst/languages/fi.py
trunk/docutils/docutils/parsers/rst/languages/fr.py
trunk/docutils/docutils/parsers/rst/languages/gl.py
trunk/docutils/docutils/parsers/rst/languages/he.py
trunk/docutils/docutils/parsers/rst/languages/it.py
trunk/docutils/docutils/parsers/rst/languages/ja.py
trunk/docutils/docutils/parsers/rst/languages/ko.py
trunk/docutils/docutils/parsers/rst/languages/lt.py
trunk/docutils/docutils/parsers/rst/languages/lv.py
trunk/docutils/docutils/parsers/rst/languages/nl.py
trunk/docutils/docutils/parsers/rst/languages/pl.py
trunk/docutils/docutils/parsers/rst/languages/pt_br.py
trunk/docutils/docutils/parsers/rst/languages/sk.py
trunk/docutils/docutils/parsers/rst/languages/zh_cn.py
trunk/docutils/docutils/parsers/rst/languages/zh_tw.py
trunk/docutils/docutils/utils/math/tex2unichar.py
trunk/docutils/docutils/utils/roman.py
trunk/docutils/docutils/writers/docutils_xml.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/test/local_dummy_lang.py
trunk/docutils/test/test_language.py
trunk/docutils/test/test_nodes.py
trunk/docutils/test/test_writers/test_get_writer_class.py
trunk/docutils/test/test_writers/test_odt.py
trunk/docutils/tox.ini
Modified: trunk/docutils/docutils/core.py
===================================================================
--- trunk/docutils/docutils/core.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/core.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -107,7 +107,7 @@
parts = config_section.split()
if len(parts) > 1 and parts[-1] == 'application':
settings_spec.config_section_dependencies = ['applications']
- #@@@ Add self.source & self.destination to components in future?
+ # @@@ Add self.source & self.destination to components in future?
option_parser = OptionParser(
components=(self.parser, self.reader, self.writer, settings_spec),
defaults=defaults, read_config_files=True,
Modified: trunk/docutils/docutils/parsers/__init__.py
===================================================================
--- trunk/docutils/docutils/parsers/__init__.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/__init__.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -75,7 +75,7 @@
# 3rd-party Markdown parsers
'recommonmark': 'docutils.parsers.recommonmark_wrapper',
'myst': 'myst_parser.docutils_',
- #'pycmark': works out of the box
+ # 'pycmark': works out of the box
# TODO: the following two could be either of the above
'commonmark': 'docutils.parsers.recommonmark_wrapper',
'markdown': 'docutils.parsers.recommonmark_wrapper',
Modified: trunk/docutils/docutils/parsers/rst/directives/__init__.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/__init__.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/directives/__init__.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -40,7 +40,7 @@
'pull-quote': ('body', 'PullQuote'),
'compound': ('body', 'Compound'),
'container': ('body', 'Container'),
- #'questions': ('body', 'question_list'),
+ # 'questions': ('body', 'question_list'),
'table': ('tables', 'RSTTable'),
'csv-table': ('tables', 'CSVTable'),
'list-table': ('tables', 'ListTable'),
@@ -50,11 +50,11 @@
'sectnum': ('parts', 'Sectnum'),
'header': ('parts', 'Header'),
'footer': ('parts', 'Footer'),
- #'footnotes': ('parts', 'footnotes'),
- #'citations': ('parts', 'citations'),
+ # 'footnotes': ('parts', 'footnotes'),
+ # 'citations': ('parts', 'citations'),
'target-notes': ('references', 'TargetNotes'),
'meta': ('misc', 'Meta'),
- #'imagemap': ('html', 'imagemap'),
+ # 'imagemap': ('html', 'imagemap'),
'raw': ('misc', 'Raw'),
'include': ('misc', 'Include'),
'replace': ('misc', 'Replace'),
Modified: trunk/docutils/docutils/parsers/rst/directives/body.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/body.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/directives/body.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -194,7 +194,7 @@
option_spec = {'class': directives.class_option,
'name': directives.unchanged,
- ## TODO: Add Sphinx' ``mathbase.py`` option 'nowrap'?
+ # TODO: Add Sphinx' ``mathbase.py`` option 'nowrap'?
# 'nowrap': directives.flag,
}
has_content = True
Modified: trunk/docutils/docutils/parsers/rst/languages/af.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/af.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/languages/af.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -38,14 +38,14 @@
'pull-quote (translation required)': 'pull-quote',
'compound (translation required)': 'compound',
'container (translation required)': 'container',
- #'vrae': 'questions',
- #'qa': 'questions',
- #'faq': 'questions',
+ # 'vrae': 'questions',
+ # 'qa': 'questions',
+ # 'faq': 'questions',
'table (translation required)': 'table',
'csv-table (translation required)': 'csv-table',
'list-table (translation required)': 'list-table',
'meta': 'meta',
- #'beeldkaart': 'imagemap',
+ # 'beeldkaart': 'imagemap',
'beeld': 'image',
'figuur': 'figure',
'insluiting': 'include',
@@ -62,8 +62,8 @@
'section-numbering': 'sectnum',
'header (translation required)': 'header',
'footer (translation required)': 'footer',
- #'voetnote': 'footnotes',
- #'aanhalings': 'citations',
+ # 'voetnote': 'footnotes',
+ # 'aanhalings': 'citations',
'teikennotas': 'target-notes',
'restructuredtext-test-directive': 'restructuredtext-test-directive'}
"""Afrikaans name to registered (in directives/__init__.py) directive name
Modified: trunk/docutils/docutils/parsers/rst/languages/ar.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/ar.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/languages/ar.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -37,15 +37,15 @@
'نقل-قول': 'pull-quote',
'ترکیب': 'compound',
'وعاء': 'container',
- #'questions': 'questions',
+ # 'questions': 'questions',
'جدول': 'table',
'جدول-csv': 'csv-table',
'جدول-قوائم': 'list-table',
- #'qa': 'questions',
- #'faq': 'questions',
+ # 'qa': 'questions',
+ # 'faq': 'questions',
'ميتا': 'meta',
'رياضيات': 'math',
- #'imagemap': 'imagemap',
+ # 'imagemap': 'imagemap',
'صورة': 'image',
'رسم-توضيحي': 'figure',
'تضمين': 'include',
@@ -62,8 +62,8 @@
'رقم-القسم': 'sectnum',
'رأس-الصفحة': 'header',
'هامش': 'footer',
- #'footnotes': 'footnotes',
- #'citations': 'citations',
+ # 'footnotes': 'footnotes',
+ # 'citations': 'citations',
'': 'target-notes',
}
"""Arabic name to registered (in directives/__init__.py) directive name
Modified: trunk/docutils/docutils/parsers/rst/languages/ca.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/ca.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/languages/ca.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -40,15 +40,15 @@
'cita-destacada': 'pull-quote',
'compost': 'compound',
'container (translation required)': 'container',
- #'questions': 'questions',
+ # 'questions': 'questions',
'taula': 'table',
'taula-csv': 'csv-table',
'taula-llista': 'list-table',
- #'qa': 'questions',
- #'faq': 'questions',
+ # 'qa': 'questions',
+ # 'faq': 'questions',
'math (translation required)': 'math',
'meta': 'meta',
- #'imagemap': 'imagemap',
+ # 'imagemap': 'imagemap',
'imatge': 'image',
'figura': 'figure',
'inclou': 'include',
@@ -69,8 +69,8 @@
'cap\u00E7alera': 'header',
'peu-de-p\u00E0gina': 'footer',
'peu-p\u00E0gina': 'footer',
- #'footnotes': 'footnotes',
- #'citations': 'citations',
+ # 'footnotes': 'footnotes',
+ # 'citations': 'citations',
'notes-amb-destinacions': 'target-notes',
'notes-destinacions': 'target-notes',
'directiva-de-prova-de-restructuredtext': 'restructuredtext-test-directive'}
Modified: trunk/docutils/docutils/parsers/rst/languages/cs.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/cs.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/languages/cs.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -38,15 +38,15 @@
'pull-quote (translation required)': 'pull-quote',
'compound (translation required)': 'compound',
'container (translation required)': 'container',
- #'questions': 'questions',
- #'qa': 'questions',
- #'faq': 'questions',
+ # 'questions': 'questions',
+ # 'qa': 'questions',
+ # 'faq': 'questions',
'table (translation required)': 'table',
'csv-table (translation required)': 'csv-table',
'list-table (translation required)': 'list-table',
'math (translation required)': 'math',
'meta (translation required)': 'meta',
- #'imagemap': 'imagemap',
+ # 'imagemap': 'imagemap',
'image (translation required)': 'image', # obrazek
'figure (translation required)': 'figure', # a tady?
'include (translation required)': 'include',
@@ -63,8 +63,8 @@
'section-numbering (translation required)': 'sectnum',
'header (translation required)': 'header',
'footer (translation required)': 'footer',
- #'footnotes': 'footnotes',
- #'citations': 'citations',
+ # 'footnotes': 'footnotes',
+ # 'citations': 'citations',
'target-notes (translation required)': 'target-notes',
'restructuredtext-test-directive': 'restructuredtext-test-directive'}
"""Czech name to registered (in directives/__init__.py) directive name
Modified: trunk/docutils/docutils/parsers/rst/languages/da.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/da.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/languages/da.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -41,15 +41,15 @@
'pull-quote (translation required)': 'pull-quote',
'compound (translation required)': 'compound',
'container (translation required)': 'container',
- #'questions': 'questions',
+ # 'questions': 'questions',
'tabel': 'table',
'csv-tabel': 'csv-table',
'liste-tabel': 'list-table',
- #'qa': 'questions',
- #'faq': 'questions',
+ # 'qa': 'questions',
+ # 'faq': 'questions',
'meta': 'meta',
'math (translation required)': 'math',
- #'imagemap': 'imagemap',
+ # 'imagemap': 'imagemap',
'billede': 'image',
'figur': 'figure',
'inkludér': 'include',
@@ -67,8 +67,8 @@
'sektions-nummerering': 'sectnum',
'sidehovede': 'header',
'sidefod': 'footer',
- #'footnotes': 'footnotes',
- #'citations': 'citations',
+ # 'footnotes': 'footnotes',
+ # 'citations': 'citations',
'target-notes (translation required)': 'target-notes',
'restructuredtext-test-direktiv': 'restructuredtext-test-directive'}
"""Danish name to registered (in directives/__init__.py) directive name
Modified: trunk/docutils/docutils/parsers/rst/languages/de.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/de.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/languages/de.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -42,7 +42,7 @@
'zusammengesetzt': 'compound',
'verbund': 'compound',
'container': 'container',
- #'fragen': 'questions',
+ # 'fragen': 'questions',
'tabelle': 'table',
'csv-tabelle': 'csv-table',
'listentabelle': 'list-table',
@@ -49,7 +49,7 @@
'mathe': 'math',
'formel': 'math',
'meta': 'meta',
- #'imagemap': 'imagemap',
+ # 'imagemap': 'imagemap',
'bild': 'image',
'abbildung': 'figure',
'unverändert': 'raw',
@@ -70,8 +70,8 @@
'linkziel-fußnoten': 'target-notes',
'kopfzeilen': 'header',
'fußzeilen': 'footer',
- #'fußnoten': 'footnotes',
- #'zitate': 'citations',
+ # 'fußnoten': 'footnotes',
+ # 'zitate': 'citations',
}
"""German name to registered (in directives/__init__.py) directive name
mapping."""
Modified: trunk/docutils/docutils/parsers/rst/languages/en.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/en.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/languages/en.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -40,15 +40,15 @@
'pull-quote': 'pull-quote',
'compound': 'compound',
'container': 'container',
- #'questions': 'questions',
+ # 'questions': 'questions',
'table': 'table',
'csv-table': 'csv-table',
'list-table': 'list-table',
- #'qa': 'questions',
- #'faq': 'questions',
+ # 'qa': 'questions',
+ # 'faq': 'questions',
'meta': 'meta',
'math': 'math',
- #'imagemap': 'imagemap',
+ # 'imagemap': 'imagemap',
'image': 'image',
'figure': 'figure',
'include': 'include',
@@ -65,8 +65,8 @@
'section-numbering': 'sectnum',
'header': 'header',
'footer': 'footer',
- #'footnotes': 'footnotes',
- #'citations': 'citations',
+ # 'footnotes': 'footnotes',
+ # 'citations': 'citations',
'target-notes': 'target-notes',
'restructuredtext-test-directive': 'restructuredtext-test-directive'}
"""English name to registered (in directives/__init__.py) directive name
Modified: trunk/docutils/docutils/parsers/rst/languages/eo.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/eo.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/languages/eo.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -43,9 +43,9 @@
'kombina\u0135o': 'compound',
'tekstingo': 'container',
'enhavilo': 'container',
- #'questions': 'questions',
- #'qa': 'questions',
- #'faq': 'questions',
+ # 'questions': 'questions',
+ # 'qa': 'questions',
+ # 'faq': 'questions',
'tabelo': 'table',
'tabelo-vdk': 'csv-table', # "valoroj disigitaj per komoj"
'tabelo-csv': 'csv-table',
@@ -52,7 +52,7 @@
'tabelo-lista': 'list-table',
'meta': 'meta',
'math (translation required)': 'math',
- #'imagemap': 'imagemap',
+ # 'imagemap': 'imagemap',
'bildo': 'image',
'figuro': 'figure',
'inkludi': 'include',
@@ -70,8 +70,8 @@
'sekcia-numerado': 'sectnum',
'kapsekcio': 'header',
'piedsekcio': 'footer',
- #'footnotes': 'footnotes',
- #'citations': 'citations',
+ # 'footnotes': 'footnotes',
+ # 'citations': 'citations',
'celaj-notoj': 'target-notes',
'restructuredtext-test-directive': 'restructuredtext-test-directive'}
"""Esperanto name to registered (in directives/__init__.py) directive name
Modified: trunk/docutils/docutils/parsers/rst/languages/es.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/es.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/languages/es.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -42,9 +42,9 @@
'combinacion': 'compound',
'combinaci\u00f3n': 'compound',
'contenedor': 'container',
- #'questions': 'questions',
- #'qa': 'questions',
- #'faq': 'questions',
+ # 'questions': 'questions',
+ # 'qa': 'questions',
+ # 'faq': 'questions',
'tabla': 'table',
'tabla-vsc': 'csv-table',
'tabla-csv': 'csv-table',
@@ -51,7 +51,7 @@
'tabla-lista': 'list-table',
'meta': 'meta',
'math (translation required)': 'math',
- #'imagemap': 'imagemap',
+ # 'imagemap': 'imagemap',
'imagen': 'image',
'figura': 'figure',
'incluir': 'include',
@@ -74,8 +74,8 @@
'notas-destino': 'target-notes',
'cabecera': 'header',
'pie': 'footer',
- #'footnotes': 'footnotes',
- #'citations': 'citations',
+ # 'footnotes': 'footnotes',
+ # 'citations': 'citations',
'restructuredtext-test-directive': 'restructuredtext-test-directive'}
"""Spanish name to registered (in directives/__init__.py) directive name
mapping."""
Modified: trunk/docutils/docutils/parsers/rst/languages/fa.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/fa.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/languages/fa.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -40,15 +40,15 @@
'نقل-قول': 'pull-quote',
'ترکیب': 'compound',
'ظرف': 'container',
- #'questions': 'questions',
+ # 'questions': 'questions',
'جدول': 'table',
'جدول-csv': 'csv-table',
'جدول-لیست': 'list-table',
- #'qa': 'questions',
- #'faq': 'questions',
+ # 'qa': 'questions',
+ # 'faq': 'questions',
'متا': 'meta',
'ریاضی': 'math',
- #'imagemap': 'imagemap',
+ # 'imagemap': 'imagemap',
'تصویر': 'image',
'شکل': 'figure',
'شامل': 'include',
@@ -65,8 +65,8 @@
'شمارهگذاری-فصل': 'sectnum',
'سرآیند': 'header',
'پاصفحه': 'footer',
- #'footnotes': 'footnotes',
- #'citations': 'citations',
+ # 'footnotes': 'footnotes',
+ # 'citations': 'citations',
'یادداشت-هدف': 'target-notes',
}
"""Persian name to registered (in directives/__init__.py) directive name
Modified: trunk/docutils/docutils/parsers/rst/languages/fi.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/fi.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/languages/fi.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -41,10 +41,10 @@
'list-table (translation required)': 'list-table',
'compound (translation required)': 'compound',
'container (translation required)': 'container',
- #'kysymykset': 'questions',
+ # 'kysymykset': 'questions',
'meta': 'meta',
'math (translation required)': 'math',
- #'kuvakartta': 'imagemap',
+ # 'kuvakartta': 'imagemap',
'kuva': 'image',
'kaavio': 'figure',
'sis\u00e4llyt\u00e4': 'include',
@@ -60,8 +60,8 @@
'kappale': 'sectnum',
'header (translation required)': 'header',
'footer (translation required)': 'footer',
- #'alaviitteet': 'footnotes',
- #'viitaukset': 'citations',
+ # 'alaviitteet': 'footnotes',
+ # 'viitaukset': 'citations',
'target-notes (translation required)': 'target-notes'}
"""Finnish name to registered (in directives/__init__.py) directive name
mapping."""
Modified: trunk/docutils/docutils/parsers/rst/languages/fr.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/fr.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/languages/fr.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -39,15 +39,15 @@
'accroche': 'pull-quote',
'compound (translation required)': 'compound',
'container (translation required)': 'container',
- #'questions': 'questions',
- #'qr': 'questions',
- #'faq': 'questions',
+ # 'questions': 'questions',
+ # 'qr': 'questions',
+ # 'faq': 'questions',
'tableau': 'table',
'csv-table (translation required)': 'csv-table',
'list-table (translation required)': 'list-table',
'm\u00E9ta': 'meta',
'math (translation required)': 'math',
- #'imagemap (translation required)': 'imagemap',
+ # 'imagemap (translation required)': 'imagemap',
'image': 'image',
'figure': 'figure',
'inclure': 'include',
@@ -67,8 +67,8 @@
'liens': 'target-notes',
'header (translation required)': 'header',
'footer (translation required)': 'footer',
- #'footnotes (translation required)': 'footnotes',
- #'citations (translation required)': 'citations',
+ # 'footnotes (translation required)': 'footnotes',
+ # 'citations (translation required)': 'citations',
}
"""French name to registered (in directives/__init__.py) directive name
mapping."""
Modified: trunk/docutils/docutils/parsers/rst/languages/gl.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/gl.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/languages/gl.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -40,15 +40,15 @@
'coller-citaci\u00f3n': 'pull-quote',
'compor': 'compound',
'recipiente': 'container',
- #'questions': 'questions',
+ # 'questions': 'questions',
't\u00e1boa': 'table',
't\u00e1boa-csv': 'csv-table',
't\u00e1boa-listaxe': 'list-table',
- #'qa': 'questions',
- #'faq': 'questions',
+ # 'qa': 'questions',
+ # 'faq': 'questions',
'meta': 'meta',
'math (translation required)': 'math',
- #'imagemap': 'imagemap',
+ # 'imagemap': 'imagemap',
'imaxe': 'image',
'figura': 'figure',
'inclu\u00edr': 'include',
@@ -65,8 +65,8 @@
'secci\u00f3n-numerar': 'sectnum',
'cabeceira': 'header',
'p\u00e9 de p\u00e1xina': 'footer',
- #'footnotes': 'footnotes',
- #'citations': 'citations',
+ # 'footnotes': 'footnotes',
+ # 'citations': 'citations',
'notas-destino': 'target-notes',
'texto restruturado-proba-directiva': 'restructuredtext-test-directive'}
"""Galician name to registered (in directives/__init__.py) directive name
Modified: trunk/docutils/docutils/parsers/rst/languages/he.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/he.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/languages/he.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -38,15 +38,15 @@
'pull-quote': 'pull-quote',
'compound': 'compound',
'container': 'container',
- #'questions': 'questions',
+ # 'questions': 'questions',
'table': 'table',
'csv-table': 'csv-table',
'list-table': 'list-table',
- #'qa': 'questions',
- #'faq': 'questions',
+ # 'qa': 'questions',
+ # 'faq': 'questions',
'meta': 'meta',
'math (translation required)': 'math',
- #'imagemap': 'imagemap',
+ # 'imagemap': 'imagemap',
'\u05ea\u05de\u05d5\u05e0\u05d4': 'image',
'figure': 'figure',
'include': 'include',
@@ -63,8 +63,8 @@
'section-numbering': 'sectnum',
'header': 'header',
'footer': 'footer',
- #'footnotes': 'footnotes',
- #'citations': 'citations',
+ # 'footnotes': 'footnotes',
+ # 'citations': 'citations',
'target-notes': 'target-notes',
'restructuredtext-test-directive': 'restructuredtext-test-directive'}
"""English name to registered (in directives/__init__.py) directive name
Modified: trunk/docutils/docutils/parsers/rst/languages/it.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/it.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/languages/it.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -38,15 +38,15 @@
'estratto-evidenziato': 'pull-quote',
'composito': 'compound',
'container (translation required)': 'container',
- #'questions': 'questions',
- #'qa': 'questions',
- #'faq': 'questions',
+ # 'questions': 'questions',
+ # 'qa': 'questions',
+ # 'faq': 'questions',
'tabella': 'table',
'tabella-csv': 'csv-table',
'tabella-elenco': 'list-table',
'meta': 'meta',
'math (translation required)': 'math',
- #'imagemap': 'imagemap',
+ # 'imagemap': 'imagemap',
'immagine': 'image',
'figura': 'figure',
'includi': 'include',
@@ -65,8 +65,8 @@
'annota-riferimenti-esterni': 'target-notes',
'intestazione': 'header',
'piede-pagina': 'footer',
- #'footnotes': 'footnotes',
- #'citations': 'citations',
+ # 'footnotes': 'footnotes',
+ # 'citations': 'citations',
'restructuredtext-test-directive': 'restructuredtext-test-directive'}
"""Italian name to registered (in directives/__init__.py) directive name
mapping."""
Modified: trunk/docutils/docutils/parsers/rst/languages/ja.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/ja.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/languages/ja.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -46,12 +46,12 @@
'表': 'table',
'csv表': 'csv-table',
'リスト表': 'list-table',
- #'質問': 'questions',
- #'問答': 'questions',
- #'faq': 'questions',
+ # '質問': 'questions',
+ # '問答': 'questions',
+ # 'faq': 'questions',
'math (translation required)': 'math',
'メタ': 'meta',
- #'イメージマプ': 'imagemap',
+ # 'イメージマプ': 'imagemap',
'イメージ': 'image',
'画像': 'image',
'フィグア': 'figure',
@@ -77,8 +77,8 @@
'節数': 'sectnum',
'ヘッダ': 'header',
'フッタ': 'footer',
- #'脚注': 'footnotes', # 脚註?
- #'サイテーション': 'citations', # 出典 引証 引用
+ # '脚注': 'footnotes', # 脚註?
+ # 'サイテーション': 'citations', # 出典 引証 引用
'ターゲットノート': 'target-notes', # 的注 的脚注
}
"""Japanese name to registered (in directives/__init__.py) directive name
Modified: trunk/docutils/docutils/parsers/rst/languages/ko.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/ko.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/languages/ko.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -40,15 +40,15 @@
'발췌문': 'pull-quote',
'합성어': 'compound',
'컨테이너': 'container',
- #'질문': 'questions',
+ # '질문': 'questions',
'표': 'table',
'csv-표': 'csv-table',
'list-표': 'list-table',
- #'qa': 'questions',
- #'faq': 'questions',
+ # 'qa': 'questions',
+ # 'faq': 'questions',
'메타': 'meta',
'수학': 'math',
- #'이미지맵': 'imagemap',
+ # '이미지맵': 'imagemap',
'이미지': 'image',
'도표': 'figure',
'포함': 'include',
@@ -65,8 +65,8 @@
'섹션-번호-매기기': 'sectnum',
'머리말': 'header',
'꼬리말': 'footer',
- #'긱주': 'footnotes',
- #'인용구': 'citations',
+ # '긱주': 'footnotes',
+ # '인용구': 'citations',
'목표-노트': 'target-notes',
'restructuredtext 테스트 지시어': 'restructuredtext-test-directive'}
"""Korean name to registered (in directives/__init__.py) directive name
Modified: trunk/docutils/docutils/parsers/rst/languages/lt.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/lt.py 2022-03-04 15:54:22 UTC (rev 9021)
+++ trunk/docutils/docutils/parsers/rst/languages/lt.py 2022-03-04 15:54:56 UTC (rev 9022)
@@ -38,15 +38,15 @@
'atitraukta-citata': 'pull-quote',
'sudėtinis-darinys': 'compound',
'konteineris': 'container',
- #'questions': 'questions',
+ # 'questions': 'questions',
'lentelė': 'table',
'csv-lentelė': 'csv-table',
'sąrašo-lentelė': 'list-table',
- #'qa': 'questions',
- #'faq': 'questions',
+ # 'qa': 'questions',
+ # 'faq': 'questions',
'meta': 'meta',
'matematika': 'math',
- #'imagemap': 'imagemap',
+ # 'imagemap': 'imagemap',
'paveiksliukas': 'image',
'iliustracija': 'figure',
'pridėti': 'include',
@@ -63,...
[truncated message content] |
|
From: <mi...@us...> - 2022-03-04 15:55:16
|
Revision: 9023
http://sourceforge.net/p/docutils/code/9023
Author: milde
Date: 2022-03-04 15:55:13 +0000 (Fri, 04 Mar 2022)
Log Message:
-----------
Fix multiple spaces after keyword
flake8 rule E271
Modified Paths:
--------------
trunk/docutils/docutils/nodes.py
trunk/docutils/docutils/parsers/rst/states.py
trunk/docutils/docutils/transforms/references.py
trunk/docutils/docutils/utils/error_reporting.py
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/tox.ini
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2022-03-04 15:54:56 UTC (rev 9022)
+++ trunk/docutils/docutils/nodes.py 2022-03-04 15:55:13 UTC (rev 9023)
@@ -1384,7 +1384,7 @@
prefix = id + '-'
else:
prefix = id_prefix + auto_id_prefix
- if prefix.endswith('%'):
+ if prefix.endswith('%'):
prefix = '%s%s-' % (prefix[:-1],
suggested_prefix
or make_id(node.tagname))
@@ -2019,8 +2019,8 @@
Raise an exception unless overridden.
"""
- if (self.document.settings.strict_visitor
- or node.__class__.__name__ not in self.optional):
+ if (self.document.settings.strict_visitor
+ or node.__class__.__name__ not in self.optional):
raise NotImplementedError(
'%s visiting unknown node type: %s'
% (self.__class__, node.__class__.__name__))
@@ -2031,8 +2031,8 @@
Raise exception unless overridden.
"""
- if (self.document.settings.strict_visitor
- or node.__class__.__name__ not in self.optional):
+ if (self.document.settings.strict_visitor
+ or node.__class__.__name__ not in self.optional):
raise NotImplementedError(
'%s departing unknown node type: %s'
% (self.__class__, node.__class__.__name__))
Modified: trunk/docutils/docutils/parsers/rst/states.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/states.py 2022-03-04 15:54:56 UTC (rev 9022)
+++ trunk/docutils/docutils/parsers/rst/states.py 2022-03-04 15:55:13 UTC (rev 9023)
@@ -851,7 +851,7 @@
node_list = [reference]
if rawsource[-2:] == '__':
- if target and (aliastype == 'name'):
+ if target and (aliastype == 'name'):
reference['refname'] = alias
self.document.note_refname(reference)
# self.document.note_indirect_target(target) # required?
Modified: trunk/docutils/docutils/transforms/references.py
===================================================================
--- trunk/docutils/docutils/transforms/references.py 2022-03-04 15:54:56 UTC (rev 9022)
+++ trunk/docutils/docutils/transforms/references.py 2022-03-04 15:55:13 UTC (rev 9023)
@@ -696,15 +696,15 @@
parent = ref.parent
index = parent.index(ref)
- if ('ltrim' in subdef.attributes
- or 'trim' in subdef.attributes):
+ if ('ltrim' in subdef.attributes
+ or 'trim' in subdef.attributes):
if index > 0 and isinstance(parent[index - 1],
nodes.Text):
parent[index - 1] = parent[index - 1].rstrip()
- if ('rtrim' in subdef.attributes
- or 'trim' in subdef.attributes):
- if (len(parent) > index + 1
- and isinstance(parent[index + 1], nodes.Text)):
+ if ('rtrim' in subdef.attributes
+ or 'trim' in subdef.attributes):
+ if (len(parent) > index + 1
+ and isinstance(parent[index + 1], nodes.Text)):
parent[index + 1] = parent[index + 1].lstrip()
subdef_copy = subdef.deepcopy()
try:
Modified: trunk/docutils/docutils/utils/error_reporting.py
===================================================================
--- trunk/docutils/docutils/utils/error_reporting.py 2022-03-04 15:54:56 UTC (rev 9022)
+++ trunk/docutils/docutils/utils/error_reporting.py 2022-03-04 15:55:13 UTC (rev 9023)
@@ -135,7 +135,7 @@
return u
except UnicodeError as error: # catch ..Encode.. and ..Decode.. errors
if isinstance(self.data, EnvironmentError):
- return "[Errno %s] %s: '%s'" % (
+ return "[Errno %s] %s: '%s'" % (
self.data.errno,
SafeString(self.data.strerror, self.encoding,
self.decoding_errors),
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2022-03-04 15:54:56 UTC (rev 9022)
+++ trunk/docutils/docutils/writers/_html_base.py 2022-03-04 15:55:13 UTC (rev 9023)
@@ -1240,7 +1240,7 @@
math2html.DocumentParameters.displaymode = (math_env != '')
math_code = math2html.math2html(math_code)
elif self.math_output == 'mathml':
- if 'XHTML 1' in self.doctype:
+ if 'XHTML 1' in self.doctype:
self.doctype = self.doctype_mathml
self.content_type = self.content_type_mathml
converter = ' '.join(self.math_output_options).lower()
Modified: trunk/docutils/tox.ini
===================================================================
--- trunk/docutils/tox.ini 2022-03-04 15:54:56 UTC (rev 9022)
+++ trunk/docutils/tox.ini 2022-03-04 15:55:13 UTC (rev 9023)
@@ -38,7 +38,6 @@
# whitespace around the operators with the lowest priority(ies).
# Use your own judgment; …"
- E271, # multiple spaces after keyword
E301, # expected 1 blank line, found 0
E302, # expected 2 blank lines, found 1
E303, # too many blank lines (N)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-03-04 15:55:29
|
Revision: 9024
http://sourceforge.net/p/docutils/code/9024
Author: milde
Date: 2022-03-04 15:55:26 +0000 (Fri, 04 Mar 2022)
Log Message:
-----------
Fix (some) missing blank lines
flake8 rules
E301: expected 1 blank line, found 0
E306: expected 1 blank line before a nested definition, found 0
Modified Paths:
--------------
trunk/docutils/docutils/nodes.py
trunk/docutils/docutils/utils/math/latex2mathml.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/test/test_settings.py
trunk/docutils/test/test_statemachine.py
trunk/docutils/test/test_writers/test_odt.py
trunk/docutils/tox.ini
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2022-03-04 15:55:13 UTC (rev 9023)
+++ trunk/docutils/docutils/nodes.py 2022-03-04 15:55:26 UTC (rev 9024)
@@ -283,10 +283,10 @@
# implementations that use only new-style classes, like PyPy).
if isinstance(condition, type):
node_class = condition
+
def condition(node, node_class=node_class):
return isinstance(node, node_class)
-
if include_self and (condition is None or condition(self)):
yield self
if descend and len(self.children):
Modified: trunk/docutils/docutils/utils/math/latex2mathml.py
===================================================================
--- trunk/docutils/docutils/utils/math/latex2mathml.py 2022-03-04 15:55:13 UTC (rev 9023)
+++ trunk/docutils/docutils/utils/math/latex2mathml.py 2022-03-04 15:55:26 UTC (rev 9024)
@@ -363,8 +363,10 @@
# see `docutils.nodes.Element` for dict/list interface
def __getitem__(self, key):
return self.attributes[key]
+
def __setitem__(self, key, item):
self.attributes[key] = item
+
def get(self, *args, **kwargs):
return self.attributes.get(*args, **kwargs)
Modified: trunk/docutils/docutils/writers/docutils_xml.py
===================================================================
--- trunk/docutils/docutils/writers/docutils_xml.py 2022-03-04 15:55:13 UTC (rev 9023)
+++ trunk/docutils/docutils/writers/docutils_xml.py 2022-03-04 15:55:26 UTC (rev 9024)
@@ -143,7 +143,6 @@
if not self.in_simple:
self.output.append(self.newline)
-
# specific visit and depart methods
# ---------------------------------
Modified: trunk/docutils/docutils/writers/html4css1/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html4css1/__init__.py 2022-03-04 15:55:13 UTC (rev 9023)
+++ trunk/docutils/docutils/writers/html4css1/__init__.py 2022-03-04 15:55:26 UTC (rev 9024)
@@ -215,7 +215,7 @@
self.colspecs.append(node)
# "stubs" list is an attribute of the tgroup element:
node.parent.stubs.append(node.attributes.get('stub'))
- #
+
def depart_colspec(self, node):
# write out <colgroup> when all colspecs are processed
if isinstance(node.next_node(descend=False, siblings=True),
@@ -542,7 +542,7 @@
# html4css1 strives for IE6 compatibility.)
object_image_types = {'.svg': 'image/svg+xml',
'.swf': 'application/x-shockwave-flash'}
- #
+
def visit_image(self, node):
atts = {}
uri = node['uri']
@@ -864,7 +864,7 @@
# hard-coded vertical alignment
def visit_tbody(self, node):
self.body.append(self.starttag(node, 'tbody', valign='top'))
- #
+
def depart_tbody(self, node):
self.body.append('</tbody>\n')
@@ -880,7 +880,7 @@
# hard-coded vertical alignment
def visit_thead(self, node):
self.body.append(self.starttag(node, 'thead', valign='bottom'))
- #
+
def depart_thead(self, node):
self.body.append('</thead>\n')
Modified: trunk/docutils/docutils/writers/html5_polyglot/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2022-03-04 15:55:13 UTC (rev 9023)
+++ trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2022-03-04 15:55:26 UTC (rev 9024)
@@ -158,6 +158,7 @@
# use HTML block-level tags if matching class value found
supported_block_tags = {'ins', 'del'}
+
def visit_container(self, node):
# If there is exactly one of the "supported block tags" in
# the list of class values, use it as tag name:
@@ -175,7 +176,6 @@
def depart_container(self, node):
self.body.append('</%s>\n' % node.html5tagname)
-
# no standard meta tag name in HTML5, use dcterms.rights
# see https://wiki.whatwg.org/wiki/MetaExtensions
def visit_copyright(self, node):
@@ -310,8 +310,9 @@
supported_inline_tags = {'code', 'kbd', 'dfn', 'samp', 'var',
'bdi', 'del', 'ins', 'mark', 'small',
'b', 'i', 'q', 's', 'u'}
+
+ # Use `supported_inline_tags` if found in class values
def visit_inline(self, node):
- # Use `supported_inline_tags` if found in class values
classes = node['classes']
tags = [cls for cls in self.supported_inline_tags
if cls in classes]
@@ -389,6 +390,7 @@
node['xml:lang'] = node['lang']
meta = self.emptytag(node, 'meta', **node.non_default_attributes())
self.add_meta(meta)
+
def depart_meta(self, node):
pass
@@ -395,6 +397,7 @@
# no standard meta tag name in HTML5
def visit_organization(self, node):
self.visit_docinfo_item(node, 'organization', meta=False)
+
def depart_organization(self, node):
self.depart_docinfo_item()
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2022-03-04 15:55:13 UTC (rev 9023)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2022-03-04 15:55:26 UTC (rev 9024)
@@ -3057,6 +3057,7 @@
pass
_thead_depth = 0
+
def thead_depth(self):
return self._thead_depth
Modified: trunk/docutils/docutils/writers/manpage.py
===================================================================
--- trunk/docutils/docutils/writers/manpage.py 2022-03-04 15:55:13 UTC (rev 9023)
+++ trunk/docutils/docutils/writers/manpage.py 2022-03-04 15:55:26 UTC (rev 9024)
@@ -113,11 +113,14 @@
self._options = ['center']
self._tab_char = '\t'
self._coldefs = []
+
def new_row(self):
self._rows.append([])
+
def append_separator(self, separator):
"""Append the separator for table head."""
self._rows.append([separator])
+
def append_cell(self, cell_lines):
"""cell_lines is an array of lines"""
start = 0
@@ -126,6 +129,7 @@
self._rows[-1].append(cell_lines[start:])
if len(self._coldefs) < len(self._rows[-1]):
self._coldefs.append('l')
+
def _minimize_cell(self, cell_lines):
"""Remove leading and trailing blank and ``.sp`` lines"""
while cell_lines and cell_lines[0] in ('\n', '.sp\n'):
@@ -132,6 +136,7 @@
del cell_lines[0]
while cell_lines and cell_lines[-1] in ('\n', '.sp\n'):
del cell_lines[-1]
+
def as_list(self):
text = ['.TS\n']
text.append(' '.join(self._options) + ';\n')
@@ -349,6 +354,7 @@
def get_width(self):
return self._indent
+
def __repr__(self):
return 'enum_style-%s' % list(self._style)
Modified: trunk/docutils/test/test_settings.py
===================================================================
--- trunk/docutils/test/test_settings.py 2022-03-04 15:55:13 UTC (rev 9023)
+++ trunk/docutils/test/test_settings.py 2022-03-04 15:55:26 UTC (rev 9024)
@@ -282,6 +282,7 @@
('no', False),
('false', False),
)
+
def test_validate_boolean(self):
for t in self.boolean_settings:
self.assertEqual(
Modified: trunk/docutils/test/test_statemachine.py
===================================================================
--- trunk/docutils/test/test_statemachine.py 2022-03-04 15:55:13 UTC (rev 9023)
+++ trunk/docutils/test/test_statemachine.py 2022-03-04 15:55:26 UTC (rev 9024)
@@ -271,6 +271,7 @@
s2l_string = "hello\tthere\thow are\tyou?\n\tI'm fine\tthanks.\n"
s2l_expected = ['hello there how are you?',
" I'm fine thanks."]
+
def test_string2lines(self):
self.assertEqual(statemachine.string2lines(self.s2l_string),
self.s2l_expected)
Modified: trunk/docutils/test/test_writers/test_odt.py
===================================================================
--- trunk/docutils/test/test_writers/test_odt.py 2022-03-04 15:55:13 UTC (rev 9023)
+++ trunk/docutils/test/test_writers/test_odt.py 2022-03-04 15:55:26 UTC (rev 9024)
@@ -172,6 +172,7 @@
def test_odt_footnotes(self):
self.process_test('odt_footnotes.txt', 'odt_footnotes.odt',
save_output_name='odt_footnotes.odt')
+
def test_odt_raw(self):
self.process_test('odt_raw.txt', 'odt_raw.odt',
save_output_name='odt_raw.odt')
Modified: trunk/docutils/tox.ini
===================================================================
--- trunk/docutils/tox.ini 2022-03-04 15:55:13 UTC (rev 9023)
+++ trunk/docutils/tox.ini 2022-03-04 15:55:26 UTC (rev 9024)
@@ -38,11 +38,9 @@
# whitespace around the operators with the lowest priority(ies).
# Use your own judgment; …"
- E301, # expected 1 blank line, found 0
E302, # expected 2 blank lines, found 1
E303, # too many blank lines (N)
E305, # expected 2 blank lines after class or function definition, found 1
- E306, # expected 1 blank line before a nested definition, found 0
E401, # multiple imports on one line
E402, # module level import not at top of file
E501, # line too long (N > 79 characters)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-03-04 15:55:55
|
Revision: 9025
http://sourceforge.net/p/docutils/code/9025
Author: milde
Date: 2022-03-04 15:55:47 +0000 (Fri, 04 Mar 2022)
Log Message:
-----------
Remove excess blank lines.
flakei rule E303: too many blank lines (N)
Modified Paths:
--------------
trunk/docutils/docutils/nodes.py
trunk/docutils/docutils/parsers/rst/directives/tables.py
trunk/docutils/docutils/parsers/rst/states.py
trunk/docutils/docutils/statemachine.py
trunk/docutils/docutils/transforms/references.py
trunk/docutils/docutils/utils/error_reporting.py
trunk/docutils/docutils/utils/math/latex2mathml.py
trunk/docutils/docutils/utils/math/math2html.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/latex2e/__init__.py
trunk/docutils/test/test__init__.py
trunk/docutils/test/test_error_reporting.py
trunk/docutils/test/test_io.py
trunk/docutils/test/test_parsers/test_recommonmark/test_html_blocks.py
trunk/docutils/test/test_publisher.py
trunk/docutils/test/test_transforms/test_peps.py
trunk/docutils/test/test_traversals.py
trunk/docutils/test/test_utils.py
trunk/docutils/test/test_viewlist.py
trunk/docutils/test/test_writers/test_html4css1_template.py
trunk/docutils/tox.ini
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/docutils/nodes.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -1879,7 +1879,6 @@
"""
-
# =================
# Inline Elements
# =================
@@ -2131,7 +2130,6 @@
"""
-
class SkipChildren(TreePruningException):
"""
@@ -2140,7 +2138,6 @@
"""
-
class SkipSiblings(TreePruningException):
"""
@@ -2149,7 +2146,6 @@
"""
-
class SkipNode(TreePruningException):
"""
@@ -2158,7 +2154,6 @@
"""
-
class SkipDeparture(TreePruningException):
"""
@@ -2167,7 +2162,6 @@
"""
-
class NodeFound(TreePruningException):
"""
@@ -2177,7 +2171,6 @@
"""
-
class StopTraversal(TreePruningException):
"""
@@ -2189,7 +2182,6 @@
"""
-
def make_id(string):
"""
Convert `string` into an identifier and return it.
Modified: trunk/docutils/docutils/parsers/rst/directives/tables.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/tables.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/docutils/parsers/rst/directives/tables.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -218,7 +218,6 @@
self.escapechar = options['escape']
csv.Dialect.__init__(self)
-
class HeaderDialect(csv.Dialect):
"""CSV dialect to use for the "header" option data."""
Modified: trunk/docutils/docutils/parsers/rst/states.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/states.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/docutils/parsers/rst/states.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -226,7 +226,6 @@
if not hasattr(self.reporter, 'get_source_and_line'):
self.reporter.get_source_and_line = self.state_machine.get_source_and_line
-
def goto_line(self, abs_line_offset):
"""
Jump to input line `abs_line_offset`, ignoring jumps past the end.
@@ -876,7 +875,6 @@
self.document.note_refname(reference)
return before, node_list, after, []
-
def adjust_uri(self, uri):
match = self.patterns.email.match(uri)
if match:
@@ -1834,7 +1832,6 @@
node=entry)
return row
-
explicit = Struct()
"""Patterns and constants used for explicit markup recognition."""
Modified: trunk/docutils/docutils/statemachine.py
===================================================================
--- trunk/docutils/docutils/statemachine.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/docutils/statemachine.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -173,7 +173,6 @@
self._stderr = io.ErrorOutput()
"""Wrapper around sys.stderr catching en-/decoding errors"""
-
def unlink(self):
"""Remove circular references to objects no longer required."""
for state in self.states.values():
Modified: trunk/docutils/docutils/transforms/references.py
===================================================================
--- trunk/docutils/docutils/transforms/references.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/docutils/transforms/references.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -763,7 +763,6 @@
"""The TargetNotes transform has to be applied after `IndirectHyperlinks`
but before `Footnotes`."""
-
def __init__(self, document, startnode):
Transform.__init__(self, document, startnode=startnode)
Modified: trunk/docutils/docutils/utils/error_reporting.py
===================================================================
--- trunk/docutils/docutils/utils/error_reporting.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/docutils/utils/error_reporting.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -98,7 +98,6 @@
self.encoding_errors = encoding_errors
self.decoding_errors = decoding_errors
-
def __str__(self):
try:
return str(self.data)
Modified: trunk/docutils/docutils/utils/math/latex2mathml.py
===================================================================
--- trunk/docutils/docutils/utils/math/latex2mathml.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/docutils/utils/math/latex2mathml.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -704,7 +704,6 @@
return string[1:split_index-1], string[split_index:]
-
# >>> tex_group('{} empty group')
# ('', ' empty group')
# >>> tex_group('{group with {nested} group} ')
@@ -939,7 +938,6 @@
node.append(style)
return style, string
-
# operator, fence, or separator -> <mo>
if name == 'colon': # trailing punctuation, not binary relation
@@ -1038,7 +1036,6 @@
node.append(new_node)
return new_node, string
-
# Complex elements (Layout schemata)
# ==================================
Modified: trunk/docutils/docutils/utils/math/math2html.py
===================================================================
--- trunk/docutils/docutils/utils/math/math2html.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/docutils/utils/math/math2html.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -864,7 +864,6 @@
return contents
-
class ContainerOutput:
"The generic HTML output for a container."
@@ -2866,7 +2865,6 @@
]
-
class ParameterDefinition:
"The definition of a parameter in a hybrid function."
"[] parameters are optional, {} parameters are mandatory."
@@ -3106,7 +3104,6 @@
FormulaCommand.types += [HybridFunction]
-
def math2html(formula):
"Convert some TeX math to HTML."
factory = FormulaFactory()
Modified: trunk/docutils/docutils/utils/smartquotes.py
===================================================================
--- trunk/docutils/docutils/utils/smartquotes.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/docutils/utils/smartquotes.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -621,7 +621,6 @@
yield text
-
def educateQuotes(text, language='en'):
"""
Parameter: - text string (unicode or bytes).
@@ -792,7 +791,6 @@
return text
-
def educateEllipses(text):
"""
Parameter: String (unicode or bytes).
@@ -919,7 +917,6 @@
else:
defaultlanguage = 'en'
-
import argparse
parser = argparse.ArgumentParser(
description='Filter <input> making ASCII punctuation "smart".')
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/docutils/writers/_html_base.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -275,7 +275,6 @@
}
"""Character references for characters with a special meaning in HTML."""
-
def __init__(self, document):
nodes.NodeVisitor.__init__(self, document)
self.settings = settings = document.settings
Modified: trunk/docutils/docutils/writers/docutils_xml.py
===================================================================
--- trunk/docutils/docutils/writers/docutils_xml.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/docutils/writers/docutils_xml.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -17,7 +17,6 @@
from docutils import frontend, writers, nodes
-
class RawXmlError(docutils.ApplicationError): pass
Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -2195,7 +2195,6 @@
self.out.append('\n\\setcounter{%s}{%d}' %
(counter_name, node['start']-1))
-
def depart_enumerated_list(self, node):
if len(self._enumeration_counters) <= 4:
self.out.append('\\end{enumerate}\n')
Modified: trunk/docutils/test/test__init__.py
===================================================================
--- trunk/docutils/test/test__init__.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/test/test__init__.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -63,7 +63,6 @@
self.assertEqual(type(docutils.__version_info__.serial), int)
self.assertEqual(type(docutils.__version_info__.release), bool)
-
def test__version__(self):
"""Test that __version__ is equivalent to __version_info__."""
self.assertEqual(
Modified: trunk/docutils/test/test_error_reporting.py
===================================================================
--- trunk/docutils/test/test_error_reporting.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/test/test_error_reporting.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -218,7 +218,6 @@
self.assertEqual(str(self.uose), str(self.wuose))
-
class ErrorReportingTests(unittest.TestCase):
"""
Test cases where error reporting can go wrong.
Modified: trunk/docutils/test/test_io.py
===================================================================
--- trunk/docutils/test/test_io.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/test/test_io.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -77,8 +77,6 @@
io.error_string(ImportError(us)))
-
-
class InputTests(unittest.TestCase):
def test_bom(self):
Modified: trunk/docutils/test/test_parsers/test_recommonmark/test_html_blocks.py
===================================================================
--- trunk/docutils/test/test_parsers/test_recommonmark/test_html_blocks.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/test/test_parsers/test_recommonmark/test_html_blocks.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -88,7 +88,6 @@
]
-
if __name__ == '__main__':
import unittest
unittest.main(defaultTest='suite')
Modified: trunk/docutils/test/test_publisher.py
===================================================================
--- trunk/docutils/test/test_publisher.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/test/test_publisher.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -64,7 +64,6 @@
core.publish_cmdline(argv=['nonexisting/path'],
settings_overrides={'traceback': True})
-
def test_output_error_handling(self):
# pass IOErrors to calling application if `traceback` is True
with self.assertRaises(io.OutputError):
Modified: trunk/docutils/test/test_transforms/test_peps.py
===================================================================
--- trunk/docutils/test/test_transforms/test_peps.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/test/test_transforms/test_peps.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -62,7 +62,6 @@
])
-
if __name__ == '__main__':
import unittest
unittest.main(defaultTest='suite')
Modified: trunk/docutils/test/test_traversals.py
===================================================================
--- trunk/docutils/test/test_traversals.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/test/test_traversals.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -15,7 +15,6 @@
import docutils
-
stop_traversal_input = '''
==================
Train Travel
Modified: trunk/docutils/test/test_utils.py
===================================================================
--- trunk/docutils/test/test_utils.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/test/test_utils.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -72,7 +72,6 @@
self.assertEqual(self.stream.getvalue(), 'test data:: (SEVERE/4) '
'a severe error, raises an exception\n')
-
def test_unicode_message(self):
sw = self.reporter.system_message(0, 'mesidʒ')
self.assertEqual(sw.pformat(), """\
@@ -381,7 +380,5 @@
utils.get_stylesheet_list(self)
-
-
if __name__ == '__main__':
unittest.main()
Modified: trunk/docutils/test/test_viewlist.py
===================================================================
--- trunk/docutils/test/test_viewlist.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/test/test_viewlist.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -190,7 +190,6 @@
literal
block"""
-
def setUp(self):
self.a_list = self.text.splitlines(True)
self.a = statemachine.StringList(self.a_list, 'a')
Modified: trunk/docutils/test/test_writers/test_html4css1_template.py
===================================================================
--- trunk/docutils/test/test_writers/test_html4css1_template.py 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/test/test_writers/test_html4css1_template.py 2022-03-04 15:55:47 UTC (rev 9025)
@@ -31,7 +31,6 @@
drive_prefix = ""
-
totest = {}
totest['template'] = [
Modified: trunk/docutils/tox.ini
===================================================================
--- trunk/docutils/tox.ini 2022-03-04 15:55:26 UTC (rev 9024)
+++ trunk/docutils/tox.ini 2022-03-04 15:55:47 UTC (rev 9025)
@@ -39,7 +39,6 @@
# Use your own judgment; …"
E302, # expected 2 blank lines, found 1
- E303, # too many blank lines (N)
E305, # expected 2 blank lines after class or function definition, found 1
E401, # multiple imports on one line
E402, # module level import not at top of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mi...@us...> - 2022-03-04 15:57:19
|
Revision: 9026
http://sourceforge.net/p/docutils/code/9026
Author: milde
Date: 2022-03-04 15:57:13 +0000 (Fri, 04 Mar 2022)
Log Message:
-----------
Ensure 2 blank lines around top-level functions and classes.
flake8 rules
E302: expected 2 blank lines, found 1
E305: expected 2 blank lines after class or function definition
Modified Paths:
--------------
trunk/docutils/docutils/__init__.py
trunk/docutils/docutils/core.py
trunk/docutils/docutils/examples.py
trunk/docutils/docutils/frontend.py
trunk/docutils/docutils/io.py
trunk/docutils/docutils/nodes.py
trunk/docutils/docutils/parsers/__init__.py
trunk/docutils/docutils/parsers/rst/directives/__init__.py
trunk/docutils/docutils/parsers/rst/directives/misc.py
trunk/docutils/docutils/parsers/rst/languages/__init__.py
trunk/docutils/docutils/parsers/rst/roles.py
trunk/docutils/docutils/parsers/rst/states.py
trunk/docutils/docutils/readers/__init__.py
trunk/docutils/docutils/statemachine.py
trunk/docutils/docutils/transforms/peps.py
trunk/docutils/docutils/utils/__init__.py
trunk/docutils/docutils/utils/code_analyzer.py
trunk/docutils/docutils/utils/error_reporting.py
trunk/docutils/docutils/utils/math/__init__.py
trunk/docutils/docutils/utils/math/latex2mathml.py
trunk/docutils/docutils/utils/math/math2html.py
trunk/docutils/docutils/utils/math/tex2mathml_extern.py
trunk/docutils/docutils/utils/punctuation_chars.py
trunk/docutils/docutils/utils/roman.py
trunk/docutils/docutils/utils/smartquotes.py
trunk/docutils/docutils/writers/__init__.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/s5_html/__init__.py
trunk/docutils/docutils/writers/xetex/__init__.py
trunk/docutils/test/DocutilsTestSupport.py
trunk/docutils/test/functional/tests/standalone_rst_s5_html_1.py
trunk/docutils/test/local-parser.py
trunk/docutils/test/local-reader.py
trunk/docutils/test/local-writer.py
trunk/docutils/test/package_unittest.py
trunk/docutils/test/test_dependencies.py
trunk/docutils/test/test_error_reporting.py
trunk/docutils/test/test_language.py
trunk/docutils/test/test_nodes.py
trunk/docutils/test/test_parsers/test_get_parser_class.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_enumerated_lists.py
trunk/docutils/test/test_parsers/test_recommonmark/test_html_blocks.py
trunk/docutils/test/test_parsers/test_recommonmark/test_inline_markup.py
trunk/docutils/test/test_parsers/test_recommonmark/test_line_length_limit.py
trunk/docutils/test/test_parsers/test_recommonmark/test_line_length_limit_default.py
trunk/docutils/test/test_parsers/test_recommonmark/test_literal_blocks.py
trunk/docutils/test/test_parsers/test_recommonmark/test_misc.py
trunk/docutils/test/test_parsers/test_recommonmark/test_paragraphs.py
trunk/docutils/test/test_parsers/test_recommonmark/test_section_headers.py
trunk/docutils/test/test_parsers/test_recommonmark/test_targets.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_parsers/test_rst/test_TableParser.py
trunk/docutils/test/test_parsers/test_rst/test_block_quotes.py
trunk/docutils/test/test_parsers/test_rst/test_bullet_lists.py
trunk/docutils/test/test_parsers/test_rst/test_character_level_inline_markup.py
trunk/docutils/test/test_parsers/test_rst/test_citations.py
trunk/docutils/test/test_parsers/test_rst/test_comments.py
trunk/docutils/test/test_parsers/test_rst/test_definition_lists.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test__init__.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_admonitions.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_admonitions_de.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_block_quotes.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_class.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_code.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_code_long.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_code_none.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_compound.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_container.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_contents.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_date.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_decorations.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_default_role.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_figures.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_images.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_include.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_line_blocks.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_math.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_meta.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_parsed_literals.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_raw.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_replace.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_replace_fr.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_role.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_rubrics.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_sectnum.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_sidebars.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_tables.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_target_notes.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_test_directives.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_title.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_topics.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_unicode.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_unknown.py
trunk/docutils/test/test_parsers/test_rst/test_doctest_blocks.py
trunk/docutils/test/test_parsers/test_rst/test_east_asian_text.py
trunk/docutils/test/test_parsers/test_rst/test_enumerated_lists.py
trunk/docutils/test/test_parsers/test_rst/test_field_lists.py
trunk/docutils/test/test_parsers/test_rst/test_footnotes.py
trunk/docutils/test/test_parsers/test_rst/test_inline_markup.py
trunk/docutils/test/test_parsers/test_rst/test_interpreted.py
trunk/docutils/test/test_parsers/test_rst/test_interpreted_fr.py
trunk/docutils/test/test_parsers/test_rst/test_line_blocks.py
trunk/docutils/test/test_parsers/test_rst/test_line_length_limit.py
trunk/docutils/test/test_parsers/test_rst/test_line_length_limit_default.py
trunk/docutils/test/test_parsers/test_rst/test_literal_blocks.py
trunk/docutils/test/test_parsers/test_rst/test_option_lists.py
trunk/docutils/test/test_parsers/test_rst/test_outdenting.py
trunk/docutils/test/test_parsers/test_rst/test_paragraphs.py
trunk/docutils/test/test_parsers/test_rst/test_section_headers.py
trunk/docutils/test/test_parsers/test_rst/test_source_line.py
trunk/docutils/test/test_parsers/test_rst/test_substitutions.py
trunk/docutils/test/test_parsers/test_rst/test_tables.py
trunk/docutils/test/test_parsers/test_rst/test_targets.py
trunk/docutils/test/test_parsers/test_rst/test_transitions.py
trunk/docutils/test/test_readers/test_get_reader_class.py
trunk/docutils/test/test_readers/test_pep/test_rfc2822.py
trunk/docutils/test/test_settings.py
trunk/docutils/test/test_transforms/itest_hyperlinks_de.py
trunk/docutils/test/test_transforms/test_class.py
trunk/docutils/test/test_transforms/test_contents.py
trunk/docutils/test/test_transforms/test_docinfo.py
trunk/docutils/test/test_transforms/test_doctitle.py
trunk/docutils/test/test_transforms/test_filter.py
trunk/docutils/test/test_transforms/test_filter_messages.py
trunk/docutils/test/test_transforms/test_footnotes.py
trunk/docutils/test/test_transforms/test_hyperlinks.py
trunk/docutils/test/test_transforms/test_messages.py
trunk/docutils/test/test_transforms/test_peps.py
trunk/docutils/test/test_transforms/test_sectnum.py
trunk/docutils/test/test_transforms/test_strip_comments.py
trunk/docutils/test/test_transforms/test_strip_elements_with_class.py
trunk/docutils/test/test_transforms/test_substitution_expansion_length_limit.py
trunk/docutils/test/test_transforms/test_substitutions.py
trunk/docutils/test/test_transforms/test_target_notes.py
trunk/docutils/test/test_transforms/test_writer_aux.py
trunk/docutils/test/test_traversals.py
trunk/docutils/test/test_utils.py
trunk/docutils/test/test_writers/test_docutils_xml.py
trunk/docutils/test/test_writers/test_get_writer_class.py
trunk/docutils/test/test_writers/test_html4css1_misc.py
trunk/docutils/test/test_writers/test_html4css1_template.py
trunk/docutils/test/test_writers/test_html5_polyglot_misc.py
trunk/docutils/test/test_writers/test_html5_polyglot_parts.py
trunk/docutils/test/test_writers/test_latex2e.py
trunk/docutils/test/test_writers/test_latex2e_misc.py
trunk/docutils/test/test_writers/test_manpage.py
trunk/docutils/test/test_writers/test_null.py
trunk/docutils/test/test_writers/test_pseudoxml.py
trunk/docutils/test/test_writers/test_s5.py
trunk/docutils/tools/dev/create_unimap.py
trunk/docutils/tools/dev/generate_punctuation_chars.py
trunk/docutils/tools/dev/unicode2rstsubs.py
trunk/docutils/tools/quicktest.py
trunk/docutils/tools/test/test_buildhtml.py
trunk/docutils/tox.ini
Modified: trunk/docutils/docutils/__init__.py
===================================================================
--- trunk/docutils/docutils/__init__.py 2022-03-04 15:55:47 UTC (rev 9025)
+++ trunk/docutils/docutils/__init__.py 2022-03-04 15:57:13 UTC (rev 9026)
@@ -126,7 +126,6 @@
class ApplicationError(Exception): pass
-
class DataError(ApplicationError): pass
Modified: trunk/docutils/docutils/core.py
===================================================================
--- trunk/docutils/docutils/core.py 2022-03-04 15:55:47 UTC (rev 9025)
+++ trunk/docutils/docutils/core.py 2022-03-04 15:57:13 UTC (rev 9026)
@@ -22,6 +22,7 @@
from docutils.transforms import Transformer
import docutils.readers.doctree
+
class Publisher:
"""
@@ -310,6 +311,7 @@
self.settings.output_encoding_error_handler,
__version__, sys.version.split()[0]))
+
default_usage = '%prog [options] [<source> [<destination>]]'
default_description = ('Reads from <source> (default is stdin) and writes to '
'<destination> (default is stdout). See '
@@ -316,6 +318,7 @@
'<https://docutils.sourceforge.io/docs/user/config.html> for '
'the full reference.')
+
def publish_cmdline(reader=None, reader_name='standalone',
parser=None, parser_name='restructuredtext',
writer=None, writer_name='pseudoxml',
@@ -343,6 +346,7 @@
config_section=config_section, enable_exit_status=enable_exit_status)
return output
+
def publish_file(source=None, source_path=None,
destination=None, destination_path=None,
reader=None, reader_name='standalone',
@@ -369,6 +373,7 @@
enable_exit_status=enable_exit_status)
return output
+
def publish_string(source, source_path=None, destination_path=None,
reader=None, reader_name='standalone',
parser=None, parser_name='restructuredtext',
@@ -405,6 +410,7 @@
enable_exit_status=enable_exit_status)
return output
+
def publish_parts(source, source_path=None, source_class=io.StringInput,
destination_path=None,
reader=None, reader_name='standalone',
@@ -439,6 +445,7 @@
enable_exit_status=enable_exit_status)
return pub.writer.parts
+
def publish_doctree(source, source_path=None,
source_class=io.StringInput,
reader=None, reader_name='standalone',
@@ -470,6 +477,7 @@
output = pub.publish(enable_exit_status=enable_exit_status)
return pub.document
+
def publish_from_doctree(document, destination_path=None,
writer=None, writer_name='pseudoxml',
settings=None, settings_spec=None,
@@ -509,6 +517,7 @@
pub.set_destination(None, destination_path)
return pub.publish(enable_exit_status=enable_exit_status)
+
def publish_cmdline_to_binary(reader=None, reader_name='standalone',
parser=None, parser_name='restructuredtext',
writer=None, writer_name='pseudoxml',
@@ -546,6 +555,7 @@
config_section=config_section, enable_exit_status=enable_exit_status)
return output
+
def publish_programmatically(source_class, source, source_path,
destination_class, destination, destination_path,
reader, reader_name,
Modified: trunk/docutils/docutils/examples.py
===================================================================
--- trunk/docutils/docutils/examples.py 2022-03-04 15:55:47 UTC (rev 9025)
+++ trunk/docutils/docutils/examples.py 2022-03-04 15:57:13 UTC (rev 9026)
@@ -49,6 +49,7 @@
writer_name='html', settings_overrides=overrides)
return parts
+
def html_body(input_string, source_path=None, destination_path=None,
input_encoding='unicode', output_encoding='unicode',
doctitle=True, initial_header_level=1):
@@ -72,6 +73,7 @@
fragment = fragment.encode(output_encoding)
return fragment
+
def internals(input_string, source_path=None, destination_path=None,
input_encoding='unicode', settings_overrides=None):
"""
Modified: trunk/docutils/docutils/frontend.py
===================================================================
--- trunk/docutils/docutils/frontend.py 2022-03-04 15:55:47 UTC (rev 9025)
+++ trunk/docutils/docutils/frontend.py 2022-03-04 15:57:13 UTC (rev 9026)
@@ -62,6 +62,7 @@
for key, value in kwargs.items():
setattr(parser.values, key, value)
+
def read_config_file(option, opt, value, parser):
"""
Read a configuration file during option processing. (Option callback.)
@@ -72,6 +73,7 @@
parser.error(err)
parser.values.update(new_settings, parser)
+
def validate_encoding(setting, value, option_parser,
config_parser=None, config_section=None):
try:
@@ -81,6 +83,7 @@
% (setting, value))
return value
+
def validate_encoding_error_handler(setting, value, option_parser,
config_parser=None, config_section=None):
try:
@@ -93,6 +96,7 @@
'the Python ``codecs`` module)' % value)
return value
+
def validate_encoding_and_error_handler(
setting, value, option_parser, config_parser=None, config_section=None):
"""
@@ -115,6 +119,7 @@
config_parser, config_section)
return encoding
+
def validate_boolean(setting, value, option_parser,
config_parser=None, config_section=None):
"""Check/normalize boolean settings:
@@ -128,6 +133,7 @@
except KeyError:
raise LookupError('unknown boolean value: "%s"' % value)
+
def validate_ternary(setting, value, option_parser,
config_parser=None, config_section=None):
"""Check/normalize three-value settings:
@@ -142,6 +148,7 @@
except KeyError:
return value
+
def validate_nonnegative_int(setting, value, option_parser,
config_parser=None, config_section=None):
value = int(value)
@@ -149,6 +156,7 @@
raise ValueError('negative value; must be positive or zero')
return value
+
def validate_threshold(setting, value, option_parser,
config_parser=None, config_section=None):
try:
@@ -159,6 +167,7 @@
except (KeyError, AttributeError):
raise LookupError('unknown threshold: %r.' % value)
+
def validate_colon_separated_string_list(
setting, value, option_parser, config_parser=None, config_section=None):
if not isinstance(value, list):
@@ -168,6 +177,7 @@
value.extend(last.split(':'))
return value
+
def validate_comma_separated_list(setting, value, option_parser,
config_parser=None, config_section=None):
"""Check/normalize list arguments (split at "," and strip whitespace).
@@ -183,6 +193,7 @@
value.extend(items)
return value
+
def validate_url_trailing_slash(
setting, value, option_parser, config_parser=None, config_section=None):
if not value:
@@ -192,6 +203,7 @@
else:
return value + '/'
+
def validate_dependency_file(setting, value, option_parser,
config_parser=None, config_section=None):
try:
@@ -200,6 +212,7 @@
# TODO: warn/info?
return docutils.utils.DependencyList(None)
+
def validate_strip_class(setting, value, option_parser,
config_parser=None, config_section=None):
# value is a comma separated string list:
@@ -213,6 +226,7 @@
% (cls, normalized))
return value
+
def validate_smartquotes_locales(setting, value, option_parser,
config_parser=None, config_section=None):
"""Check/normalize a comma separated list of smart quote definitions.
@@ -248,6 +262,7 @@
lc_quotes.append((lang, quotes))
return lc_quotes
+
def make_paths_absolute(pathdict, keys, base_path=None):
"""
Interpret filesystem path settings relative to the `base_path` given.
@@ -267,9 +282,11 @@
value = make_one_path_absolute(base_path, value)
pathdict[key] = value
+
def make_one_path_absolute(base_path, path):
return os.path.abspath(os.path.join(base_path, path))
+
def filter_settings_spec(settings_spec, *exclude, **replace):
"""Return a copy of `settings_spec` excluding/replacing some settings.
@@ -861,5 +878,6 @@
except KeyError:
return {}
+
class ConfigDeprecationWarning(FutureWarning):
"""Warning for deprecated configuration file features."""
Modified: trunk/docutils/docutils/io.py
===================================================================
--- trunk/docutils/docutils/io.py 2022-03-04 15:55:47 UTC (rev 9025)
+++ trunk/docutils/docutils/io.py 2022-03-04 15:57:13 UTC (rev 9026)
@@ -58,6 +58,7 @@
except (LookupError, AttributeError, TypeError):
return None
+
def error_string(err):
"""Return string representation of Exception `err`.
"""
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2022-03-04 15:55:47 UTC (rev 9025)
+++ trunk/docutils/docutils/nodes.py 2022-03-04 15:57:13 UTC (rev 9026)
@@ -351,6 +351,7 @@
DeprecationWarning, stacklevel=2)
return s
+
# definition moved here from `utils` to avoid circular import dependency
def unescape(text, restore_backslashes=False, respect_whitespace=False):
"""
@@ -439,6 +440,7 @@
def lstrip(self, chars=None):
return self.__class__(str.lstrip(self, chars))
+
class Element(Node):
"""
@@ -1607,6 +1609,7 @@
class meta(PreBibliographic, Element):
"""Container for "invisible" bibliographic data, or meta-data."""
+
# ========================
# Bibliographic Elements
# ========================
@@ -2073,15 +2076,19 @@
"""Override for generic, uniform traversals."""
raise NotImplementedError
+
def _call_default_visit(self, node):
self.default_visit(node)
+
def _call_default_departure(self, node):
self.default_departure(node)
+
def _nop(self, node):
pass
+
def _add_node_class_names(names):
"""Save typing with dynamic assignments:"""
for _name in names:
@@ -2090,6 +2097,7 @@
setattr(SparseNodeVisitor, 'visit_' + _name, _nop)
setattr(SparseNodeVisitor, 'depart_' + _name, _nop)
+
_add_node_class_names(node_class_names)
@@ -2229,6 +2237,7 @@
id = _non_id_at_ends.sub('', id)
return str(id)
+
_non_id_chars = re.compile('[^a-z0-9]+')
_non_id_at_ends = re.compile('^[-0-9]+|-+$')
_non_id_translate = {
@@ -2274,6 +2283,7 @@
0x0239: 'qp', # qp digraph
}
+
def dupname(node, name):
node['dupnames'].append(name)
node['names'].remove(name)
@@ -2281,18 +2291,22 @@
# don't want to throw unnecessary system_messages.
node.referenced = 1
+
def fully_normalize_name(name):
"""Return a case- and whitespace-normalized name."""
return ' '.join(name.lower().split())
+
def whitespace_normalize_name(name):
"""Return a whitespace-normalized name."""
return ' '.join(name.split())
+
def serial_escape(value):
"""Escape string values that are elements of a list, for serialization."""
return value.replace('\\', r'\\').replace(' ', r'\ ')
+
def pseudo_quoteattr(value):
"""Quote attributes for pseudo-xml"""
return '"%s"' % value
Modified: trunk/docutils/docutils/parsers/__init__.py
===================================================================
--- trunk/docutils/docutils/parsers/__init__.py 2022-03-04 15:55:47 UTC (rev 9025)
+++ trunk/docutils/docutils/parsers/__init__.py 2022-03-04 15:57:13 UTC (rev 9026)
@@ -81,6 +81,7 @@
'markdown': 'docutils.parsers.recommonmark_wrapper',
}
+
def get_parser_class(parser_name):
"""Return the Parser class from the `parser_name` module."""
name = parser_name.lower()
Modified: trunk/docutils/docutils/parsers/rst/directives/__init__.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/__init__.py 2022-03-04 15:55:47 UTC (rev 9025)
+++ trunk/docutils/docutils/parsers/rst/directives/__init__.py 2022-03-04 15:57:13 UTC (rev 9026)
@@ -73,6 +73,7 @@
_directives = {}
"""Cache of imported directives."""
+
def directive(directive_name, language_module, document):
"""
Locate and return a directive function from its language-dependent name.
@@ -131,6 +132,7 @@
return None, messages
return directive, messages
+
def register_directive(name, directive):
"""
Register a nonstandard application-defined directive function.
@@ -138,6 +140,7 @@
"""
_directives[name] = directive
+
def flag(argument):
"""
Check for a valid flag option (no argument) and return ``None``.
@@ -150,6 +153,7 @@
else:
return None
+
def unchanged_required(argument):
"""
Return the argument text, unchanged.
@@ -162,6 +166,7 @@
else:
return argument # unchanged!
+
def unchanged(argument):
"""
Return the argument text, unchanged.
@@ -174,6 +179,7 @@
else:
return argument # unchanged!
+
def path(argument):
"""
Return the path argument unwrapped (with newlines removed).
@@ -186,6 +192,7 @@
else:
return ''.join(s.strip() for s in argument.splitlines())
+
def uri(argument):
"""
Return the URI argument with unescaped whitespace removed.
@@ -199,6 +206,7 @@
parts = split_escaped_whitespace(escape2null(argument))
return ' '.join(''.join(unescape(part).split()) for part in parts)
+
def nonnegative_int(argument):
"""
Check for a nonnegative integer argument; raise ``ValueError`` if not.
@@ -209,6 +217,7 @@
raise ValueError('negative value; must be positive or zero')
return value
+
def percentage(argument):
"""
Check for an integer percentage value with optional percent sign.
@@ -220,8 +229,10 @@
pass
return nonnegative_int(argument)
+
length_units = ['em', 'ex', 'px', 'in', 'cm', 'mm', 'pt', 'pc']
+
def get_measure(argument, units):
"""
Check for a positive argument of one of the units and return a
@@ -240,9 +251,11 @@
% ' '.join('"%s"' % i for i in units))
return match.group(1) + match.group(2)
+
def length_or_unitless(argument):
return get_measure(argument, length_units + [''])
+
def length_or_percentage_or_unitless(argument, default=''):
"""
Return normalized string of a length or percentage unit.
@@ -269,6 +282,7 @@
# raise ValueError with list of valid units:
return get_measure(argument, length_units + ['%'])
+
def class_option(argument):
"""
Convert the argument into a list of ID-compatible strings and return it.
@@ -287,9 +301,11 @@
class_names.append(class_name)
return class_names
+
unicode_pattern = re.compile(
r'(?:0x|x|\\x|U\+?|\\u)([0-9a-f]+)$|&#x([0-9a-f]+);$', re.IGNORECASE)
+
def unicode_code(code):
r"""
Convert a Unicode character code to a Unicode character.
@@ -314,6 +330,7 @@
except OverflowError as detail:
raise ValueError('code too large (%s)' % detail)
+
def single_char_or_unicode(argument):
"""
A single character is returned as-is. Unicode characters codes are
@@ -325,6 +342,7 @@
'a Unicode code' % char)
return char
+
def single_char_or_whitespace_or_unicode(argument):
"""
As with `single_char_or_unicode`, but "tab" and "space" are also supported.
@@ -338,6 +356,7 @@
char = single_char_or_unicode(argument)
return char
+
def positive_int(argument):
"""
Converts the argument into an integer. Raises ValueError for negative,
@@ -348,6 +367,7 @@
raise ValueError('negative or zero value; must be positive')
return value
+
def positive_int_list(argument):
"""
Converts a space- or comma-separated list of values into a Python list
@@ -362,6 +382,7 @@
entries = argument.split()
return [positive_int(entry) for entry in entries]
+
def encoding(argument):
"""
Verifies the encoding argument by lookup.
@@ -375,6 +396,7 @@
raise ValueError('unknown encoding: "%s"' % argument)
return argument
+
def choice(argument, values):
"""
Directive option utility function, supplied to enable options whose
@@ -401,10 +423,12 @@
raise ValueError('"%s" unknown; choose from %s'
% (argument, format_values(values)))
+
def format_values(values):
return '%s, or "%s"' % (', '.join('"%s"' % s for s in values[:-1]),
values[-1])
+
def value_or(values, other):
"""
Directive option conversion function.
@@ -418,6 +442,7 @@
return other(argument)
return auto_or_other
+
def parser_name(argument):
"""
Return a docutils parser whose name matches the argument.
Modified: trunk/docutils/docutils/parsers/rst/directives/misc.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/misc.py 2022-03-04 15:55:47 UTC (rev 9025)
+++ trunk/docutils/docutils/parsers/rst/directives/misc.py 2022-03-04 15:57:13 UTC (rev 9026)
@@ -16,6 +16,7 @@
from docutils.parsers.rst.roles import set_classes
from docutils.transforms import misc
+
class Include(Directive):
"""
@@ -328,6 +329,7 @@
return messages + node.children
return messages
+
class Unicode(Directive):
r"""
Modified: trunk/docutils/docutils/parsers/rst/languages/__init__.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/languages/__init__.py 2022-03-04 15:55:47 UTC (rev 9025)
+++ trunk/docutils/docutils/parsers/rst/languages/__init__.py 2022-03-04 15:57:13 UTC (rev 9026)
@@ -15,6 +15,7 @@
from docutils.languages import LanguageImporter
+
class RstLanguageImporter(LanguageImporter):
"""Import language modules.
@@ -35,4 +36,5 @@
and isinstance(module.roles, dict)):
raise ImportError
+
get_language = RstLanguageImporter()
Modified: trunk/docutils/docutils/parsers/rst/roles.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/roles.py 2022-03-04 15:55:47 UTC (rev 9025)
+++ trunk/docutils/docutils/parsers/rst/roles.py 2022-03-04 15:57:13 UTC (rev 9026)
@@ -98,6 +98,7 @@
"""Mapping of local or language-dependent interpreted text role names to role
functions."""
+
def role(role_name, language_module, lineno, reporter):
"""
Locate and return a role function from its language-dependent name, along
@@ -151,6 +152,7 @@
return role_fn, messages
return None, messages # Error message will be generated by caller.
+
def register_canonical_role(name, role_fn):
"""
Register an interpreted text role by its canonical name.
@@ -162,6 +164,7 @@
set_implicit_options(role_fn)
_role_registry[name.lower()] = role_fn
+
def register_local_role(name, role_fn):
"""
Register an interpreted text role by its local or language-dependent name.
@@ -173,6 +...
[truncated message content] |
|
From: <mi...@us...> - 2022-03-05 23:27:33
|
Revision: 9027
http://sourceforge.net/p/docutils/code/9027
Author: milde
Date: 2022-03-05 23:27:30 +0000 (Sat, 05 Mar 2022)
Log Message:
-----------
Fix imports.
flake8 rules
E401: multiple imports on one line
E402: module level import not at top of file
Modified Paths:
--------------
trunk/docutils/docutils/__init__.py
trunk/docutils/docutils/utils/smartquotes.py
trunk/docutils/docutils/writers/_html_base.py
trunk/docutils/test/alltests.py
trunk/docutils/test/functional/tests/standalone_rst_s5_html_1.py
trunk/docutils/test/test_error_reporting.py
trunk/docutils/test/test_language.py
trunk/docutils/tox.ini
Modified: trunk/docutils/docutils/__init__.py
===================================================================
--- trunk/docutils/docutils/__init__.py 2022-03-04 15:57:13 UTC (rev 9026)
+++ trunk/docutils/docutils/__init__.py 2022-03-05 23:27:30 UTC (rev 9027)
@@ -50,6 +50,8 @@
- writers: Format-specific output translators.
"""
+from collections import namedtuple
+
__docformat__ = 'reStructuredText'
__version__ = '0.19b.dev'
@@ -69,9 +71,6 @@
"""
-from collections import namedtuple
-
-
class VersionInfo(namedtuple('VersionInfo',
'major minor micro releaselevel serial release')):
Modified: trunk/docutils/docutils/utils/smartquotes.py
===================================================================
--- trunk/docutils/docutils/utils/smartquotes.py 2022-03-04 15:57:13 UTC (rev 9026)
+++ trunk/docutils/docutils/utils/smartquotes.py 2022-03-05 23:27:30 UTC (rev 9027)
@@ -259,7 +259,7 @@
Version History
===============
-1.8.2 2022-01-27
+1.9 2022-03-04
- Code cleanup. Require Python 3.
1.8.1 2017-10-25
@@ -317,6 +317,10 @@
- Initial release
"""
+import re
+import sys
+
+
options = r"""
Options
=======
@@ -379,12 +383,6 @@
"""
-default_smartypants_attr = "1"
-
-
-import re, sys
-
-
class smartchars:
"""Smart quotes and dashes"""
@@ -502,11 +500,13 @@
self.opquote, self.cpquote, self.osquote, self.csquote = '""\'\''
+default_smartypants_attr = '1'
+
+
def smartyPants(text, attr=default_smartypants_attr, language='en'):
"""Main function for "traditional" use."""
- return "".join(t for t in educate_tokens(tokenize(text),
- attr, language))
+ return "".join(t for t in educate_tokens(tokenize(text), attr, language))
def educate_tokens(text_tokens, attr=default_smartypants_attr, language='en'):
@@ -534,36 +534,36 @@
do_stupefy = False
# if attr == "0": # pass tokens unchanged (see below).
- if attr == "1": # Do everything, turn all options on.
+ if attr == '1': # Do everything, turn all options on.
do_quotes = True
do_backticks = True
do_dashes = 1
do_ellipses = True
- elif attr == "2":
+ elif attr == '2':
# Do everything, turn all options on, use old school dash shorthand.
do_quotes = True
do_backticks = True
do_dashes = 2
do_ellipses = True
- elif attr == "3":
+ elif attr == '3':
# Do everything, use inverted old school dash shorthand.
do_quotes = True
do_backticks = True
do_dashes = 3
do_ellipses = True
- elif attr == "-1": # Special "stupefy" mode.
+ elif attr == '-1': # Special "stupefy" mode.
do_stupefy = True
else:
- if "q" in attr: do_quotes = True
- if "b" in attr: do_backticks = True
- if "B" in attr: do_backticks = 2
- if "d" in attr: do_dashes = 1
- if "D" in attr: do_dashes = 2
- if "i" in attr: do_dashes = 3
- if "e" in attr: do_ellipses = True
- if "w" in attr: convert_quot = True
+ if 'q' in attr: do_quotes = True
+ if 'b' in attr: do_backticks = True
+ if 'B' in attr: do_backticks = 2
+ if 'd' in attr: do_dashes = 1
+ if 'D' in attr: do_dashes = 2
+ if 'i' in attr: do_dashes = 3
+ if 'e' in attr: do_ellipses = True
+ if 'w' in attr: convert_quot = True
- prev_token_last_char = " "
+ prev_token_last_char = ' '
# Last character of the previous text token. Used as
# context to curl leading quote characters correctly.
Modified: trunk/docutils/docutils/writers/_html_base.py
===================================================================
--- trunk/docutils/docutils/writers/_html_base.py 2022-03-04 15:57:13 UTC (rev 9026)
+++ trunk/docutils/docutils/writers/_html_base.py 2022-03-05 23:27:30 UTC (rev 9027)
@@ -18,7 +18,8 @@
import base64
import mimetypes
-import os, os.path
+import os
+import os.path
import re
from urllib.request import url2pathname
import warnings
Modified: trunk/docutils/test/alltests.py
===================================================================
--- trunk/docutils/test/alltests.py 2022-03-04 15:57:13 UTC (rev 9026)
+++ trunk/docutils/test/alltests.py 2022-03-05 23:27:30 UTC (rev 9027)
@@ -14,15 +14,15 @@
import time
# Start point for actual elapsed time, including imports
# and setup outside of unittest.
-start = time.time() # noqa
+start = time.time()
-import sys
-import atexit
-import os
-import platform
+import sys # noqa: E402
+import atexit # noqa: E402
+import os # noqa: E402
+import platform # noqa: E402
-import DocutilsTestSupport # must be imported before docutils
-import docutils
+import DocutilsTestSupport # noqa: E402 must be imported before docutils
+import docutils # noqa: E402
class Tee:
Modified: trunk/docutils/test/functional/tests/standalone_rst_s5_html_1.py
===================================================================
--- trunk/docutils/test/functional/tests/standalone_rst_s5_html_1.py 2022-03-04 15:57:13 UTC (rev 9026)
+++ trunk/docutils/test/functional/tests/standalone_rst_s5_html_1.py 2022-03-05 23:27:30 UTC (rev 9027)
@@ -1,3 +1,6 @@
+import filecmp as _filecmp
+
+
with open('functional/tests/_standalone_rst_defaults.py') as _f:
exec(_f.read())
@@ -17,9 +20,6 @@
# Extra functional tests.
# Prefix all names with '_' to avoid confusing `docutils.core.publish_file`.
-import filecmp as _filecmp
-
-
def _test_more(expected_dir, output_dir, test_case, parameters):
"""Compare ``ui/<theme>`` directories."""
theme = settings_overrides.get('theme', 'default')
Modified: trunk/docutils/test/test_error_reporting.py
===================================================================
--- trunk/docutils/test/test_error_reporting.py 2022-03-04 15:57:13 UTC (rev 9026)
+++ trunk/docutils/test/test_error_reporting.py 2022-03-05 23:27:30 UTC (rev 9027)
@@ -29,14 +29,15 @@
import sys
import unittest
import warnings
-warnings.filterwarnings('ignore', category=DeprecationWarning,
- message=r'.*utils\.error_reporting')
import DocutilsTestSupport # must be imported before docutils
from docutils import core, parsers, frontend, utils
from docutils.utils.error_reporting import SafeString, ErrorString, ErrorOutput
+warnings.filterwarnings('ignore', category=DeprecationWarning,
+ message=r'.*utils\.error_reporting')
+
class SafeStringTests(unittest.TestCase):
# test data:
Modified: trunk/docutils/test/test_language.py
===================================================================
--- trunk/docutils/test/test_language.py 2022-03-04 15:57:13 UTC (rev 9026)
+++ trunk/docutils/test/test_language.py 2022-03-05 23:27:30 UTC (rev 9027)
@@ -15,11 +15,13 @@
import sys
import os
import re
+
import DocutilsTestSupport # must be imported before docutils
import docutils.languages
import docutils.parsers.rst.languages
from docutils.parsers.rst import states, directives, roles
-import docutils.utils, docutils.frontend
+import docutils.utils
+import docutils.frontend
_settings = docutils.frontend.OptionParser().get_default_values()
_reporter = docutils.utils.new_reporter('', _settings)
Modified: trunk/docutils/tox.ini
===================================================================
--- trunk/docutils/tox.ini 2022-03-04 15:57:13 UTC (rev 9026)
+++ trunk/docutils/tox.ini 2022-03-05 23:27:30 UTC (rev 9027)
@@ -38,8 +38,6 @@
# whitespace around the operators with the lowest priority(ies).
# Use your own judgment; …"
- E401, # multiple imports on one line
- E402, # module level import not at top of file
E501, # line too long (N > 79 characters)
E502, # the backslash is redundant between brackets
E701, # multiple statements on one line (colon)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|