From 63b2b73f1cf1137788c3418d0a9b9c8725331735 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Sun, 16 Jan 2022 17:57:56 +0000 Subject: [PATCH 01/36] Add GHA scripts --- .github/workflows/linting.yml | 20 +++++++++ .github/workflows/test.yml | 35 +++++++++++++++ docutils/.flake8 | 85 +++++++++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 .github/workflows/linting.yml create mode 100644 .github/workflows/test.yml create mode 100644 docutils/.flake8 diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 000000000..0b5435fea --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,20 @@ +name: 🎨 linting + +on: [push, pull_request] + +jobs: + linting: + name: lint using flake8 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3 + - name: Install dependencies + run: pip install flake8 + - name: Run flake8 + run: | + cd docutils + flake8 docutils diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..ea0be727f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,35 @@ +name: ✅ tests #and coverage + +on: [push, pull_request] + +jobs: + tests: + name: test with Python ${{ matrix.python-version }} + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11-dev" + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + cd docutils + python -m pip install --upgrade pip + python -m pip install -e . + python -m pip install pygments + + - name: Run test suite + run: | + cd docutils + python test/alltests.py diff --git a/docutils/.flake8 b/docutils/.flake8 new file mode 100644 index 000000000..d40602322 --- /dev/null +++ b/docutils/.flake8 @@ -0,0 +1,85 @@ +[flake8] +# The following rules are ignored as they're stylistic and can be addressed at +# a later point: +# +# E101 indentation contains mixed spaces and tabs +# 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 +# E123 closing bracket does not match indentation of opening bracket's line +# E124 closing bracket does not match visual indentation +# E125 continuation line with same indent as next logical line +# E126 continuation line over-indented for hanging indent +# E127 continuation line over-indented for visual indent +# E128 continuation line under-indented for visual indent +# E129 visually indented line with same indent as next logical line +# E131 continuation line unaligned for hanging indent +# 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 +# E226 missing whitespace around arithmetic operator +# E228 missing whitespace around modulo operator +# 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 '# ' +# E265 block comment should start with '# ' +# E266 too many leading '#' for block comment +# 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) +# 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) +# E502 the backslash is redundant between brackets +# E701 multiple statements on one line (colon) +# E704 multiple statements on one line (def) +# E711 comparison to None should be 'if cond is not None:' +# E713 test for membership should be 'not in' +# E721 do not compare types, use 'isinstance()' +# E722 do not use bare 'except' +# E731 do not assign a lambda expression, use a def +# E741 ambiguous variable name 'a' +# W191 indentation contains tabs +# W291 trailing whitespace +# W293 blank line contains whitespace +# W391 blank line at end of file +# W503 line break before binary operator +# W504 line break after binary operator +# F401 'foo' imported but unused +# F841 local variable 'foo' is assigned to but never used +# +# The following rules are required for Python 3 support and so are not +# disabled +# +# W605 invalid escape sequence '\ ' +# W601 .has_key() is deprecated, use 'in' +# W602 deprecated form of raising exception +# F811 redefinition of unused 'foo' from line 79 +# +# Similarly, the following are straight up bugs that should be addressed +# immediately: +# +# 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 +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 = + docutils/test/functional/tests/*:F821 From 84fcadb7fedf86a6e73b977f7c3ae71f1790e846 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Fri, 21 Jan 2022 18:56:11 +0000 Subject: [PATCH 02/36] s/u"""/"""/ --- docutils/docutils/utils/smartquotes.py | 4 +- .../test_recommonmark/test_bullet_lists.py | 4 +- .../test_recommonmark/test_inline_markup.py | 20 ++-- .../test_rst/test_SimpleTableParser.py | 2 +- .../test_parsers/test_rst/test_TableParser.py | 2 +- .../test_rst/test_block_quotes.py | 2 +- .../test_rst/test_bullet_lists.py | 4 +- .../test_character_level_inline_markup.py | 16 +-- .../test_rst/test_directives/test_date.py | 4 +- .../test_rst/test_directives/test_images.py | 4 +- .../test_rst/test_directives/test_include.py | 8 +- .../test_rst/test_directives/test_raw.py | 2 +- .../test_rst/test_directives/test_tables.py | 6 +- .../test_rst/test_directives/test_unicode.py | 4 +- .../test_rst/test_east_asian_text.py | 22 ++-- .../test_rst/test_enumerated_lists.py | 2 +- .../test_rst/test_inline_markup.py | 104 +++++++++--------- .../test_rst/test_section_headers.py | 4 +- .../test_rst/test_substitutions.py | 4 +- docutils/test/test_transforms/test_docinfo.py | 8 +- .../test/test_transforms/test_footnotes.py | 2 +- docutils/test/test_transforms/test_sectnum.py | 14 +-- .../test/test_transforms/test_smartquotes.py | 24 ++-- .../test_transforms/test_substitutions.py | 20 ++-- docutils/test/test_utils.py | 4 +- .../test/test_writers/test_docutils_xml.py | 20 ++-- .../test/test_writers/test_html4css1_misc.py | 2 +- .../test_writers/test_html5_polyglot_misc.py | 2 +- 28 files changed, 157 insertions(+), 157 deletions(-) diff --git a/docutils/docutils/utils/smartquotes.py b/docutils/docutils/utils/smartquotes.py index ad8e7e6ef..0ab7ad4ab 100644 --- a/docutils/docutils/utils/smartquotes.py +++ b/docutils/docutils/utils/smartquotes.py @@ -664,7 +664,7 @@ def educateQuotes(text, language='en'): text = re.sub(r"'(?=\d{2}s)", smart.apostrophe, text) # Get most opening secondary quotes: - opening_secondary_quotes_regex = re.compile(u""" + opening_secondary_quotes_regex = re.compile(""" (# ?<= # look behind fails: requires fixed-width pattern %(sep)s | # a whitespace char, or %(open)s | # opening brace, or @@ -690,7 +690,7 @@ def educateQuotes(text, language='en'): text = re.sub(r"""'""", smart.osquote, text) # Get most opening primary quotes: - opening_primary_quotes_regex = re.compile(u""" + opening_primary_quotes_regex = re.compile(""" ( %(sep)s | # a whitespace char, or %(open)s | # zero width separating char, or diff --git a/docutils/test/test_parsers/test_recommonmark/test_bullet_lists.py b/docutils/test/test_parsers/test_recommonmark/test_bullet_lists.py index 5e625f250..128e4a1d5 100755 --- a/docutils/test/test_parsers/test_recommonmark/test_bullet_lists.py +++ b/docutils/test/test_parsers/test_recommonmark/test_bullet_lists.py @@ -170,7 +170,7 @@ def suite(): empty item above, no blank line """], -[u"""\ +["""\ Unicode bullets are not supported by CommonMark. • BULLET @@ -179,7 +179,7 @@ def suite(): ⁃ HYPHEN BULLET """, -u"""\ +"""\ Unicode bullets are not supported by CommonMark. diff --git a/docutils/test/test_parsers/test_recommonmark/test_inline_markup.py b/docutils/test/test_parsers/test_recommonmark/test_inline_markup.py index 4b6dd8d59..bf08d2e56 100755 --- a/docutils/test/test_parsers/test_recommonmark/test_inline_markup.py +++ b/docutils/test/test_parsers/test_recommonmark/test_inline_markup.py @@ -39,10 +39,10 @@ def suite(): also emphasis """], -[u"""\ +["""\ Partially*emphasised*word. """, -u"""\ +"""\ Partially @@ -189,10 +189,10 @@ def suite(): literal\\ """], -[u"""\ +["""\ l'``literal`` and l\u2019``literal`` with apostrophe """, -u"""\ +"""\ l' @@ -203,12 +203,12 @@ def suite(): literal with apostrophe """], -[u"""\ +["""\ quoted '``literal``', quoted "``literal``", quoted \u2018``literal``\u2019, quoted \u201c``literal``\u201d, quoted \xab``literal``\xbb """, -u"""\ +"""\ quoted ' @@ -230,12 +230,12 @@ def suite(): literal \xbb """], -[u"""\ +["""\ ``'literal'`` with quotes, ``"literal"`` with quotes, ``\u2018literal\u2019`` with quotes, ``\u201cliteral\u201d`` with quotes, ``\xabliteral\xbb`` with quotes """, -u"""\ +"""\ @@ -349,12 +349,12 @@ def suite(): phrase reference """], -[u"""\ +["""\ No whitespace required around a[phrase reference]. [phrase reference]: /uri """, -u"""\ +"""\ No whitespace required around a diff --git a/docutils/test/test_parsers/test_rst/test_SimpleTableParser.py b/docutils/test/test_parsers/test_rst/test_SimpleTableParser.py index 368bdf47c..f05e8f4d8 100755 --- a/docutils/test/test_parsers/test_rst/test_SimpleTableParser.py +++ b/docutils/test/test_parsers/test_rst/test_SimpleTableParser.py @@ -28,7 +28,7 @@ def suite(): [], [[[0, 0, 1, ['A table with']], [0, 0, 1, ['two columns.']]]])], -[u"""\ +["""\ ============ =============== A tāble w̅ith comb̲ining chars ============ =============== diff --git a/docutils/test/test_parsers/test_rst/test_TableParser.py b/docutils/test/test_parsers/test_rst/test_TableParser.py index f1aa916f2..94ecbce29 100755 --- a/docutils/test/test_parsers/test_rst/test_TableParser.py +++ b/docutils/test/test_parsers/test_rst/test_TableParser.py @@ -40,7 +40,7 @@ def suite(): [[(0, 0, 1, ['A table with']), (0, 0, 1, ['two columns.'])]])], # Combining chars in grid tables still fail -# [u"""\ +# ["""\ # +--------------+------------------+ # | A tāble w̅ith | comb̲ining chars. | # +--------------+------------------+ diff --git a/docutils/test/test_parsers/test_rst/test_block_quotes.py b/docutils/test/test_parsers/test_rst/test_block_quotes.py index 5264cad8a..f3ecb18f4 100755 --- a/docutils/test/test_parsers/test_rst/test_block_quotes.py +++ b/docutils/test/test_parsers/test_rst/test_block_quotes.py @@ -147,7 +147,7 @@ def suite(): Attribution """], -[u"""\ +["""\ Alternative: true em-dash. Block quote. diff --git a/docutils/test/test_parsers/test_rst/test_bullet_lists.py b/docutils/test/test_parsers/test_rst/test_bullet_lists.py index 9453229c7..1105a1255 100755 --- a/docutils/test/test_parsers/test_rst/test_bullet_lists.py +++ b/docutils/test/test_parsers/test_rst/test_bullet_lists.py @@ -174,7 +174,7 @@ def suite(): empty item above, no blank line """], -[u"""\ +["""\ Unicode bullets: \u2022 BULLET @@ -183,7 +183,7 @@ def suite(): \u2043 HYPHEN BULLET """, -u"""\ +"""\ Unicode bullets: diff --git a/docutils/test/test_parsers/test_rst/test_character_level_inline_markup.py b/docutils/test/test_parsers/test_rst/test_character_level_inline_markup.py index 106b89414..891597e3c 100644 --- a/docutils/test/test_parsers/test_rst/test_character_level_inline_markup.py +++ b/docutils/test/test_parsers/test_rst/test_character_level_inline_markup.py @@ -442,11 +442,11 @@ def suite(): p with backslash-escaped whitespace, including newlines. """], -[u"""\ +["""\ text-*separated*\u2010*by*\u2011*various*\u2012*dashes*\u2013*and*\u2014*hyphens*. \u00bf*punctuation*? \u00a1*examples*!\xa0*no-break-space*\xa0. """, -u"""\ +"""\ text- @@ -480,7 +480,7 @@ def suite(): \xa0. """], # Whitespace characters: -[u"""\ +["""\ inline markup surrounded by various whitespace characters: *newline* or *space* or one of @@ -503,7 +503,7 @@ def suite(): \u3000*IDEOGRAPHIC SPACE*\u3000, \u2028*LINE SEPARATOR*\u2028 """, -u"""\ +"""\ inline markup surrounded by various whitespace characters: @@ -586,7 +586,7 @@ def suite(): LINE SEPARATOR """], -[u"""\ +["""\ no inline markup due to whitespace inside and behind: * newline * @@ -609,7 +609,7 @@ def suite(): *\u3000IDEOGRAPHIC SPACE\u3000* *\u2028LINE SEPARATOR\u2028* """, -u"""\ +"""\ no inline markup due to whitespace inside and behind: * @@ -636,7 +636,7 @@ def suite(): LINE SEPARATOR *"""], # « * » ‹ * › « * » ‹ * › « * » ‹ * › French, -[u"""\ +["""\ "Quoted" markup start-string (matched openers & closers) -> no markup: '*' "*" (*) <*> [*] {*} @@ -654,7 +654,7 @@ def suite(): But this is „*’ emphasized »*‹. """, -u"""\ +"""\ "Quoted" markup start-string (matched openers & closers) -> no markup: diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_date.py b/docutils/test/test_parsers/test_rst/test_directives/test_date.py index 6c45b9848..471be9cb8 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_date.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_date.py @@ -62,10 +62,10 @@ def suite(): # some locales return non-ASCII characters for names of days or months if locale_encoding in ['utf8', 'utf-8', 'latin-1']: totest['decode date'] = [ - [u"""\ + ["""\ .. |date| date:: t\xc3glich """, - u"""\ + """\ t\xc3glich diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_images.py b/docutils/test/test_parsers/test_rst/test_directives/test_images.py index 5a6bc0128..2b2d84722 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_images.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_images.py @@ -406,11 +406,11 @@ def suite(): .. |img| image:: picture.png :align: left """], -[u"""\ +["""\ .. image:: picture.png :align: \xe4 """, -u"""\ +"""\ diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_include.py b/docutils/test/test_parsers/test_rst/test_directives/test_include.py index 1fe3975cc..e1c206c02 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_include.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_include.py @@ -65,11 +65,11 @@ def reldir(path): try: open(u'\u043c\u0438\u0440.txt') except UnicodeEncodeError: - errstr_8bit_path = u"""\ + errstr_8bit_path = """\ Cannot encode input file path "\u043c\u0438\u0440.txt" (wrong locale?).\ """ except: - errstr_8bit_path = u"""\ + errstr_8bit_path = """\ InputError: [Errno 2] No such file or directory: '\u043c\u0438\u0440.txt'.\ """ @@ -525,12 +525,12 @@ def reldir(path): .. include:: %s :encoding: ascii """ % (utf_16_error_str, reldir(utf_16_file))], -[u"""\ +["""\ cyrillic filename: .. include:: \u043c\u0438\u0440.txt """, -u"""\ +"""\ cyrillic filename: diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_raw.py b/docutils/test/test_parsers/test_rst/test_directives/test_raw.py index 7ba6774b2..02cae30e6 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_raw.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_raw.py @@ -126,7 +126,7 @@ def suite(): :file: %s :encoding: ascii """ % (utf_16_error_str, utf_16_file_rel)], -[u"""\ +["""\ .. raw:: html :encoding: utf-8 diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_tables.py b/docutils/test/test_parsers/test_rst/test_directives/test_tables.py index 76bfe8f34..f84609810 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_tables.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_tables.py @@ -702,12 +702,12 @@ def null_bytes(): """], -[u"""\ +["""\ .. csv-table:: non-ASCII characters Heiz\xf6lr\xfccksto\xdfabd\xe4mpfung """, -u"""\ +"""\ @@ -1111,7 +1111,7 @@ def null_bytes(): :encoding: utf-16 :header-rows: 1 """ % utf_16_csv, -u"""\ +"""\ <document source="test data"> <table> <title> diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_unicode.py b/docutils/test/test_parsers/test_rst/test_directives/test_unicode.py index 26860fff5..73a8a26cb 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_unicode.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_unicode.py @@ -40,7 +40,7 @@ def suite(): .. |bne| unicode:: U0003D U020E5 .. |Omega| unicode:: U+003A9 """, -u"""\ +"""\ <document source="test data"> <paragraph> Insert an em-dash ( @@ -120,7 +120,7 @@ def suite(): .. |BogusMegaCorp (TM)| unicode:: BogusMegaCorp U+2122 .. with trademark sign """, -u"""\ +"""\ <document source="test data"> <paragraph> Testing comments and extra text. diff --git a/docutils/test/test_parsers/test_rst/test_east_asian_text.py b/docutils/test/test_parsers/test_rst/test_east_asian_text.py index 215f0dfa5..96c404818 100755 --- a/docutils/test/test_parsers/test_rst/test_east_asian_text.py +++ b/docutils/test/test_parsers/test_rst/test_east_asian_text.py @@ -22,14 +22,14 @@ def suite(): totest = {} totest['double-width'] = [ -[u"""\ +["""\ タイトル1 ========= タイトル2 ======== """, -u"""\ +"""\ <document source="test data"> <section ids="section-1" names="タイトル1"> <title> @@ -44,7 +44,7 @@ def suite(): タイトル2 ======== """], -[u""" +[""" +-----------------------+ | * ヒョウ:ダイ1ギョウ | | * ダイ2ギョウ | @@ -53,7 +53,7 @@ def suite(): | * ダイ2ギョウ | +-----------------------+ """, -u"""\ +"""\ <document source="test data"> <table> <tgroup cols="1"> @@ -74,7 +74,7 @@ def suite(): * ダイ1ギョウ * ダイ2ギョウ """], -[u"""\ +["""\ Complex spanning pattern (no edge knows all rows/cols): +--------+---------------------+ @@ -85,7 +85,7 @@ def suite(): | 南西・南セル | セル | +-----------------------+------+ """, -u"""\ +"""\ <document source="test data"> <paragraph> Complex spanning pattern (no edge knows all rows/cols): @@ -117,7 +117,7 @@ def suite(): <paragraph> 南西・南セル """], -[u"""\ +["""\ ========= ========= ダイ1ラン ダイ2ラン ========= ========= @@ -126,7 +126,7 @@ def suite(): ダイ1ラン ダイ2ラン ======== ========= """, -u"""\ +"""\ <document source="test data"> <table> <tgroup cols="2"> @@ -149,7 +149,7 @@ def suite(): ダイ1ラン ダイ2ラン ======== ========= """], -[u"""\ +["""\ Some ambiguous-width characters: = =================================== @@ -303,9 +303,9 @@ def suite(): """.decode('raw_unicode_escape')], ] ''' -[u"""\ +["""\ """, -u"""\ +"""\ """], ''' diff --git a/docutils/test/test_parsers/test_rst/test_enumerated_lists.py b/docutils/test/test_parsers/test_rst/test_enumerated_lists.py index 713ee4a59..17495472d 100755 --- a/docutils/test/test_parsers/test_rst/test_enumerated_lists.py +++ b/docutils/test/test_parsers/test_rst/test_enumerated_lists.py @@ -651,7 +651,7 @@ def suite(): <paragraph> Item 3. """], -[u"""\ +["""\ A. Einstein was a great influence on B. Physicist, who was a colleague of C. Chemist. They all worked in diff --git a/docutils/test/test_parsers/test_rst/test_inline_markup.py b/docutils/test/test_parsers/test_rst/test_inline_markup.py index 146769249..8acd68a2e 100755 --- a/docutils/test/test_parsers/test_rst/test_inline_markup.py +++ b/docutils/test/test_parsers/test_rst/test_inline_markup.py @@ -30,11 +30,11 @@ def suite(): <emphasis> emphasis """], -[u"""\ +["""\ l'*emphasis* with the *emphasis*' apostrophe. l\u2019*emphasis* with the *emphasis*\u2019 apostrophe. """, -u"""\ +"""\ <document source="test data"> <paragraph> l\' @@ -155,7 +155,7 @@ def suite(): this* ? """], -[u"""\ +["""\ Quotes around inline markup: '*emphasis*' "*emphasis*" Straight, @@ -170,7 +170,7 @@ def suite(): „*emphasis*” ‚*emphasis*’ Polish, „*emphasis*” »*emphasis*« ’*emphasis*’ Hungarian, """, -u"""\ +"""\ <document source="test data"> <paragraph> Quotes around inline markup: @@ -302,10 +302,10 @@ def suite(): <strong> strong """], -[u"""\ +["""\ l'**strong** and l\u2019**strong** with apostrophe """, -u"""\ +"""\ <document source="test data"> <paragraph> l' @@ -316,12 +316,12 @@ def suite(): strong with apostrophe """], -[u"""\ +["""\ quoted '**strong**', quoted "**strong**", quoted \u2018**strong**\u2019, quoted \u201c**strong**\u201d, quoted \xab**strong**\xbb """, -u"""\ +"""\ <document source="test data"> <paragraph> quoted ' @@ -432,10 +432,10 @@ def suite(): <literal> literal\\ """], -[u"""\ +["""\ l'``literal`` and l\u2019``literal`` with apostrophe """, -u"""\ +"""\ <document source="test data"> <paragraph> l' @@ -446,12 +446,12 @@ def suite(): literal with apostrophe """], -[u"""\ +["""\ quoted '``literal``', quoted "``literal``", quoted \u2018``literal``\u2019, quoted \u201c``literal``\u201d, quoted \xab``literal``\xbb """, -u"""\ +"""\ <document source="test data"> <paragraph> quoted ' @@ -473,12 +473,12 @@ def suite(): literal \xbb """], -[u"""\ +["""\ ``'literal'`` with quotes, ``"literal"`` with quotes, ``\u2018literal\u2019`` with quotes, ``\u201cliteral\u201d`` with quotes, ``\xabliteral\xbb`` with quotes """, -u"""\ +"""\ <document source="test data"> <paragraph> <literal> @@ -596,10 +596,10 @@ def suite(): <reference name="ref" refname="ref"> ref """], -[u"""\ +["""\ l'ref_ and l\u2019ref_ with apostrophe """, -u"""\ +"""\ <document source="test data"> <paragraph> l' @@ -610,14 +610,14 @@ def suite(): ref with apostrophe """], -[u"""\ +["""\ quoted 'ref_', quoted "ref_", quoted \u2018ref_\u2019, quoted \u201cref_\u201d, quoted \xabref_\xbb, but not 'ref ref'_, "ref ref"_, \u2018ref ref\u2019_, \u201cref ref\u201d_, or \xabref ref\xbb_ """, -u"""\ +"""\ <document source="test data"> <paragraph> quoted ' @@ -650,10 +650,10 @@ def suite(): <reference anonymous="1" name="ref"> ref """], -[u"""\ +["""\ l'ref__ and l\u2019ref__ with apostrophe """, -u"""\ +"""\ <document source="test data"> <paragraph> l' @@ -664,14 +664,14 @@ def suite(): ref with apostrophe """], -[u"""\ +["""\ quoted 'ref__', quoted "ref__", quoted \u2018ref__\u2019, quoted \u201cref__\u201d, quoted \xabref__\xbb, but not 'ref ref'__, "ref ref"__, \u2018ref ref\u2019__, \u201cref ref\u201d__, or \xabref ref\xbb__ """, -u"""\ +"""\ <document source="test data"> <paragraph> quoted ' @@ -731,10 +731,10 @@ def suite(): <reference name="phrase reference" refname="phrase reference"> phrase reference """], -[u"""\ +["""\ l'`phrase reference`_ and l\u2019`phrase reference`_ with apostrophe """, -u"""\ +"""\ <document source="test data"> <paragraph> l' @@ -745,13 +745,13 @@ def suite(): phrase reference with apostrophe """], -[u"""\ +["""\ quoted '`phrase reference`_', quoted "`phrase reference`_", quoted \u2018`phrase reference`_\u2019, quoted \u201c`phrase reference`_\u201d, quoted \xab`phrase reference`_\xbb """, -u"""\ +"""\ <document source="test data"> <paragraph> quoted ' @@ -774,13 +774,13 @@ def suite(): phrase reference \xbb """], -[u"""\ +["""\ `'phrase reference'`_ with quotes, `"phrase reference"`_ with quotes, `\u2018phrase reference\u2019`_ with quotes, `\u201cphrase reference\u201d`_ with quotes, `\xabphrase reference\xbb`_ with quotes """, -u"""\ +"""\ <document source="test data"> <paragraph> <reference name="'phrase reference'" refname="'phrase reference'"> @@ -808,10 +808,10 @@ def suite(): <reference anonymous="1" name="anonymous reference"> anonymous reference """], -[u"""\ +["""\ l'`anonymous reference`__ and l\u2019`anonymous reference`__ with apostrophe """, -u"""\ +"""\ <document source="test data"> <paragraph> l' @@ -822,13 +822,13 @@ def suite(): anonymous reference with apostrophe """], -[u"""\ +["""\ quoted '`anonymous reference`__', quoted "`anonymous reference`__", quoted \u2018`anonymous reference`__\u2019, quoted \u201c`anonymous reference`__\u201d, quoted \xab`anonymous reference`__\xbb """, -u"""\ +"""\ <document source="test data"> <paragraph> quoted ' @@ -851,13 +851,13 @@ def suite(): anonymous reference \xbb """], -[u"""\ +["""\ `'anonymous reference'`__ with quotes, `"anonymous reference"`__ with quotes, `\u2018anonymous reference\u2019`__ with quotes, `\u201canonymous reference\u201d`__ with quotes, `\xabanonymous reference\xbb`__ with quotes """, -u"""\ +"""\ <document source="test data"> <paragraph> <reference anonymous="1" name="'anonymous reference'"> @@ -1257,10 +1257,10 @@ def suite(): Here is a TaRgeT with case and spacial difficulties. """], -[u"""\ +["""\ l'_`target1` and l\u2019_`target2` with apostrophe """, -u"""\ +"""\ <document source="test data"> <paragraph> l' @@ -1271,12 +1271,12 @@ def suite(): target2 with apostrophe """], -[u"""\ +["""\ quoted '_`target1`', quoted "_`target2`", quoted \u2018_`target3`\u2019, quoted \u201c_`target4`\u201d, quoted \xab_`target5`\xbb """, -u"""\ +"""\ <document source="test data"> <paragraph> quoted ' @@ -1298,12 +1298,12 @@ def suite(): target5 \xbb """], -[u"""\ +["""\ _`'target1'` with quotes, _`"target2"` with quotes, _`\u2018target3\u2019` with quotes, _`\u201ctarget4\u201d` with quotes, _`\xabtarget5\xbb` with quotes """, -u"""\ +"""\ <document source="test data"> <paragraph> <target ids="target1" names="'target1'"> @@ -1699,11 +1699,11 @@ def suite(): p with backslash-escaped whitespace, including newlines. """], -[u"""\ +["""\ text-*separated*\u2010*by*\u2011*various*\u2012*dashes*\u2013*and*\u2014*hyphens*. \u00bf*punctuation*? \u00a1*examples*!\u00a0*no-break-space*\u00a0. """, -u"""\ +"""\ <document source="test data"> <paragraph> text- @@ -1738,7 +1738,7 @@ def suite(): """], # Whitespace characters: # \u180e*MONGOLIAN VOWEL SEPARATOR*\u180e, fails in Python 2.6 -[u"""\ +["""\ text separated by *newline* or *space* or one of @@ -1760,7 +1760,7 @@ def suite(): \u3000*IDEOGRAPHIC SPACE*\u3000, \u2028*LINE SEPARATOR*\u2028 """, -u"""\ +"""\ <document source="test data"> <paragraph> text separated by @@ -1839,13 +1839,13 @@ def suite(): <emphasis> LINE SEPARATOR """], -[u"""\ +["""\ inline markup separated by non-ASCII whitespace \xa0**NO-BREAK SPACE**\xa0, \xa0``NO-BREAK SPACE``\xa0, \xa0`NO-BREAK SPACE`\xa0, \u2000**EN QUAD**\u2000, \u2000``EN QUAD``\u2000, \u2000`EN QUAD`\u2000, \u202f**NARROW NBSP**\u202f, \u202f``NARROW NBSP``\u202f, \u202f`NARROW NBSP`\u202f, """, -u"""\ +"""\ <document source="test data"> <paragraph> inline markup separated by non-ASCII whitespace @@ -1880,7 +1880,7 @@ def suite(): NARROW NBSP \u202f, """], -[u"""\ +["""\ no inline markup due to whitespace inside and behind: * newline * @@ -1903,7 +1903,7 @@ def suite(): *\u3000IDEOGRAPHIC SPACE\u3000* *\u2028LINE SEPARATOR\u2028* """, -u"""\ +"""\ <document source="test data"> <paragraph> no inline markup due to whitespace inside and behind: * @@ -1929,13 +1929,13 @@ def suite(): * LINE SEPARATOR *"""], -[u"""\ +["""\ no inline markup because of non-ASCII whitespace following /preceding the markup **\xa0NO-BREAK SPACE\xa0** ``\xa0NO-BREAK SPACE\xa0`` `\xa0NO-BREAK SPACE\xa0` **\u2000EN QUAD\u2000** ``\u2000EN QUAD\u2000`` `\u2000EN QUAD\u2000` **\u202fNARROW NBSP\u202f** ``\u202fNARROW NBSP\u202f`` `\u202fNARROW NBSP\u202f` """, -u"""\ +"""\ <document source="test data"> <paragraph> no inline markup because of non-ASCII whitespace following /preceding the markup @@ -1944,7 +1944,7 @@ def suite(): **\u202fNARROW NBSP\u202f** ``\u202fNARROW NBSP\u202f`` `\u202fNARROW NBSP\u202f`\ """], # « * » ‹ * › « * » ‹ * › « * » ‹ * › French, -[u"""\ +["""\ "Quoted" markup start-string (matched openers & closers) -> no markup: '*' "*" (*) <*> [*] {*} @@ -1962,7 +1962,7 @@ def suite(): But this is „*’ emphasized »*‹. """, -u"""\ +"""\ <document source="test data"> <paragraph> "Quoted" markup start-string (matched openers & closers) -> no markup: diff --git a/docutils/test/test_parsers/test_rst/test_section_headers.py b/docutils/test/test_parsers/test_rst/test_section_headers.py index 4e10830b3..1aba0708f 100755 --- a/docutils/test/test_parsers/test_rst/test_section_headers.py +++ b/docutils/test/test_parsers/test_rst/test_section_headers.py @@ -124,13 +124,13 @@ def suite(): <paragraph> Test short underline. """], -[u"""\ +["""\ à with combining varia ====================== Do not count combining chars in title column width. """, -u"""\ +"""\ <document source="test data"> <section ids="a-with-combining-varia" names="a\u0300\\ with\\ combining\\ varia"> <title> diff --git a/docutils/test/test_parsers/test_rst/test_substitutions.py b/docutils/test/test_parsers/test_rst/test_substitutions.py index 23aafd061..f95706324 100755 --- a/docutils/test/test_parsers/test_rst/test_substitutions.py +++ b/docutils/test/test_parsers/test_rst/test_substitutions.py @@ -135,13 +135,13 @@ def suite(): <paragraph> Followed by a block quote. """], -[u"""\ +["""\ Substitutions support case differences: .. |eacute| replace:: \u00E9 .. |Eacute| replace:: \u00C9 """, -u"""\ +"""\ <document source="test data"> <paragraph> Substitutions support case differences: diff --git a/docutils/test/test_transforms/test_docinfo.py b/docutils/test/test_transforms/test_docinfo.py index 0b849c251..8f549e03d 100755 --- a/docutils/test/test_transforms/test_docinfo.py +++ b/docutils/test/test_transforms/test_docinfo.py @@ -379,7 +379,7 @@ def suite(): ]) totest_de['bibliographic_field_lists'] = ((DocInfo,), [ -[u"""\ +["""\ .. Bibliographic element extraction for a German document. :Zusammenfassung: Abstract 1. @@ -391,7 +391,7 @@ def suite(): :Datum: 2001-08-11 :Parameter i: integer """, -u"""\ +"""\ <document source="test data"> <docinfo> <author> @@ -422,7 +422,7 @@ def suite(): """],]) totest_ru['bibliographic_field_lists'] = ((DocInfo,), [ -[u"""\ +["""\ .. Bibliographic element extraction for a Russian document. :аннотация: Abstract 1. @@ -434,7 +434,7 @@ def suite(): :дата: 2001-08-11 :Parameter i: integer """, -u"""\ +"""\ <document source="test data"> <docinfo> <author> diff --git a/docutils/test/test_transforms/test_footnotes.py b/docutils/test/test_transforms/test_footnotes.py index 880d3d245..c1ebe4e9a 100755 --- a/docutils/test/test_transforms/test_footnotes.py +++ b/docutils/test/test_transforms/test_footnotes.py @@ -411,7 +411,7 @@ def suite(): .. [*] Auto-symbol footnote 11. .. [*] Auto-symbol footnote 12. """, -u"""\ +"""\ <document source="test data"> <paragraph> A sequence of symbol footnote references: diff --git a/docutils/test/test_transforms/test_sectnum.py b/docutils/test/test_transforms/test_sectnum.py index 93c462a6d..1c5e3822a 100755 --- a/docutils/test/test_transforms/test_sectnum.py +++ b/docutils/test/test_transforms/test_sectnum.py @@ -44,7 +44,7 @@ def suite(): ------- Paragraph 4. """, -u"""\ +"""\ <document source="test data"> <section ids="title-1" names="title\\ 1"> <title auto="1"> @@ -82,7 +82,7 @@ def suite(): ============== Paragraph 1. """, -u"""\ +"""\ <document source="test data"> <section ids="bold-title" names="bold\\ title"> <title auto="1"> @@ -112,7 +112,7 @@ def suite(): ------- Paragraph 4. """, -u"""\ +"""\ <document source="test data"> <section ids="title-1" names="title\\ 1"> <title auto="1"> @@ -161,7 +161,7 @@ def suite(): ------- Paragraph 4. """, -u"""\ +"""\ <document source="test data"> <topic classes="contents" ids="contents" names="contents"> <title> @@ -238,7 +238,7 @@ def suite(): ------- Paragraph 4. """, -u"""\ +"""\ <document source="test data"> <section ids="title-1" names="title\\ 1"> <title auto="1"> @@ -289,7 +289,7 @@ def suite(): ------- Paragraph 4. """, -u"""\ +"""\ <document source="test data"> <section ids="title-1" names="title\\ 1"> <title auto="1"> @@ -342,7 +342,7 @@ def suite(): ------- Paragraph 4. """, -u"""\ +"""\ <document source="test data"> <section ids="title-1" names="title\\ 1"> <title auto="1"> diff --git a/docutils/test/test_transforms/test_smartquotes.py b/docutils/test/test_transforms/test_smartquotes.py index f9e6707d2..dea85efae 100644 --- a/docutils/test/test_transforms/test_smartquotes.py +++ b/docutils/test/test_transforms/test_smartquotes.py @@ -51,7 +51,7 @@ def suite(): "'nested' smart" quotes -- and ---also long--- dashes. """, -u"""\ +"""\ <document source="test data"> <paragraph> Test “smart quotes”, ‘secondary smart quotes’, @@ -60,7 +60,7 @@ def suite(): """], [r"""Escaped \"ASCII quotes\" and \'secondary ASCII quotes\'. """, -u"""\ +"""\ <document source="test data"> <paragraph> Escaped "ASCII quotes" and 'secondary ASCII quotes'. @@ -85,7 +85,7 @@ def suite(): f'(x) = df(x)/dx """, -u"""\ +"""\ <document source="test data"> <paragraph> Do not “educate” quotes @@ -110,7 +110,7 @@ def suite(): <math_block xml:space="preserve"> f'(x) = df(x)/dx """], -[u"""\ +["""\ Closing quotes, if preceded by wor"d char's or punctuation:"a",'a';'a' (TODO: opening quotes if followed by word-char?). @@ -135,7 +135,7 @@ def suite(): "-", "–", "—", "(", "a[", "{" '-', '–', '—', '((', '[', '{' """, -u"""\ +"""\ <document source="test data"> <paragraph> Closing quotes, if preceded by @@ -173,7 +173,7 @@ def suite(): Do not drop characters from intra-word inline markup like *re*\\ ``Structured``\\ *Text*. """, -u"""\ +"""\ <document source="test data"> <paragraph> Quotes and inline-elements: @@ -227,7 +227,7 @@ def suite(): Do not drop characters from intra-word inline markup like *re*\\ ``Structured``\\ *Text*. """, -u"""\ +"""\ <document source="test data"> <paragraph> Do not convert context-character at inline-tag boundaries @@ -304,7 +304,7 @@ def suite(): .. [*] and footnotes """, -u"""\ +"""\ <document source="test data"> <paragraph> Docutils escape mechanism uses the backslash: @@ -394,7 +394,7 @@ def suite(): Alternative German "smart quotes" and 'secondary smart quotes'. """, -u"""\ +"""\ <document source="test data"> <paragraph classes="language-de"> German „smart quotes“ and ‚secondary smart quotes‘. @@ -419,7 +419,7 @@ def suite(): English "smart quotes" and 'secondary smart quotes'. """, -u"""\ +"""\ <document source="test data"> <paragraph> German „smart quotes“ and ‚secondary smart quotes‘. @@ -443,7 +443,7 @@ def suite(): Romanian "smart quotes" and 'secondary' smart quotes. """, -u"""\ +"""\ <document source="test data"> <paragraph> Alternative German »smart quotes« and ›secondary smart quotes‹. @@ -465,7 +465,7 @@ def suite(): Dutch "smart quotes" and 's Gravenhage (leading apostrophe). """, -u"""\ +"""\ <document source="test data"> <paragraph> German «smart quotes» and (secondary smart quotes). diff --git a/docutils/test/test_transforms/test_substitutions.py b/docutils/test/test_transforms/test_substitutions.py index 370901064..33d2b42af 100755 --- a/docutils/test/test_transforms/test_substitutions.py +++ b/docutils/test/test_transforms/test_substitutions.py @@ -52,7 +52,7 @@ def suite(): <paragraph> Undefined substitution referenced: "unknown". """], -[u"""\ +["""\ Substitutions support case differences: .. |eacute| replace:: \u00E9 @@ -60,7 +60,7 @@ def suite(): |Eacute|\\t\\ |eacute|, and even |EACUTE|. """, -u"""\ +"""\ <document source="test data"> <paragraph> Substitutions support case differences: @@ -76,7 +76,7 @@ def suite(): \u00C9 . """], -[u"""\ +["""\ Indirect substitution definitions with multiple references: |substitute| my coke for gin @@ -86,7 +86,7 @@ def suite(): .. |substitute| replace:: |replace| .. |replace| replace:: swap """, -u"""\ +"""\ <document source="test data"> <paragraph> Indirect substitution definitions with multiple references: @@ -112,7 +112,7 @@ def suite(): .. Note:: Note that |.| matches *exactly* one character """, -u"""\ +"""\ <document source="test data"> <substitution_definition names="l"> \xab @@ -229,12 +229,12 @@ def suite(): <paragraph> Circular substitution definition referenced: "Sub". """], -[u"""\ +["""\ Substitution reference with |reference-in-content|. .. |reference-in-content| replace:: text and hyperlink-reference_ """, -u"""\ +"""\ <document source="test data"> <paragraph> Substitution reference with @@ -260,7 +260,7 @@ def suite(): .. |bne| unicode:: U0003D U020E5 .. |Omega| unicode:: U+003A9 """, -u"""\ +"""\ <document source="test data"> <paragraph> Insert an em-dash ( @@ -297,7 +297,7 @@ def suite(): .. |BogusMegaCorp (TM)| unicode:: BogusMegaCorp U+2122 .. with trademark sign """, -u"""\ +"""\ <document source="test data"> <paragraph> Testing comments and extra text. @@ -325,7 +325,7 @@ def suite(): .. |rarrow| unicode:: U+2192 :rtrim: """, -u"""\ +"""\ <document source="test data"> <paragraph> Insert an em-dash diff --git a/docutils/test/test_utils.py b/docutils/test/test_utils.py index 25ff011e3..a4e9fc552 100755 --- a/docutils/test/test_utils.py +++ b/docutils/test/test_utils.py @@ -75,7 +75,7 @@ def test_level4(self): def test_unicode_message(self): sw = self.reporter.system_message(0, u'mesidʒ') - self.assertEqual(sw.pformat(), u"""\ + self.assertEqual(sw.pformat(), """\ <system_message level="0" source="test data" type="DEBUG"> <paragraph> mesidʒ @@ -89,7 +89,7 @@ def test_unicode_message_from_exception(self): raise Exception(u'mesidʒ') except Exception as err: sw = self.reporter.system_message(0, err) - self.assertEqual(sw.pformat(), u"""\ + self.assertEqual(sw.pformat(), """\ <system_message level="0" source="test data" type="DEBUG"> <paragraph> mesidʒ diff --git a/docutils/test/test_writers/test_docutils_xml.py b/docutils/test/test_writers/test_docutils_xml.py index b9bbe43ed..25da57677 100755 --- a/docutils/test/test_writers/test_docutils_xml.py +++ b/docutils/test/test_writers/test_docutils_xml.py @@ -27,17 +27,17 @@ # sample strings # -------------- -source = u"""\ +source = """\ Test ---------- Test. \xe4\xf6\xfc\u20ac""" -xmldecl = u"""<?xml version="1.0" encoding="iso-8859-1"?> +xmldecl = """<?xml version="1.0" encoding="iso-8859-1"?> """ -doctypedecl = u"""\ +doctypedecl = """\ <!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net\ //DTD Docutils Generic//EN//XML"\ "http://docutils.sourceforge.net/docs/ref/docutils.dtd"> @@ -45,12 +45,12 @@ generatedby = u'<!-- Generated by Docutils %s -->\n' % docutils.__version__ -bodynormal = u"""\ +bodynormal = """\ <document source="<string>"><paragraph>Test</paragraph>\ <transition></transition><paragraph>Test. \xe4\xf6\xfc€</paragraph>\ </document>""" -bodynewlines = u"""\ +bodynewlines = """\ <document source="<string>"> <paragraph>Test</paragraph> <transition></transition> @@ -58,7 +58,7 @@ </document> """ -bodyindents = u"""\ +bodyindents = """\ <document source="<string>"> <paragraph>Test</paragraph> <transition></transition> @@ -69,7 +69,7 @@ # raw XML # """"""" -raw_xml_source = u"""\ +raw_xml_source = """\ .. raw:: xml <root> @@ -85,7 +85,7 @@ :xml:`<test>inline raw XML</test>`. """ -raw_xml = u"""\ +raw_xml = """\ <document source="<string>"> <raw format="xml" xml:space="preserve"><root> <child>Test \xe4\xf6\xfc€</child> @@ -98,7 +98,7 @@ </document> """ -invalid_raw_xml_source = u"""\ +invalid_raw_xml_source = """\ .. raw:: xml <root> @@ -111,7 +111,7 @@ :xml:`<test>inline raw XML</test>`. """ -invalid_raw_xml = u"""\ +invalid_raw_xml = """\ <document source="<string>"> <raw format="xml" xml:space="preserve"><root> <child>Test \xe4\xf6\xfc\u20ac</child> diff --git a/docutils/test/test_writers/test_html4css1_misc.py b/docutils/test/test_writers/test_html4css1_misc.py index 902bbf513..0c83e06bb 100755 --- a/docutils/test/test_writers/test_html4css1_misc.py +++ b/docutils/test/test_writers/test_html4css1_misc.py @@ -187,7 +187,7 @@ def test_math_output_html_stylesheet(self): 'embed_stylesheet': False} styles = core.publish_parts(self.data, writer_name='html4css1', settings_overrides=mysettings)['stylesheet'] - self.assertEqual(u"""\ + self.assertEqual("""\ <link rel="stylesheet" href="functional/input/data/html4css1.css" type="text/css" /> <link rel="stylesheet" href="functional/input/data/math.css" type="text/css" /> <link rel="stylesheet" href="custom/style.css" type="text/css" /> diff --git a/docutils/test/test_writers/test_html5_polyglot_misc.py b/docutils/test/test_writers/test_html5_polyglot_misc.py index 43ea3a5e9..b8227201b 100644 --- a/docutils/test/test_writers/test_html5_polyglot_misc.py +++ b/docutils/test/test_writers/test_html5_polyglot_misc.py @@ -202,7 +202,7 @@ def test_math_output_html_stylesheet(self): 'embed_stylesheet': False} styles = core.publish_parts(self.data, writer_name='html5_polyglot', settings_overrides=mysettings)['stylesheet'] - self.assertEqual(u"""\ + self.assertEqual("""\ <link rel="stylesheet" href="functional/input/data/minimal.css" type="text/css" /> <link rel="stylesheet" href="functional/input/data/plain.css" type="text/css" /> <link rel="stylesheet" href="functional/input/data/math.css" type="text/css" /> From 1a85c0137779f3301ef35c3d529b4234c8339d2c Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Fri, 21 Jan 2022 18:57:35 +0000 Subject: [PATCH 03/36] s/u"/"/ --- docutils/docutils/utils/error_reporting.py | 2 +- docutils/docutils/utils/math/math2html.py | 4 ++-- docutils/docutils/utils/smartquotes.py | 12 ++++++------ docutils/docutils/writers/manpage.py | 2 +- docutils/test/test_nodes.py | 4 ++-- .../test_rst/test_directives/test_images.py | 2 +- .../test_rst/test_directives/test_tables.py | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docutils/docutils/utils/error_reporting.py b/docutils/docutils/utils/error_reporting.py index 0b34319a9..ec6a05ec0 100644 --- a/docutils/docutils/utils/error_reporting.py +++ b/docutils/docutils/utils/error_reporting.py @@ -135,7 +135,7 @@ def __unicode__(self): return u except UnicodeError as error: # catch ..Encode.. and ..Decode.. errors if isinstance(self.data, EnvironmentError): - return u"[Errno %s] %s: '%s'" % (self.data.errno, + return "[Errno %s] %s: '%s'" % (self.data.errno, SafeString(self.data.strerror, self.encoding, self.decoding_errors), SafeString(self.data.filename, self.encoding, diff --git a/docutils/docutils/utils/math/math2html.py b/docutils/docutils/utils/math/math2html.py index 00d1cdff6..6f9eb0f5f 100755 --- a/docutils/docutils/utils/math/math2html.py +++ b/docutils/docutils/utils/math/math2html.py @@ -109,7 +109,7 @@ class EscapeConfig(object): chars = { u'\n': u'', - u"'": u'’', + "'": u'’', u'`': u'‘', } @@ -176,7 +176,7 @@ class FormulaConfig(object): } combiningfunctions = { - u"\\'": u'́', + "\\'": u'́', u'\\"': u'̈', u'\\^': u'̂', u'\\`': u'̀', diff --git a/docutils/docutils/utils/smartquotes.py b/docutils/docutils/utils/smartquotes.py index 0ab7ad4ab..cd3a3136c 100644 --- a/docutils/docutils/utils/smartquotes.py +++ b/docutils/docutils/utils/smartquotes.py @@ -978,12 +978,12 @@ def tokenize(text): class TestSmartypantsAllAttributes(unittest.TestCase): # the default attribute is "1", which means "all". def test_dates(self): - self.assertEqual(smartyPants("1440-80's"), u"1440-80’s") - self.assertEqual(smartyPants("1440-'80s"), u"1440-’80s") - self.assertEqual(smartyPants("1440---'80s"), u"1440–’80s") - self.assertEqual(smartyPants("1960's"), u"1960’s") - self.assertEqual(smartyPants("one two '60s"), u"one two ’60s") - self.assertEqual(smartyPants("'60s"), u"’60s") + self.assertEqual(smartyPants("1440-80's"), "1440-80’s") + self.assertEqual(smartyPants("1440-'80s"), "1440-’80s") + self.assertEqual(smartyPants("1440---'80s"), "1440–’80s") + self.assertEqual(smartyPants("1960's"), "1960’s") + self.assertEqual(smartyPants("one two '60s"), "one two ’60s") + self.assertEqual(smartyPants("'60s"), "’60s") def test_educated_quotes(self): self.assertEqual(smartyPants('"Isn\'t this fun?"'), u'“Isn’t this fun?”') diff --git a/docutils/docutils/writers/manpage.py b/docutils/docutils/writers/manpage.py index 7cc54b133..fd4310fe6 100644 --- a/docutils/docutils/writers/manpage.py +++ b/docutils/docutils/writers/manpage.py @@ -284,7 +284,7 @@ def visit_Text(self, node): replace_pairs = [ (u'-', u'\\-'), (u'\'', u'\\(aq'), - (u'´', u"\\'"), + (u'´', "\\'"), (u'`', u'\\(ga'), (u'"', u'\\(dq'), # double quotes are a problem on macro lines ] diff --git a/docutils/test/test_nodes.py b/docutils/test/test_nodes.py index 119974e5b..8db5d0b6f 100755 --- a/docutils/test/test_nodes.py +++ b/docutils/test/test_nodes.py @@ -31,7 +31,7 @@ def test_repr(self): self.assertEqual(repr(self.text), r"<#text: 'Line 1.\nLine 2.'>") self.assertEqual(self.text.shortrepr(), r"<#text: 'Line 1.\nLine 2.'>") - self.assertEqual(repr(self.unicode_text), u"<#text: 'Möhren'>") + self.assertEqual(repr(self.unicode_text), "<#text: 'Möhren'>") def test_str(self): self.assertEqual(str(self.text), 'Line 1.\nLine 2.') @@ -106,7 +106,7 @@ def test_withtext(self): element = nodes.Element('text\nmore', nodes.Text('text\nmore')) uelement = nodes.Element(u'grün', nodes.Text(u'grün')) self.assertEqual(repr(element), r"<Element: <#text: 'text\nmore'>>") - self.assertEqual(repr(uelement), u"<Element: <#text: 'grün'>>") + self.assertEqual(repr(uelement), "<Element: <#text: 'grün'>>") self.assertTrue(isinstance(repr(uelement), str)) self.assertEqual(str(element), '<Element>text\nmore</Element>') self.assertEqual(str(uelement), '<Element>gr\xfcn</Element>') diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_images.py b/docutils/test/test_parsers/test_rst/test_directives/test_images.py index 2b2d84722..3217cfeab 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_images.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_images.py @@ -278,7 +278,7 @@ def suite(): <literal_block xml:space="preserve"> .. image:: picture.png :scale: fifty -""" % DocutilsTestSupport.exception_data(int, u"fifty")[1][0]], +""" % DocutilsTestSupport.exception_data(int, "fifty")[1][0]], ["""\ .. image:: picture.png :scale: 50 diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_tables.py b/docutils/test/test_parsers/test_rst/test_directives/test_tables.py index f84609810..f1ce50f50 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_tables.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_tables.py @@ -939,7 +939,7 @@ def null_bytes(): :widths: 0 0 0 \n\ some, csv, data -""" % DocutilsTestSupport.exception_data(int, u"y")[1][0]], +""" % DocutilsTestSupport.exception_data(int, "y")[1][0]], ["""\ .. csv-table:: good delimiter :delim: / From b345ca6ce37c7ffb5e64ddd6eb4ad228d36ef394 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Fri, 21 Jan 2022 19:00:11 +0000 Subject: [PATCH 04/36] s/u'/'/ --- docutils/docs/user/smartquotes.txt | 4 +- docutils/docutils/core.py | 10 +- docutils/docutils/frontend.py | 4 +- docutils/docutils/io.py | 4 +- docutils/docutils/languages/ar.py | 70 +- docutils/docutils/languages/ca.py | 68 +- docutils/docutils/languages/cs.py | 68 +- docutils/docutils/languages/da.py | 70 +- docutils/docutils/languages/eo.py | 46 +- docutils/docutils/languages/es.py | 68 +- docutils/docutils/languages/fa.py | 70 +- docutils/docutils/languages/fi.py | 68 +- docutils/docutils/languages/fr.py | 68 +- docutils/docutils/languages/gl.py | 68 +- docutils/docutils/languages/he.py | 68 +- docutils/docutils/languages/ja.py | 68 +- docutils/docutils/languages/ko.py | 68 +- docutils/docutils/languages/lt.py | 10 +- docutils/docutils/languages/pl.py | 68 +- docutils/docutils/languages/pt_br.py | 68 +- docutils/docutils/languages/ru.py | 68 +- docutils/docutils/languages/sk.py | 68 +- docutils/docutils/languages/sv.py | 68 +- docutils/docutils/languages/zh_cn.py | 74 +- docutils/docutils/languages/zh_tw.py | 50 +- docutils/docutils/nodes.py | 86 +- .../parsers/rst/directives/__init__.py | 2 +- .../docutils/parsers/rst/directives/body.py | 4 +- .../docutils/parsers/rst/directives/misc.py | 18 +- .../docutils/parsers/rst/directives/tables.py | 2 +- docutils/docutils/parsers/rst/languages/af.py | 10 +- docutils/docutils/parsers/rst/languages/ar.py | 148 +- docutils/docutils/parsers/rst/languages/ca.py | 186 +- docutils/docutils/parsers/rst/languages/cs.py | 152 +- docutils/docutils/parsers/rst/languages/da.py | 160 +- docutils/docutils/parsers/rst/languages/de.py | 46 +- docutils/docutils/parsers/rst/languages/eo.py | 166 +- docutils/docutils/parsers/rst/languages/es.py | 184 +- docutils/docutils/parsers/rst/languages/fa.py | 148 +- docutils/docutils/parsers/rst/languages/fi.py | 138 +- docutils/docutils/parsers/rst/languages/fr.py | 152 +- docutils/docutils/parsers/rst/languages/gl.py | 148 +- docutils/docutils/parsers/rst/languages/he.py | 32 +- docutils/docutils/parsers/rst/languages/it.py | 4 +- docutils/docutils/parsers/rst/languages/ja.py | 178 +- docutils/docutils/parsers/rst/languages/ko.py | 162 +- docutils/docutils/parsers/rst/languages/lt.py | 120 +- docutils/docutils/parsers/rst/languages/nl.py | 10 +- docutils/docutils/parsers/rst/languages/pl.py | 130 +- .../docutils/parsers/rst/languages/pt_br.py | 76 +- docutils/docutils/parsers/rst/languages/ru.py | 130 +- docutils/docutils/parsers/rst/languages/sk.py | 136 +- docutils/docutils/parsers/rst/languages/sv.py | 140 +- .../docutils/parsers/rst/languages/zh_cn.py | 154 +- .../docutils/parsers/rst/languages/zh_tw.py | 14 +- docutils/docutils/parsers/rst/states.py | 16 +- docutils/docutils/statemachine.py | 12 +- docutils/docutils/transforms/parts.py | 2 +- docutils/docutils/transforms/references.py | 16 +- docutils/docutils/utils/__init__.py | 6 +- docutils/docutils/utils/error_reporting.py | 8 +- docutils/docutils/utils/math/latex2mathml.py | 212 +-- docutils/docutils/utils/math/math2html.py | 678 +++---- .../docutils/utils/math/tex2mathml_extern.py | 6 +- docutils/docutils/utils/math/tex2unichar.py | 1340 +++++++------- docutils/docutils/utils/math/unichar2tex.py | 1598 ++++++++--------- docutils/docutils/utils/punctuation_chars.py | 108 +- docutils/docutils/utils/smartquotes.py | 188 +- docutils/docutils/writers/_html_base.py | 24 +- .../docutils/writers/html4css1/__init__.py | 2 +- docutils/docutils/writers/latex2e/__init__.py | 294 +-- docutils/docutils/writers/manpage.py | 16 +- docutils/docutils/writers/xetex/__init__.py | 2 +- docutils/test/test__init__.py | 6 +- docutils/test/test_command_line.py | 4 +- docutils/test/test_dependencies.py | 10 +- docutils/test/test_error_reporting.py | 44 +- docutils/test/test_io.py | 36 +- docutils/test/test_nodes.py | 346 ++-- .../test_rst/test_SimpleTableParser.py | 4 +- .../test_parsers/test_rst/test_TableParser.py | 8 +- .../test_rst/test_directives/test_include.py | 2 +- docutils/test/test_settings.py | 116 +- .../test/test_transforms/test_smartquotes.py | 2 +- docutils/test/test_utils.py | 42 +- .../test/test_writers/test_docutils_xml.py | 20 +- .../test/test_writers/test_html4css1_misc.py | 2 +- .../test_writers/test_html5_polyglot_misc.py | 4 +- .../test/test_writers/test_latex2e_misc.py | 2 +- .../tools/dev/generate_punctuation_chars.py | 62 +- docutils/tools/docutils-cli.py | 34 +- docutils/tools/rst2html5.py | 4 +- 92 files changed, 4847 insertions(+), 4829 deletions(-) diff --git a/docutils/docs/user/smartquotes.txt b/docutils/docs/user/smartquotes.txt index a186501ad..97536639c 100644 --- a/docutils/docs/user/smartquotes.txt +++ b/docutils/docs/user/smartquotes.txt @@ -263,7 +263,7 @@ There is built-in support for the following languages:\ [#smartquotes-locales]_ "'Dutch' alternative quotes" - .. # 'nl-x-altquot2': u'””’’', + .. # 'nl-x-altquot2': '””’’', :pl: .. class:: language-pl @@ -337,7 +337,7 @@ There is built-in support for the following languages:\ [#smartquotes-locales]_ "'Turkish' alternative quotes" -.. 'tr-x-altquot2': u'“„‘‚', # antiquated? +.. 'tr-x-altquot2': '“„‘‚', # antiquated? :uk: .. class:: language-uk diff --git a/docutils/docutils/core.py b/docutils/docutils/core.py index 6fc373527..93b368c9c 100644 --- a/docutils/docutils/core.py +++ b/docutils/docutils/core.py @@ -262,14 +262,14 @@ def report_Exception(self, error): elif isinstance(error, UnicodeEncodeError): self.report_UnicodeError(error) elif isinstance(error, io.InputError): - self._stderr.write(u'Unable to open source file for reading:\n' - u' %s\n' % io.error_string(error)) + self._stderr.write('Unable to open source file for reading:\n' + ' %s\n' % io.error_string(error)) elif isinstance(error, io.OutputError): self._stderr.write( - u'Unable to open destination file for writing:\n' - u' %s\n' % io.error_string(error)) + 'Unable to open destination file for writing:\n' + ' %s\n' % io.error_string(error)) else: - print(u'%s' % io.error_string(error), file=self._stderr) + print('%s' % io.error_string(error), file=self._stderr) print(("""\ Exiting due to error. Use "--traceback" to diagnose. Please report errors to <docutils-users@lists.sourceforge.net>. diff --git a/docutils/docutils/frontend.py b/docutils/docutils/frontend.py index 5dc3ede1d..524de4834 100644 --- a/docutils/docutils/frontend.py +++ b/docutils/docutils/frontend.py @@ -172,7 +172,7 @@ def validate_comma_separated_list(setting, value, option_parser, # this function is called for every option added to `value` # -> split the last item and append the result: last = value.pop() - items = [i.strip(u' \t\n') for i in last.split(u',') if i.strip(u' \t\n')] + items = [i.strip(' \t\n') for i in last.split(',') if i.strip(' \t\n')] value.extend(items) return value @@ -225,7 +225,7 @@ def validate_smartquotes_locales(setting, value, option_parser, lc_quotes.append(item) continue except ValueError: - raise ValueError(u'Invalid value "%s".' + raise ValueError('Invalid value "%s".' ' Format is "<language>:<quotes>".' % item.encode('ascii', 'backslashreplace')) # parse colon separated string list: diff --git a/docutils/docutils/io.py b/docutils/docutils/io.py index 46d3c6bf7..c1b16636b 100644 --- a/docutils/docutils/io.py +++ b/docutils/docutils/io.py @@ -139,7 +139,7 @@ def decode(self, data): decoded = str(data, enc, self.error_handler) self.successful_encoding = enc # Return decoded, removing BOMs. - return decoded.replace(u'\ufeff', u'') + return decoded.replace('\ufeff', '') except (UnicodeError, LookupError) as err: # keep exception instance for use outside of the "for" loop. error = err @@ -550,7 +550,7 @@ class NullInput(Input): def read(self): """Return a null string.""" - return u'' + return '' class NullOutput(Output): diff --git a/docutils/docutils/languages/ar.py b/docutils/docutils/languages/ar.py index 5f269b104..2d42e0673 100644 --- a/docutils/docutils/languages/ar.py +++ b/docutils/docutils/languages/ar.py @@ -15,46 +15,46 @@ labels = { # fixed: language-dependent - u'author': u'المؤلف', - u'authors': u'المؤلفون', - u'organization': u'التنظيم', - u'address': u'العنوان', - u'contact': u'اتصل', - u'version': u'نسخة', - u'revision': u'مراجعة', - u'status': u'الحالة', - u'date': u'تاریخ', - u'copyright': u'الحقوق', - u'dedication': u'إهداء', - u'abstract': u'ملخص', - u'attention': u'تنبيه', - u'caution': u'احتیاط', - u'danger': u'خطر', - u'error': u'خطأ', - u'hint': u'تلميح', - u'important': u'مهم', - u'note': u'ملاحظة', - u'tip': u'نصيحة', - u'warning': u'تحذير', - u'contents': u'المحتوى'} + 'author': 'المؤلف', + 'authors': 'المؤلفون', + 'organization': 'التنظيم', + 'address': 'العنوان', + 'contact': 'اتصل', + 'version': 'نسخة', + 'revision': 'مراجعة', + 'status': 'الحالة', + 'date': 'تاریخ', + 'copyright': 'الحقوق', + 'dedication': 'إهداء', + 'abstract': 'ملخص', + 'attention': 'تنبيه', + 'caution': 'احتیاط', + 'danger': 'خطر', + 'error': 'خطأ', + 'hint': 'تلميح', + 'important': 'مهم', + 'note': 'ملاحظة', + 'tip': 'نصيحة', + 'warning': 'تحذير', + 'contents': 'المحتوى'} """Mapping of node class name to label text.""" bibliographic_fields = { # language-dependent: fixed - u'مؤلف': u'author', - u'مؤلفون': u'authors', - u'التنظيم': u'organization', - u'العنوان': u'address', - u'اتصل': u'contact', - u'نسخة': u'version', - u'مراجعة': u'revision', - u'الحالة': u'status', - u'تاریخ': u'date', - u'الحقوق': u'copyright', - u'إهداء': u'dedication', - u'ملخص': u'abstract'} + 'مؤلف': 'author', + 'مؤلفون': 'authors', + 'التنظيم': 'organization', + 'العنوان': 'address', + 'اتصل': 'contact', + 'نسخة': 'version', + 'مراجعة': 'revision', + 'الحالة': 'status', + 'تاریخ': 'date', + 'الحقوق': 'copyright', + 'إهداء': 'dedication', + 'ملخص': 'abstract'} """Arabic (lowcased) to canonical name mapping for bibliographic fields.""" -author_separators = [u'؛', u'،'] +author_separators = ['؛', '،'] """List of separator strings for the 'Authors' bibliographic field. Tried in order.""" diff --git a/docutils/docutils/languages/ca.py b/docutils/docutils/languages/ca.py index db3614cf6..954e9a9db 100644 --- a/docutils/docutils/languages/ca.py +++ b/docutils/docutils/languages/ca.py @@ -15,44 +15,44 @@ labels = { # fixed: language-dependent - 'author': u'Autor', - 'authors': u'Autors', - 'organization': u'Organitzaci\u00F3', - 'address': u'Adre\u00E7a', - 'contact': u'Contacte', - 'version': u'Versi\u00F3', - 'revision': u'Revisi\u00F3', - 'status': u'Estat', - 'date': u'Data', - 'copyright': u'Copyright', - 'dedication': u'Dedicat\u00F2ria', - 'abstract': u'Resum', - 'attention': u'Atenci\u00F3!', - 'caution': u'Compte!', - 'danger': u'PERILL!', - 'error': u'Error', - 'hint': u'Suggeriment', - 'important': u'Important', - 'note': u'Nota', - 'tip': u'Consell', - 'warning': u'Av\u00EDs', - 'contents': u'Contingut'} + 'author': 'Autor', + 'authors': 'Autors', + 'organization': 'Organitzaci\u00F3', + 'address': 'Adre\u00E7a', + 'contact': 'Contacte', + 'version': 'Versi\u00F3', + 'revision': 'Revisi\u00F3', + 'status': 'Estat', + 'date': 'Data', + 'copyright': 'Copyright', + 'dedication': 'Dedicat\u00F2ria', + 'abstract': 'Resum', + 'attention': 'Atenci\u00F3!', + 'caution': 'Compte!', + 'danger': 'PERILL!', + 'error': 'Error', + 'hint': 'Suggeriment', + 'important': 'Important', + 'note': 'Nota', + 'tip': 'Consell', + 'warning': 'Av\u00EDs', + 'contents': 'Contingut'} """Mapping of node class name to label text.""" bibliographic_fields = { # language-dependent: fixed - u'autor': 'author', - u'autors': 'authors', - u'organitzaci\u00F3': 'organization', - u'adre\u00E7a': 'address', - u'contacte': 'contact', - u'versi\u00F3': 'version', - u'revisi\u00F3': 'revision', - u'estat': 'status', - u'data': 'date', - u'copyright': 'copyright', - u'dedicat\u00F2ria': 'dedication', - u'resum': 'abstract'} + 'autor': 'author', + 'autors': 'authors', + 'organitzaci\u00F3': 'organization', + 'adre\u00E7a': 'address', + 'contacte': 'contact', + 'versi\u00F3': 'version', + 'revisi\u00F3': 'revision', + 'estat': 'status', + 'data': 'date', + 'copyright': 'copyright', + 'dedicat\u00F2ria': 'dedication', + 'resum': 'abstract'} """Catalan (lowcased) to canonical name mapping for bibliographic fields.""" author_separators = [';', ','] diff --git a/docutils/docutils/languages/cs.py b/docutils/docutils/languages/cs.py index 67d0fae8b..f85382278 100644 --- a/docutils/docutils/languages/cs.py +++ b/docutils/docutils/languages/cs.py @@ -15,44 +15,44 @@ labels = { # fixed: language-dependent - 'author': u'Autor', - 'authors': u'Auto\u0159i', - 'organization': u'Organizace', - 'address': u'Adresa', - 'contact': u'Kontakt', - 'version': u'Verze', - 'revision': u'Revize', - 'status': u'Stav', - 'date': u'Datum', - 'copyright': u'Copyright', - 'dedication': u'V\u011Bnov\u00E1n\u00ED', - 'abstract': u'Abstrakt', - 'attention': u'Pozor!', - 'caution': u'Opatrn\u011B!', - 'danger': u'!NEBEZPE\u010C\u00CD!', - 'error': u'Chyba', - 'hint': u'Rada', - 'important': u'D\u016Fle\u017Eit\u00E9', - 'note': u'Pozn\u00E1mka', - 'tip': u'Tip', - 'warning': u'Varov\u00E1n\u00ED', - 'contents': u'Obsah'} + 'author': 'Autor', + 'authors': 'Auto\u0159i', + 'organization': 'Organizace', + 'address': 'Adresa', + 'contact': 'Kontakt', + 'version': 'Verze', + 'revision': 'Revize', + 'status': 'Stav', + 'date': 'Datum', + 'copyright': 'Copyright', + 'dedication': 'V\u011Bnov\u00E1n\u00ED', + 'abstract': 'Abstrakt', + 'attention': 'Pozor!', + 'caution': 'Opatrn\u011B!', + 'danger': '!NEBEZPE\u010C\u00CD!', + 'error': 'Chyba', + 'hint': 'Rada', + 'important': 'D\u016Fle\u017Eit\u00E9', + 'note': 'Pozn\u00E1mka', + 'tip': 'Tip', + 'warning': 'Varov\u00E1n\u00ED', + 'contents': 'Obsah'} """Mapping of node class name to label text.""" bibliographic_fields = { # language-dependent: fixed - u'autor': 'author', - u'auto\u0159i': 'authors', - u'organizace': 'organization', - u'adresa': 'address', - u'kontakt': 'contact', - u'verze': 'version', - u'revize': 'revision', - u'stav': 'status', - u'datum': 'date', - u'copyright': 'copyright', - u'v\u011Bnov\u00E1n\u00ED': 'dedication', - u'abstrakt': 'abstract'} + 'autor': 'author', + 'auto\u0159i': 'authors', + 'organizace': 'organization', + 'adresa': 'address', + 'kontakt': 'contact', + 'verze': 'version', + 'revize': 'revision', + 'stav': 'status', + 'datum': 'date', + 'copyright': 'copyright', + 'v\u011Bnov\u00E1n\u00ED': 'dedication', + 'abstrakt': 'abstract'} """Czech (lowcased) to canonical name mapping for bibliographic fields.""" author_separators = [';', ','] diff --git a/docutils/docutils/languages/da.py b/docutils/docutils/languages/da.py index 14c98083b..428c4eaf5 100644 --- a/docutils/docutils/languages/da.py +++ b/docutils/docutils/languages/da.py @@ -15,45 +15,45 @@ labels = { # fixed: language-dependent - 'author': u'Forfatter', - 'authors': u'Forfattere', - 'organization': u'Organisation', - 'address': u'Adresse', - 'contact': u'Kontakt', - 'version': u'Version', - 'revision': u'Revision', - 'status': u'Status', - 'date': u'Dato', - 'copyright': u'Copyright', - 'dedication': u'Dedikation', - 'abstract': u'Resumé', - 'attention': u'Giv agt!', - 'caution': u'Pas på!', - 'danger': u'!FARE!', - 'error': u'Fejl', - 'hint': u'Vink', - 'important': u'Vigtigt', - 'note': u'Bemærk', - 'tip': u'Tips', - 'warning': u'Advarsel', - 'contents': u'Indhold'} + 'author': 'Forfatter', + 'authors': 'Forfattere', + 'organization': 'Organisation', + 'address': 'Adresse', + 'contact': 'Kontakt', + 'version': 'Version', + 'revision': 'Revision', + 'status': 'Status', + 'date': 'Dato', + 'copyright': 'Copyright', + 'dedication': 'Dedikation', + 'abstract': 'Resumé', + 'attention': 'Giv agt!', + 'caution': 'Pas på!', + 'danger': '!FARE!', + 'error': 'Fejl', + 'hint': 'Vink', + 'important': 'Vigtigt', + 'note': 'Bemærk', + 'tip': 'Tips', + 'warning': 'Advarsel', + 'contents': 'Indhold'} """Mapping of node class name to label text.""" bibliographic_fields = { # language-dependent: fixed - u'forfatter': 'author', - u'forfattere': 'authors', - u'organisation': 'organization', - u'adresse': 'address', - u'kontakt': 'contact', - u'version': 'version', - u'revision': 'revision', - u'status': 'status', - u'dato': 'date', - u'copyright': 'copyright', - u'dedikation': 'dedication', - u'resume': 'abstract', - u'resumé': 'abstract'} + 'forfatter': 'author', + 'forfattere': 'authors', + 'organisation': 'organization', + 'adresse': 'address', + 'kontakt': 'contact', + 'version': 'version', + 'revision': 'revision', + 'status': 'status', + 'dato': 'date', + 'copyright': 'copyright', + 'dedikation': 'dedication', + 'resume': 'abstract', + 'resumé': 'abstract'} """Danish (lowcased) to canonical name mapping for bibliographic fields.""" author_separators = [';', ','] diff --git a/docutils/docutils/languages/eo.py b/docutils/docutils/languages/eo.py index 8671a90e2..1508ad412 100644 --- a/docutils/docutils/languages/eo.py +++ b/docutils/docutils/languages/eo.py @@ -15,29 +15,29 @@ labels = { # fixed: language-dependent - 'author': u'A\u016dtoro', - 'authors': u'A\u016dtoroj', - 'organization': u'Organizo', - 'address': u'Adreso', - 'contact': u'Kontakto', - 'version': u'Versio', - 'revision': u'Revido', - 'status': u'Stato', - 'date': u'Dato', - # 'copyright': u'Kopirajto', - 'copyright': u'A\u016dtorrajto', - 'dedication': u'Dedi\u0109o', - 'abstract': u'Resumo', - 'attention': u'Atentu!', - 'caution': u'Zorgu!', - 'danger': u'DAN\u011cERO!', - 'error': u'Eraro', - 'hint': u'Spuro', - 'important': u'Grava', - 'note': u'Noto', - 'tip': u'Helpeto', - 'warning': u'Averto', - 'contents': u'Enhavo'} + 'author': 'A\u016dtoro', + 'authors': 'A\u016dtoroj', + 'organization': 'Organizo', + 'address': 'Adreso', + 'contact': 'Kontakto', + 'version': 'Versio', + 'revision': 'Revido', + 'status': 'Stato', + 'date': 'Dato', + # 'copyright': 'Kopirajto', + 'copyright': 'A\u016dtorrajto', + 'dedication': 'Dedi\u0109o', + 'abstract': 'Resumo', + 'attention': 'Atentu!', + 'caution': 'Zorgu!', + 'danger': 'DAN\u011cERO!', + 'error': 'Eraro', + 'hint': 'Spuro', + 'important': 'Grava', + 'note': 'Noto', + 'tip': 'Helpeto', + 'warning': 'Averto', + 'contents': 'Enhavo'} """Mapping of node class name to label text.""" bibliographic_fields = { diff --git a/docutils/docutils/languages/es.py b/docutils/docutils/languages/es.py index 7e4a5e3f3..66e9c83f1 100644 --- a/docutils/docutils/languages/es.py +++ b/docutils/docutils/languages/es.py @@ -14,43 +14,43 @@ __docformat__ = 'reStructuredText' labels = { - 'author': u'Autor', - 'authors': u'Autores', - 'organization': u'Organizaci\u00f3n', - 'address': u'Direcci\u00f3n', - 'contact': u'Contacto', - 'version': u'Versi\u00f3n', - 'revision': u'Revisi\u00f3n', - 'status': u'Estado', - 'date': u'Fecha', - 'copyright': u'Copyright', - 'dedication': u'Dedicatoria', - 'abstract': u'Resumen', - 'attention': u'\u00a1Atenci\u00f3n!', - 'caution': u'\u00a1Precauci\u00f3n!', - 'danger': u'\u00a1PELIGRO!', - 'error': u'Error', - 'hint': u'Sugerencia', - 'important': u'Importante', - 'note': u'Nota', - 'tip': u'Consejo', - 'warning': u'Advertencia', - 'contents': u'Contenido'} + 'author': 'Autor', + 'authors': 'Autores', + 'organization': 'Organizaci\u00f3n', + 'address': 'Direcci\u00f3n', + 'contact': 'Contacto', + 'version': 'Versi\u00f3n', + 'revision': 'Revisi\u00f3n', + 'status': 'Estado', + 'date': 'Fecha', + 'copyright': 'Copyright', + 'dedication': 'Dedicatoria', + 'abstract': 'Resumen', + 'attention': '\u00a1Atenci\u00f3n!', + 'caution': '\u00a1Precauci\u00f3n!', + 'danger': '\u00a1PELIGRO!', + 'error': 'Error', + 'hint': 'Sugerencia', + 'important': 'Importante', + 'note': 'Nota', + 'tip': 'Consejo', + 'warning': 'Advertencia', + 'contents': 'Contenido'} """Mapping of node class name to label text.""" bibliographic_fields = { - u'autor': 'author', - u'autores': 'authors', - u'organizaci\u00f3n': 'organization', - u'direcci\u00f3n': 'address', - u'contacto': 'contact', - u'versi\u00f3n': 'version', - u'revisi\u00f3n': 'revision', - u'estado': 'status', - u'fecha': 'date', - u'copyright': 'copyright', - u'dedicatoria': 'dedication', - u'resumen': 'abstract'} + 'autor': 'author', + 'autores': 'authors', + 'organizaci\u00f3n': 'organization', + 'direcci\u00f3n': 'address', + 'contacto': 'contact', + 'versi\u00f3n': 'version', + 'revisi\u00f3n': 'revision', + 'estado': 'status', + 'fecha': 'date', + 'copyright': 'copyright', + 'dedicatoria': 'dedication', + 'resumen': 'abstract'} """Spanish (lowcased) to canonical name mapping for bibliographic fields.""" author_separators = [';', ','] diff --git a/docutils/docutils/languages/fa.py b/docutils/docutils/languages/fa.py index 82a160797..aeabdf383 100644 --- a/docutils/docutils/languages/fa.py +++ b/docutils/docutils/languages/fa.py @@ -15,46 +15,46 @@ labels = { # fixed: language-dependent - u'author': u'نویسنده', - u'authors': u'نویسندگان', - u'organization': u'سازمان', - u'address': u'آدرس', - u'contact': u'تماس', - u'version': u'نسخه', - u'revision': u'بازبینی', - u'status': u'وضعیت', - u'date': u'تاریخ', - u'copyright': u'کپی‌رایت', - u'dedication': u'تخصیص', - u'abstract': u'چکیده', - u'attention': u'توجه!', - u'caution': u'احتیاط!', - u'danger': u'خطر!', - u'error': u'خطا', - u'hint': u'راهنما', - u'important': u'مهم', - u'note': u'یادداشت', - u'tip': u'نکته', - u'warning': u'اخطار', - u'contents': u'محتوا'} + 'author': 'نویسنده', + 'authors': 'نویسندگان', + 'organization': 'سازمان', + 'address': 'آدرس', + 'contact': 'تماس', + 'version': 'نسخه', + 'revision': 'بازبینی', + 'status': 'وضعیت', + 'date': 'تاریخ', + 'copyright': 'کپی‌رایت', + 'dedication': 'تخصیص', + 'abstract': 'چکیده', + 'attention': 'توجه!', + 'caution': 'احتیاط!', + 'danger': 'خطر!', + 'error': 'خطا', + 'hint': 'راهنما', + 'important': 'مهم', + 'note': 'یادداشت', + 'tip': 'نکته', + 'warning': 'اخطار', + 'contents': 'محتوا'} """Mapping of node class name to label text.""" bibliographic_fields = { # language-dependent: fixed - u'نویسنده': u'author', - u'نویسندگان': u'authors', - u'سازمان': u'organization', - u'آدرس': u'address', - u'تماس': u'contact', - u'نسخه': u'version', - u'بازبینی': u'revision', - u'وضعیت': u'status', - u'تاریخ': u'date', - u'کپی‌رایت': u'copyright', - u'تخصیص': u'dedication', - u'چکیده': u'abstract'} + 'نویسنده': 'author', + 'نویسندگان': 'authors', + 'سازمان': 'organization', + 'آدرس': 'address', + 'تماس': 'contact', + 'نسخه': 'version', + 'بازبینی': 'revision', + 'وضعیت': 'status', + 'تاریخ': 'date', + 'کپی‌رایت': 'copyright', + 'تخصیص': 'dedication', + 'چکیده': 'abstract'} """Persian (lowcased) to canonical name mapping for bibliographic fields.""" -author_separators = [u'؛', u'،'] +author_separators = ['؛', '،'] """List of separator strings for the 'Authors' bibliographic field. Tried in order.""" diff --git a/docutils/docutils/languages/fi.py b/docutils/docutils/languages/fi.py index f95208e78..e78fb9d0f 100644 --- a/docutils/docutils/languages/fi.py +++ b/docutils/docutils/languages/fi.py @@ -15,44 +15,44 @@ labels = { # fixed: language-dependent - u'author': u'Tekij\u00e4', - u'authors': u'Tekij\u00e4t', - u'organization': u'Yhteis\u00f6', - u'address': u'Osoite', - u'contact': u'Yhteystiedot', - u'version': u'Versio', - u'revision': u'Vedos', - u'status': u'Tila', - u'date': u'P\u00e4iv\u00e4ys', - u'copyright': u'Tekij\u00e4noikeudet', - u'dedication': u'Omistuskirjoitus', - u'abstract': u'Tiivistelm\u00e4', - u'attention': u'Huomio!', - u'caution': u'Varo!', - u'danger': u'!VAARA!', - u'error': u'Virhe', - u'hint': u'Vihje', - u'important': u'T\u00e4rke\u00e4\u00e4', - u'note': u'Huomautus', - u'tip': u'Neuvo', - u'warning': u'Varoitus', - u'contents': u'Sis\u00e4llys'} + 'author': 'Tekij\u00e4', + 'authors': 'Tekij\u00e4t', + 'organization': 'Yhteis\u00f6', + 'address': 'Osoite', + 'contact': 'Yhteystiedot', + 'version': 'Versio', + 'revision': 'Vedos', + 'status': 'Tila', + 'date': 'P\u00e4iv\u00e4ys', + 'copyright': 'Tekij\u00e4noikeudet', + 'dedication': 'Omistuskirjoitus', + 'abstract': 'Tiivistelm\u00e4', + 'attention': 'Huomio!', + 'caution': 'Varo!', + 'danger': '!VAARA!', + 'error': 'Virhe', + 'hint': 'Vihje', + 'important': 'T\u00e4rke\u00e4\u00e4', + 'note': 'Huomautus', + 'tip': 'Neuvo', + 'warning': 'Varoitus', + 'contents': 'Sis\u00e4llys'} """Mapping of node class name to label text.""" bibliographic_fields = { # language-dependent: fixed - u'tekij\u00e4': u'author', - u'tekij\u00e4t': u'authors', - u'yhteis\u00f6': u'organization', - u'osoite': u'address', - u'yhteystiedot': u'contact', - u'versio': u'version', - u'vedos': u'revision', - u'tila': u'status', - u'p\u00e4iv\u00e4ys': u'date', - u'tekij\u00e4noikeudet': u'copyright', - u'omistuskirjoitus': u'dedication', - u'tiivistelm\u00e4': u'abstract'} + 'tekij\u00e4': 'author', + 'tekij\u00e4t': 'authors', + 'yhteis\u00f6': 'organization', + 'osoite': 'address', + 'yhteystiedot': 'contact', + 'versio': 'version', + 'vedos': 'revision', + 'tila': 'status', + 'p\u00e4iv\u00e4ys': 'date', + 'tekij\u00e4noikeudet': 'copyright', + 'omistuskirjoitus': 'dedication', + 'tiivistelm\u00e4': 'abstract'} """Finnish (lowcased) to canonical name mapping for bibliographic fields.""" author_separators = [';', ','] diff --git a/docutils/docutils/languages/fr.py b/docutils/docutils/languages/fr.py index 0164dc53d..9058a49f7 100644 --- a/docutils/docutils/languages/fr.py +++ b/docutils/docutils/languages/fr.py @@ -14,43 +14,43 @@ __docformat__ = 'reStructuredText' labels = { - u'author': u'Auteur', - u'authors': u'Auteurs', - u'organization': u'Organisation', - u'address': u'Adresse', - u'contact': u'Contact', - u'version': u'Version', - u'revision': u'R\u00e9vision', - u'status': u'Statut', - u'date': u'Date', - u'copyright': u'Copyright', - u'dedication': u'D\u00e9dicace', - u'abstract': u'R\u00e9sum\u00e9', - u'attention': u'Attention!', - u'caution': u'Avertissement!', - u'danger': u'!DANGER!', - u'error': u'Erreur', - u'hint': u'Indication', - u'important': u'Important', - u'note': u'Note', - u'tip': u'Astuce', - u'warning': u'Avis', - u'contents': u'Sommaire'} + 'author': 'Auteur', + 'authors': 'Auteurs', + 'organization': 'Organisation', + 'address': 'Adresse', + 'contact': 'Contact', + 'version': 'Version', + 'revision': 'R\u00e9vision', + 'status': 'Statut', + 'date': 'Date', + 'copyright': 'Copyright', + 'dedication': 'D\u00e9dicace', + 'abstract': 'R\u00e9sum\u00e9', + 'attention': 'Attention!', + 'caution': 'Avertissement!', + 'danger': '!DANGER!', + 'error': 'Erreur', + 'hint': 'Indication', + 'important': 'Important', + 'note': 'Note', + 'tip': 'Astuce', + 'warning': 'Avis', + 'contents': 'Sommaire'} """Mapping of node class name to label text.""" bibliographic_fields = { - u'auteur': u'author', - u'auteurs': u'authors', - u'organisation': u'organization', - u'adresse': u'address', - u'contact': u'contact', - u'version': u'version', - u'r\u00e9vision': u'revision', - u'statut': u'status', - u'date': u'date', - u'copyright': u'copyright', - u'd\u00e9dicace': u'dedication', - u'r\u00e9sum\u00e9': u'abstract'} + 'auteur': 'author', + 'auteurs': 'authors', + 'organisation': 'organization', + 'adresse': 'address', + 'contact': 'contact', + 'version': 'version', + 'r\u00e9vision': 'revision', + 'statut': 'status', + 'date': 'date', + 'copyright': 'copyright', + 'd\u00e9dicace': 'dedication', + 'r\u00e9sum\u00e9': 'abstract'} """French (lowcased) to canonical name mapping for bibliographic fields.""" author_separators = [';', ','] diff --git a/docutils/docutils/languages/gl.py b/docutils/docutils/languages/gl.py index 0226b06c5..ddb9845d2 100644 --- a/docutils/docutils/languages/gl.py +++ b/docutils/docutils/languages/gl.py @@ -17,44 +17,44 @@ labels = { # fixed: language-dependent - 'author': u'Autor', - 'authors': u'Autores', - 'organization': u'Organizaci\u00f3n', - 'address': u'Enderezo', - 'contact': u'Contacto', - 'version': u'Versi\u00f3n', - 'revision': u'Revisi\u00f3n', - 'status': u'Estado', - 'date': u'Data', - 'copyright': u'Dereitos de copia', - 'dedication': u'Dedicatoria', - 'abstract': u'Abstract', - 'attention': u'Atenci\u00f3n!', - 'caution': u'Advertencia!', - 'danger': u'PERIGO!', - 'error': u'Erro', - 'hint': u'Consello', - 'important': u'Importante', - 'note': u'Nota', - 'tip': u'Suxesti\u00f3n', - 'warning': u'Aviso', - 'contents': u'Contido'} + 'author': 'Autor', + 'authors': 'Autores', + 'organization': 'Organizaci\u00f3n', + 'address': 'Enderezo', + 'contact': 'Contacto', + 'version': 'Versi\u00f3n', + 'revision': 'Revisi\u00f3n', + 'status': 'Estado', + 'date': 'Data', + 'copyright': 'Dereitos de copia', + 'dedication': 'Dedicatoria', + 'abstract': 'Abstract', + 'attention': 'Atenci\u00f3n!', + 'caution': 'Advertencia!', + 'danger': 'PERIGO!', + 'error': 'Erro', + 'hint': 'Consello', + 'important': 'Importante', + 'note': 'Nota', + 'tip': 'Suxesti\u00f3n', + 'warning': 'Aviso', + 'contents': 'Contido'} """Mapping of node class name to label text.""" bibliographic_fields = { # language-dependent: fixed - u'autor': 'author', - u'autores': 'authors', - u'organizaci\u00f3n': 'organization', - u'enderezo': 'address', - u'contacto': 'contact', - u'versi\u00f3n': 'version', - u'revisi\u00f3n': 'revision', - u'estado': 'status', - u'data': 'date', - u'dereitos de copia': 'copyright', - u'dedicatoria': 'dedication', - u'abstract': 'abstract'} + 'autor': 'author', + 'autores': 'authors', + 'organizaci\u00f3n': 'organization', + 'enderezo': 'address', + 'contacto': 'contact', + 'versi\u00f3n': 'version', + 'revisi\u00f3n': 'revision', + 'estado': 'status', + 'data': 'date', + 'dereitos de copia': 'copyright', + 'dedicatoria': 'dedication', + 'abstract': 'abstract'} """Galician (lowcased) to canonical name mapping for bibliographic fields.""" author_separators = [';', ','] diff --git a/docutils/docutils/languages/he.py b/docutils/docutils/languages/he.py index fc3bdd3e0..b17ef33ba 100644 --- a/docutils/docutils/languages/he.py +++ b/docutils/docutils/languages/he.py @@ -15,44 +15,44 @@ labels = { # fixed: language-dependent - 'author': u'\u05de\u05d7\u05d1\u05e8', - 'authors': u'\u05de\u05d7\u05d1\u05e8\u05d9', - 'organization': u'\u05d0\u05e8\u05d2\u05d5\u05df', - 'address': u'\u05db\u05ea\u05d5\u05d1\u05ea', - 'contact': u'\u05d0\u05d9\u05e9 \u05e7\u05e9\u05e8', - 'version': u'\u05d2\u05e8\u05e1\u05d4', - 'revision': u'\u05de\u05d4\u05d3\u05d5\u05e8\u05d4', - 'status': u'\u05e1\u05d8\u05d8\u05d5\u05e1', - 'date': u'\u05ea\u05d0\u05e8\u05d9\u05da', - 'copyright': u'\u05d6\u05db\u05d5\u05d9\u05d5\u05ea \u05e9\u05de\u05d5\u05e8\u05d5\u05ea', - 'dedication': u'\u05d4\u05e7\u05d3\u05e9\u05d4', - 'abstract': u'\u05ea\u05e7\u05e6\u05d9\u05e8', - 'attention': u'\u05ea\u05e9\u05d5\u05de\u05ea \u05dc\u05d1', - 'caution': u'\u05d6\u05d4\u05d9\u05e8\u05d5\u05ea', - 'danger': u'\u05e1\u05db\u05e0\u05d4', - 'error': u'\u05e9\u05d2\u05d9\u05d0\u05d4' , - 'hint': u'\u05e8\u05de\u05d6', - 'important': u'\u05d7\u05e9\u05d5\u05d1', - 'note': u'\u05d4\u05e2\u05e8\u05d4', - 'tip': u'\u05d8\u05d9\u05e4', - 'warning': u'\u05d0\u05d6\u05d4\u05e8\u05d4', - 'contents': u'\u05ea\u05d5\u05db\u05df'} + 'author': '\u05de\u05d7\u05d1\u05e8', + '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', + 'version': '\u05d2\u05e8\u05e1\u05d4', + 'revision': '\u05de\u05d4\u05d3\u05d5\u05e8\u05d4', + 'status': '\u05e1\u05d8\u05d8\u05d5\u05e1', + 'date': '\u05ea\u05d0\u05e8\u05d9\u05da', + 'copyright': '\u05d6\u05db\u05d5\u05d9\u05d5\u05ea \u05e9\u05de\u05d5\u05e8\u05d5\u05ea', + 'dedication': '\u05d4\u05e7\u05d3\u05e9\u05d4', + 'abstract': '\u05ea\u05e7\u05e6\u05d9\u05e8', + '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' , + 'hint': '\u05e8\u05de\u05d6', + 'important': '\u05d7\u05e9\u05d5\u05d1', + 'note': '\u05d4\u05e2\u05e8\u05d4', + 'tip': '\u05d8\u05d9\u05e4', + 'warning': '\u05d0\u05d6\u05d4\u05e8\u05d4', + 'contents': '\u05ea\u05d5\u05db\u05df'} """Mapping of node class name to label text.""" bibliographic_fields = { # language-dependent: fixed - u'\u05de\u05d7\u05d1\u05e8': 'author', - u'\u05de\u05d7\u05d1\u05e8\u05d9': 'authors', - u'\u05d0\u05e8\u05d2\u05d5\u05df': 'organization', - u'\u05db\u05ea\u05d5\u05d1\u05ea': 'address', - u'\u05d0\u05d9\u05e9 \u05e7\u05e9\u05e8': 'contact', - u'\u05d2\u05e8\u05e1\u05d4': 'version', - u'\u05de\u05d4\u05d3\u05d5\u05e8\u05d4': 'revision', - u'\u05e1\u05d8\u05d8\u05d5\u05e1': 'status', - u'\u05ea\u05d0\u05e8\u05d9\u05da': 'date', - u'\u05d6\u05db\u05d5\u05d9\u05d5\u05ea \u05e9\u05de\u05d5\u05e8\u05d5\u05ea': 'copyright', - u'\u05d4\u05e7\u05d3\u05e9\u05d4': 'dedication', - u'\u05ea\u05e7\u05e6\u05d9\u05e8': 'abstract'} + '\u05de\u05d7\u05d1\u05e8': 'author', + '\u05de\u05d7\u05d1\u05e8\u05d9': 'authors', + '\u05d0\u05e8\u05d2\u05d5\u05df': 'organization', + '\u05db\u05ea\u05d5\u05d1\u05ea': 'address', + '\u05d0\u05d9\u05e9 \u05e7\u05e9\u05e8': 'contact', + '\u05d2\u05e8\u05e1\u05d4': 'version', + '\u05de\u05d4\u05d3\u05d5\u05e8\u05d4': 'revision', + '\u05e1\u05d8\u05d8\u05d5\u05e1': 'status', + '\u05ea\u05d0\u05e8\u05d9\u05da': 'date', + '\u05d6\u05db\u05d5\u05d9\u05d5\u05ea \u05e9\u05de\u05d5\u05e8\u05d5\u05ea': 'copyright', + '\u05d4\u05e7\u05d3\u05e9\u05d4': 'dedication', + '\u05ea\u05e7\u05e6\u05d9\u05e8': 'abstract'} """Hebrew to canonical name mapping for bibliographic fields.""" author_separators = [';', ','] diff --git a/docutils/docutils/languages/ja.py b/docutils/docutils/languages/ja.py index e6587bfcf..03bff1b04 100644 --- a/docutils/docutils/languages/ja.py +++ b/docutils/docutils/languages/ja.py @@ -15,44 +15,44 @@ labels = { # fixed: language-dependent - 'author': u'著者', - 'authors': u'著者', - 'organization': u'組織', - 'address': u'住所', - 'contact': u'連絡先', - 'version': u'バージョン', - 'revision': u'リビジョン', - 'status': u'ステータス', - 'date': u'日付', - 'copyright': u'著作権', - 'dedication': u'献辞', - 'abstract': u'概要', - 'attention': u'注目!', - 'caution': u'注意!', - 'danger': u'!危険!', - 'error': u'エラー', - 'hint': u'ヒント', - 'important': u'重要', - 'note': u'備考', - 'tip': u'通報', - 'warning': u'警告', - 'contents': u'目次'} + 'author': '著者', + 'authors': '著者', + 'organization': '組織', + 'address': '住所', + 'contact': '連絡先', + 'version': 'バージョン', + 'revision': 'リビジョン', + 'status': 'ステータス', + 'date': '日付', + 'copyright': '著作権', + 'dedication': '献辞', + 'abstract': '概要', + 'attention': '注目!', + 'caution': '注意!', + 'danger': '!危険!', + 'error': 'エラー', + 'hint': 'ヒント', + 'important': '重要', + 'note': '備考', + 'tip': '通報', + 'warning': '警告', + 'contents': '目次'} """Mapping of node class name to label text.""" bibliographic_fields = { # language-dependent: fixed - u'著者': 'author', - u' n/a': 'authors', - u'組織': 'organization', - u'住所': 'address', - u'連絡先': 'contact', - u'バージョン': 'version', - u'リビジョン': 'revision', - u'ステータス': 'status', - u'日付': 'date', - u'著作権': 'copyright', - u'献辞': 'dedication', - u'概要': 'abstract'} + '著者': 'author', + ' n/a': 'authors', + '組織': 'organization', + '住所': 'address', + '連絡先': 'contact', + 'バージョン': 'version', + 'リビジョン': 'revision', + 'ステータス': 'status', + '日付': 'date', + '著作権': 'copyright', + '献辞': 'dedication', + '概要': 'abstract'} """Japanese (lowcased) to canonical name mapping for bibliographic fields.""" author_separators = [';', ','] diff --git a/docutils/docutils/languages/ko.py b/docutils/docutils/languages/ko.py index 2a5a42167..a7846754f 100644 --- a/docutils/docutils/languages/ko.py +++ b/docutils/docutils/languages/ko.py @@ -15,44 +15,44 @@ labels = { # fixed: language-dependent - 'author': u'저자', - 'authors': u'저자들', - 'organization': u'조직', - 'address': u'주소', - 'contact': u'연락처', - 'version': u'버전', - 'revision': u'리비전', - 'status': u'상태', - 'date': u'날짜', - 'copyright': u'저작권', - 'dedication': u'헌정', - 'abstract': u'요약', - 'attention': u'집중!', - 'caution': u'주의!', - 'danger': u'!위험!', - 'error': u'오류', - 'hint': u'실마리', - 'important': u'중요한', - 'note': u'비고', - 'tip': u'팁', - 'warning': u'경고', - 'contents': u'목차'} + 'author': '저자', + 'authors': '저자들', + 'organization': '조직', + 'address': '주소', + 'contact': '연락처', + 'version': '버전', + 'revision': '리비전', + 'status': '상태', + 'date': '날짜', + 'copyright': '저작권', + 'dedication': '헌정', + 'abstract': '요약', + 'attention': '집중!', + 'caution': '주의!', + 'danger': '!위험!', + 'error': '오류', + 'hint': '실마리', + 'important': '중요한', + 'note': '비고', + 'tip': '팁', + 'warning': '경고', + 'contents': '목차'} """Mapping of node class name to label text.""" bibliographic_fields = { # language-dependent: fixed - u'저자': 'author', - u'저자들': 'authors', - u'조직': 'organization', - u'주소': 'address', - u'연락처': 'contact', - u'버전': 'version', - u'리비전': 'revision', - u'상태': 'status', - u'날짜': 'date', - u'저작권': 'copyright', - u'헌정': 'dedication', - u'요약': 'abstract'} + '저자': 'author', + '저자들': 'authors', + '조직': 'organization', + '주소': 'address', + '연락처': 'contact', + '버전': 'version', + '리비전': 'revision', + '상태': 'status', + '날짜': 'date', + '저작권': 'copyright', + '헌정': 'dedication', + '요약': 'abstract'} """Korean to canonical name mapping for bibliographic fields.""" author_separators = [';', ','] diff --git a/docutils/docutils/languages/lt.py b/docutils/docutils/languages/lt.py index 99d3cb1ef..fa4afb829 100644 --- a/docutils/docutils/languages/lt.py +++ b/docutils/docutils/languages/lt.py @@ -22,20 +22,20 @@ 'contact': 'Kontaktas', 'version': 'Versija', 'revision': 'Revizija', - 'status': u'Būsena', + 'status': 'Būsena', 'date': 'Data', - 'copyright': u'Autoriaus teisės', + 'copyright': 'Autoriaus teisės', 'dedication': 'Dedikacija', 'abstract': 'Santrauka', - 'attention': u'Dėmesio!', + 'attention': 'Dėmesio!', 'caution': 'Atsargiai!', 'danger': '!PAVOJINGA!', 'error': 'Klaida', - 'hint': u'Užuomina', + 'hint': 'Užuomina', 'important': 'Svarbu', 'note': 'Pastaba', 'tip': 'Patarimas', - 'warning': u'Įspėjimas', + 'warning': 'Įspėjimas', 'contents': 'Turinys'} """Mapping of node class name to label text.""" diff --git a/docutils/docutils/languages/pl.py b/docutils/docutils/languages/pl.py index b6e17df32..33b919294 100644 --- a/docutils/docutils/languages/pl.py +++ b/docutils/docutils/languages/pl.py @@ -15,44 +15,44 @@ labels = { # fixed: language-dependent - 'author': u'Autor', - 'authors': u'Autorzy', - 'organization': u'Organizacja', - 'address': u'Adres', - 'contact': u'Kontakt', - 'version': u'Wersja', - 'revision': u'Korekta', - 'status': u'Status', - 'date': u'Data', - 'copyright': u'Copyright', - 'dedication': u'Dedykacja', - 'abstract': u'Streszczenie', - 'attention': u'Uwaga!', - 'caution': u'Ostro\u017cnie!', - 'danger': u'!Niebezpiecze\u0144stwo!', - 'error': u'B\u0142\u0105d', - 'hint': u'Wskaz\u00f3wka', - 'important': u'Wa\u017cne', - 'note': u'Przypis', - 'tip': u'Rada', - 'warning': u'Ostrze\u017cenie', - 'contents': u'Tre\u015b\u0107'} + 'author': 'Autor', + 'authors': 'Autorzy', + 'organization': 'Organizacja', + 'address': 'Adres', + 'contact': 'Kontakt', + 'version': 'Wersja', + 'revision': 'Korekta', + 'status': 'Status', + 'date': 'Data', + 'copyright': 'Copyright', + 'dedication': 'Dedykacja', + 'abstract': 'Streszczenie', + 'attention': 'Uwaga!', + 'caution': 'Ostro\u017cnie!', + 'danger': '!Niebezpiecze\u0144stwo!', + 'error': 'B\u0142\u0105d', + 'hint': 'Wskaz\u00f3wka', + 'important': 'Wa\u017cne', + 'note': 'Przypis', + 'tip': 'Rada', + 'warning': 'Ostrze\u017cenie', + 'contents': 'Tre\u015b\u0107'} """Mapping of node class name to label text.""" bibliographic_fields = { # language-dependent: fixed - u'autor': 'author', - u'autorzy': 'authors', - u'organizacja': 'organization', - u'adres': 'address', - u'kontakt': 'contact', - u'wersja': 'version', - u'korekta': 'revision', - u'status': 'status', - u'data': 'date', - u'copyright': 'copyright', - u'dedykacja': 'dedication', - u'streszczenie': 'abstract'} + 'autor': 'author', + 'autorzy': 'authors', + 'organizacja': 'organization', + 'adres': 'address', + 'kontakt': 'contact', + 'wersja': 'version', + 'korekta': 'revision', + 'status': 'status', + 'data': 'date', + 'copyright': 'copyright', + 'dedykacja': 'dedication', + 'streszczenie': 'abstract'} """Polish (lowcased) to canonical name mapping for bibliographic fields.""" author_separators = [';', ','] diff --git a/docutils/docutils/languages/pt_br.py b/docutils/docutils/languages/pt_br.py index c27a94d38..1a77aaf09 100644 --- a/docutils/docutils/languages/pt_br.py +++ b/docutils/docutils/languages/pt_br.py @@ -15,44 +15,44 @@ labels = { # fixed: language-dependent - 'author': u'Autor', - 'authors': u'Autores', - 'organization': u'Organiza\u00E7\u00E3o', - 'address': u'Endere\u00E7o', - 'contact': u'Contato', - 'version': u'Vers\u00E3o', - 'revision': u'Revis\u00E3o', - 'status': u'Estado', - 'date': u'Data', - 'copyright': u'Copyright', - 'dedication': u'Dedicat\u00F3ria', - 'abstract': u'Resumo', - 'attention': u'Aten\u00E7\u00E3o!', - 'caution': u'Cuidado!', - 'danger': u'PERIGO!', - 'error': u'Erro', - 'hint': u'Sugest\u00E3o', - 'important': u'Importante', - 'note': u'Nota', - 'tip': u'Dica', - 'warning': u'Aviso', - 'contents': u'Sum\u00E1rio'} + 'author': 'Autor', + 'authors': 'Autores', + 'organization': 'Organiza\u00E7\u00E3o', + 'address': 'Endere\u00E7o', + 'contact': 'Contato', + 'version': 'Vers\u00E3o', + 'revision': 'Revis\u00E3o', + 'status': 'Estado', + 'date': 'Data', + 'copyright': 'Copyright', + 'dedication': 'Dedicat\u00F3ria', + 'abstract': 'Resumo', + 'attention': 'Aten\u00E7\u00E3o!', + 'caution': 'Cuidado!', + 'danger': 'PERIGO!', + 'error': 'Erro', + 'hint': 'Sugest\u00E3o', + 'important': 'Importante', + 'note': 'Nota', + 'tip': 'Dica', + 'warning': 'Aviso', + 'contents': 'Sum\u00E1rio'} """Mapping of node class name to label text.""" bibliographic_fields = { # language-dependent: fixed - u'autor': 'author', - u'autores': 'authors', - u'organiza\u00E7\u00E3o': 'organization', - u'endere\u00E7o': 'address', - u'contato': 'contact', - u'vers\u00E3o': 'version', - u'revis\u00E3o': 'revision', - u'estado': 'status', - u'data': 'date', - u'copyright': 'copyright', - u'dedicat\u00F3ria': 'dedication', - u'resumo': 'abstract'} + 'autor': 'author', + 'autores': 'authors', + 'organiza\u00E7\u00E3o': 'organization', + 'endere\u00E7o': 'address', + 'contato': 'contact', + 'vers\u00E3o': 'version', + 'revis\u00E3o': 'revision', + 'estado': 'status', + 'data': 'date', + 'copyright': 'copyright', + 'dedicat\u00F3ria': 'dedication', + 'resumo': 'abstract'} """Brazilian Portuguese (lowcased) to canonical name mapping for bibliographic fields.""" author_separators = [';', ','] diff --git a/docutils/docutils/languages/ru.py b/docutils/docutils/languages/ru.py index eed76e6bb..e0ef64c2c 100644 --- a/docutils/docutils/languages/ru.py +++ b/docutils/docutils/languages/ru.py @@ -14,43 +14,43 @@ __docformat__ = 'reStructuredText' labels = { - u'abstract': u'Аннотация', - u'address': u'Адрес', - u'attention': u'Внимание!', - u'author': u'Автор', - u'authors': u'Авторы', - u'caution': u'Осторожно!', - u'contact': u'Контакт', - u'contents': u'Содержание', - u'copyright': u'Права копирования', - u'danger': u'ОПАСНО!', - u'date': u'Дата', - u'dedication': u'Посвящение', - u'error': u'Ошибка', - u'hint': u'Совет', - u'important': u'Важно', - u'note': u'Примечание', - u'organization': u'Организация', - u'revision': u'Редакция', - u'status': u'Статус', - u'tip': u'Подсказка', - u'version': u'Версия', - u'warning': u'Предупреждение'} + 'abstract': 'Аннотация', + 'address': 'Адрес', + 'attention': 'Внимание!', + 'author': 'Автор', + 'authors': 'Авторы', + 'caution': 'Осторожно!', + 'contact': 'Контакт', + 'contents': 'Содержание', + 'copyright': 'Права копирования', + 'danger': 'ОПАСНО!', + 'date': 'Дата', + 'dedication': 'Посвящение', + 'error': 'Ошибка', + 'hint': 'Совет', + 'important': 'Важно', + 'note': 'Примечание', + 'organization': 'Организация', + 'revision': 'Редакция', + 'status': 'Статус', + 'tip': 'Подсказка', + 'version': 'Версия', + 'warning': 'Предупреждение'} """Mapping of node class name to label text.""" bibliographic_fields = { - u'аннотация': u'abstract', - u'адрес': u'address', - u'автор': u'author', - u'авторы': u'authors', - u'контакт': u'contact', - u'права копирования': u'copyright', - u'дата': u'date', - u'посвящение': u'dedication', - u'организация': u'organization', - u'редакция': u'revision', - u'статус': u'status', - u'версия': u'version'} + 'аннотация': 'abstract', + 'адрес': 'address', + 'автор': 'author', + 'авторы': 'authors', + 'контакт': 'contact', + 'права копирования': 'copyright', + 'дата': 'date', + 'посвящение': 'dedication', + 'организация': 'organization', + 'редакция': 'revision', + 'статус': 'status', + 'версия': 'version'} """Russian (lowcased) to canonical name mapping for bibliographic fields.""" author_separators = [';', ','] diff --git a/docutils/docutils/languages/sk.py b/docutils/docutils/languages/sk.py index 3de048817..21b260f1f 100644 --- a/docutils/docutils/languages/sk.py +++ b/docutils/docutils/languages/sk.py @@ -14,43 +14,43 @@ __docformat__ = 'reStructuredText' labels = { - 'author': u'Autor', - 'authors': u'Autori', - 'organization': u'Organiz\u00E1cia', - 'address': u'Adresa', - 'contact': u'Kontakt', - 'version': u'Verzia', - 'revision': u'Rev\u00EDzia', - 'status': u'Stav', - 'date': u'D\u00E1tum', - 'copyright': u'Copyright', - 'dedication': u'Venovanie', - 'abstract': u'Abstraktne', - 'attention': u'Pozor!', - 'caution': u'Opatrne!', - 'danger': u'!NEBEZPE\u010cENSTVO!', - 'error': u'Chyba', - 'hint': u'Rada', - 'important': u'D\u00F4le\u017Eit\u00E9', - 'note': u'Pozn\u00E1mka', - 'tip': u'Tip', - 'warning': u'Varovanie', - 'contents': u'Obsah'} + 'author': 'Autor', + 'authors': 'Autori', + 'organization': 'Organiz\u00E1cia', + 'address': 'Adresa', + 'contact': 'Kontakt', + 'version': 'Verzia', + 'revision': 'Rev\u00EDzia', + 'status': 'Stav', + 'date': 'D\u00E1tum', + 'copyright': 'Copyright', + 'dedication': 'Venovanie', + 'abstract': 'Abstraktne', + 'attention': 'Pozor!', + 'caution': 'Opatrne!', + 'danger': '!NEBEZPE\u010cENSTVO!', + 'error': 'Chyba', + 'hint': 'Rada', + 'important': 'D\u00F4le\u017Eit\u00E9', + 'note': 'Pozn\u00E1mka', + 'tip': 'Tip', + 'warning': 'Varovanie', + 'contents': 'Obsah'} """Mapping of node class name to label text.""" bibliographic_fields = { - u'autor': 'author', - u'autori': 'authors', - u'organiz\u00E1cia': 'organization', - u'adresa': 'address', - u'kontakt': 'contact', - u'verzia': 'version', - u'rev\u00EDzia': 'revision', - u'stav': 'status', - u'd\u00E1tum': 'date', - u'copyright': 'copyright', - u'venovanie': 'dedication', - u'abstraktne': 'abstract'} + 'autor': 'author', + 'autori': 'authors', + 'organiz\u00E1cia': 'organization', + 'adresa': 'address', + 'kontakt': 'contact', + 'verzia': 'version', + 'rev\u00EDzia': 'revision', + 'stav': 'status', + 'd\u00E1tum': 'date', + 'copyright': 'copyright', + 'venovanie': 'dedication', + 'abstraktne': 'abstract'} """Slovak (lowcased) to canonical name mapping for bibliographic fields.""" author_separators = [';', ','] diff --git a/docutils/docutils/languages/sv.py b/docutils/docutils/languages/sv.py index f16a18d9d..e6c012cb4 100644 --- a/docutils/docutils/languages/sv.py +++ b/docutils/docutils/languages/sv.py @@ -14,44 +14,44 @@ __docformat__ = 'reStructuredText' labels = { - 'author': u'Författare', - 'authors': u'Författare', - 'organization': u'Organisation', - 'address': u'Adress', - 'contact': u'Kontakt', - 'version': u'Version', - 'revision': u'Revision', - 'status': u'Status', - 'date': u'Datum', - 'copyright': u'Copyright', - 'dedication': u'Dedikation', - 'abstract': u'Sammanfattning', - 'attention': u'Observera!', - 'caution': u'Akta!', # 'Varning' already used for 'warning' - 'danger': u'FARA!', - 'error': u'Fel', - 'hint': u'Vink', - 'important': u'Viktigt', - 'note': u'Notera', - 'tip': u'Tips', - 'warning': u'Varning', - 'contents': u'Innehåll' } + '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' } """Mapping of node class name to label text.""" bibliographic_fields = { # 'Author' and 'Authors' identical in Swedish; assume the plural: - u'författare': 'authors', - u' n/a': 'author', - u'organisation': 'organization', - u'adress': 'address', - u'kontakt': 'contact', - u'version': 'version', - u'revision': 'revision', - u'status': 'status', - u'datum': 'date', - u'copyright': 'copyright', - u'dedikation': 'dedication', - u'sammanfattning': 'abstract' } + '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' } """Swedish (lowcased) to canonical name mapping for bibliographic fields.""" author_separators = [';', ','] diff --git a/docutils/docutils/languages/zh_cn.py b/docutils/docutils/languages/zh_cn.py index b4ba1ef31..c46dfaca4 100644 --- a/docutils/docutils/languages/zh_cn.py +++ b/docutils/docutils/languages/zh_cn.py @@ -16,51 +16,51 @@ labels = { # fixed: language-dependent - 'author': u'作者', - 'authors': u'作者群', - 'organization': u'组织', - 'address': u'地址', - 'contact': u'联系', - 'version': u'版本', - 'revision': u'修订', - 'status': u'状态', - 'date': u'日期', - 'copyright': u'版权', - 'dedication': u'献辞', - 'abstract': u'摘要', - 'attention': u'注意', - 'caution': u'小心', - 'danger': u'危险', - 'error': u'错误', - 'hint': u'提示', - 'important': u'重要', - 'note': u'注解', - 'tip': u'技巧', - 'warning': u'警告', - 'contents': u'目录', + 'author': '作者', + 'authors': '作者群', + 'organization': '组织', + 'address': '地址', + 'contact': '联系', + 'version': '版本', + 'revision': '修订', + 'status': '状态', + 'date': '日期', + 'copyright': '版权', + 'dedication': '献辞', + 'abstract': '摘要', + 'attention': '注意', + 'caution': '小心', + 'danger': '危险', + 'error': '错误', + 'hint': '提示', + 'important': '重要', + 'note': '注解', + 'tip': '技巧', + 'warning': '警告', + 'contents': '目录', } """Mapping of node class name to label text.""" bibliographic_fields = { # language-dependent: fixed - u'作者': 'author', - u'作者群': 'authors', - u'组织': 'organization', - u'地址': 'address', - u'联系': 'contact', - u'版本': 'version', - u'修订': 'revision', - u'状态': 'status', - u'时间': 'date', - u'版权': 'copyright', - u'献辞': 'dedication', - u'摘要': 'abstract'} + '作者': 'author', + '作者群': 'authors', + '组织': 'organization', + '地址': 'address', + '联系': 'contact', + '版本': 'version', + '修订': 'revision', + '状态': 'status', + '时间': 'date', + '版权': 'copyright', + '献辞': 'dedication', + '摘要': 'abstract'} """Simplified Chinese to canonical name mapping for bibliographic fields.""" author_separators = [';', ',', - u'\uff1b', # ';' - u'\uff0c', # ',' - u'\u3001', # '、' + '\uff1b', # ';' + '\uff0c', # ',' + '\u3001', # '、' ] """List of separator strings for the 'Authors' bibliographic field. Tried in order.""" diff --git a/docutils/docutils/languages/zh_tw.py b/docutils/docutils/languages/zh_tw.py index 1c0837aa0..8eb5f723c 100644 --- a/docutils/docutils/languages/zh_tw.py +++ b/docutils/docutils/languages/zh_tw.py @@ -15,28 +15,28 @@ labels = { # fixed: language-dependent - 'author': u'\u4f5c\u8005', # '作者' <-- Chinese word - 'authors': u'\u4f5c\u8005\u7fa4', # '作者群', - 'organization': u'\u7d44\u7e54', # '組織', - 'address': u'\u5730\u5740', # '地址', - 'contact': u'\u9023\u7d61', # '連絡', - 'version': u'\u7248\u672c', # '版本', - 'revision': u'\u4fee\u8a02', # '修訂', - 'status': u'\u72c0\u614b', # '狀態', - 'date': u'\u65e5\u671f', # '日期', - 'copyright': u'\u7248\u6b0a', # '版權', - 'dedication': u'\u984c\u737b', # '題獻', - 'abstract': u'\u6458\u8981', # '摘要', - 'attention': u'\u6ce8\u610f\uff01', # '注意!', - 'caution': u'\u5c0f\u5fc3\uff01', # '小心!', - 'danger': u'\uff01\u5371\u96aa\uff01', # '!危險!', - 'error': u'\u932f\u8aa4', # '錯誤', - 'hint': u'\u63d0\u793a', # '提示', - 'important': u'\u91cd\u8981', # '注意!', - 'note': u'\u8a3b\u91cb', # '註釋', - 'tip': u'\u79d8\u8a23', # '秘訣', - 'warning': u'\u8b66\u544a', # '警告', - 'contents': u'\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 = [';', ',', - u'\uff1b', # ';' - u'\uff0c', # ',' - u'\u3001', # '、' + '\uff1b', # ';' + '\uff0c', # ',' + '\u3001', # '、' ] """List of separator strings for the 'Authors' bibliographic field. Tried in order.""" diff --git a/docutils/docutils/nodes.py b/docutils/docutils/nodes.py index a971c7dc2..f30bed71a 100644 --- a/docutils/docutils/nodes.py +++ b/docutils/docutils/nodes.py @@ -581,7 +581,7 @@ def shortrepr(self): def __str__(self): if self.children: - return u'%s%s%s' % (self.starttag(), + return '%s%s%s' % (self.starttag(), ''.join([str(c) for c in self.children]), self.endtag()) else: @@ -602,14 +602,14 @@ def starttag(self, quoteattr=None): else: value = str(value) value = quoteattr(value) - parts.append(u'%s=%s' % (name, value)) - return u'<%s>' % u' '.join(parts) + parts.append('%s=%s' % (name, value)) + return '<%s>' % ' '.join(parts) def endtag(self): return '</%s>' % self.tagname def emptytag(self): - return u'<%s/>' % u' '.join([self.tagname] + + return '<%s/>' % ' '.join([self.tagname] + ['%s="%s"' % (n, v) for n, v in self.attlist()]) @@ -1803,7 +1803,7 @@ def __init__(self, message=None, *children, **attributes): def astext(self): line = self.get('line', '') - return u'%s:%s: (%s/%s) %s' % (self['source'], line, self['type'], + return '%s:%s: (%s/%s) %s' % (self['source'], line, self['type'], self['level'], Element.astext(self)) @@ -2255,46 +2255,46 @@ def make_id(string): _non_id_chars = re.compile('[^a-z0-9]+') _non_id_at_ends = re.compile('^[-0-9]+|-+$') _non_id_translate = { - 0x00f8: u'o', # o with stroke - 0x0111: u'd', # d with stroke - 0x0127: u'h', # h with stroke - 0x0131: u'i', # dotless i - 0x0142: u'l', # l with stroke - 0x0167: u't', # t with stroke - 0x0180: u'b', # b with stroke - 0x0183: u'b', # b with topbar - 0x0188: u'c', # c with hook - 0x018c: u'd', # d with topbar - 0x0192: u'f', # f with hook - 0x0199: u'k', # k with hook - 0x019a: u'l', # l with bar - 0x019e: u'n', # n with long right leg - 0x01a5: u'p', # p with hook - 0x01ab: u't', # t with palatal hook - 0x01ad: u't', # t with hook - 0x01b4: u'y', # y with hook - 0x01b6: u'z', # z with stroke - 0x01e5: u'g', # g with stroke - 0x0225: u'z', # z with hook - 0x0234: u'l', # l with curl - 0x0235: u'n', # n with curl - 0x0236: u't', # t with curl - 0x0237: u'j', # dotless j - 0x023c: u'c', # c with stroke - 0x023f: u's', # s with swash tail - 0x0240: u'z', # z with swash tail - 0x0247: u'e', # e with stroke - 0x0249: u'j', # j with stroke - 0x024b: u'q', # q with hook tail - 0x024d: u'r', # r with stroke - 0x024f: u'y', # y with stroke + 0x00f8: 'o', # o with stroke + 0x0111: 'd', # d with stroke + 0x0127: 'h', # h with stroke + 0x0131: 'i', # dotless i + 0x0142: 'l', # l with stroke + 0x0167: 't', # t with stroke + 0x0180: 'b', # b with stroke + 0x0183: 'b', # b with topbar + 0x0188: 'c', # c with hook + 0x018c: 'd', # d with topbar + 0x0192: 'f', # f with hook + 0x0199: 'k', # k with hook + 0x019a: 'l', # l with bar + 0x019e: 'n', # n with long right leg + 0x01a5: 'p', # p with hook + 0x01ab: 't', # t with palatal hook + 0x01ad: 't', # t with hook + 0x01b4: 'y', # y with hook + 0x01b6: 'z', # z with stroke + 0x01e5: 'g', # g with stroke + 0x0225: 'z', # z with hook + 0x0234: 'l', # l with curl + 0x0235: 'n', # n with curl + 0x0236: 't', # t with curl + 0x0237: 'j', # dotless j + 0x023c: 'c', # c with stroke + 0x023f: 's', # s with swash tail + 0x0240: 'z', # z with swash tail + 0x0247: 'e', # e with stroke + 0x0249: 'j', # j with stroke + 0x024b: 'q', # q with hook tail + 0x024d: 'r', # r with stroke + 0x024f: 'y', # y with stroke } _non_id_translate_digraphs = { - 0x00df: u'sz', # ligature sz - 0x00e6: u'ae', # ae - 0x0153: u'oe', # ligature oe - 0x0238: u'db', # db digraph - 0x0239: u'qp', # qp digraph + 0x00df: 'sz', # ligature sz + 0x00e6: 'ae', # ae + 0x0153: 'oe', # ligature oe + 0x0238: 'db', # db digraph + 0x0239: 'qp', # qp digraph } def dupname(node, name): diff --git a/docutils/docutils/parsers/rst/directives/__init__.py b/docutils/docutils/parsers/rst/directives/__init__.py index cc469c10c..281e7b1b7 100644 --- a/docutils/docutils/parsers/rst/directives/__init__.py +++ b/docutils/docutils/parsers/rst/directives/__init__.py @@ -170,7 +170,7 @@ def unchanged(argument): No argument implies empty string (""). """ if argument is None: - return u'' + return '' else: return argument # unchanged! diff --git a/docutils/docutils/parsers/rst/directives/body.py b/docutils/docutils/parsers/rst/directives/body.py index 91cc3e7d0..4adfdff58 100644 --- a/docutils/docutils/parsers/rst/directives/body.py +++ b/docutils/docutils/parsers/rst/directives/body.py @@ -155,12 +155,12 @@ def run(self): # set up lexical analyzer try: - tokens = Lexer(u'\n'.join(self.content), language, + tokens = Lexer('\n'.join(self.content), language, self.state.document.settings.syntax_highlight) except LexerError as error: if self.state.document.settings.report_level > 2: # don't report warnings -> insert without syntax highlight - tokens = Lexer(u'\n'.join(self.content), language, 'none') + tokens = Lexer('\n'.join(self.content), language, 'none') else: raise self.warning(error) diff --git a/docutils/docutils/parsers/rst/directives/misc.py b/docutils/docutils/parsers/rst/directives/misc.py index 6610fbf8c..0c96ed93e 100644 --- a/docutils/docutils/parsers/rst/directives/misc.py +++ b/docutils/docutils/parsers/rst/directives/misc.py @@ -76,12 +76,12 @@ def run(self): encoding=encoding, error_handler=e_handler) except UnicodeEncodeError as error: - raise self.severe(u'Problems with "%s" directive path:\n' + raise self.severe('Problems with "%s" directive path:\n' 'Cannot encode input file path "%s" ' '(wrong locale?).' % (self.name, path)) except IOError as error: - raise self.severe(u'Problems with "%s" directive path:\n%s.' % + raise self.severe('Problems with "%s" directive path:\n%s.' % (self.name, io.error_string(error))) # Get to-be-included content @@ -94,7 +94,7 @@ def run(self): else: rawtext = include_file.read() except UnicodeError as error: - raise self.severe(u'Problem with "%s" directive:\n%s' % + raise self.severe('Problem with "%s" directive:\n%s' % (self.name, io.error_string(error))) # start-after/end-before: no restrictions on newlines in match-text, # and no restrictions on matching inside lines vs. line boundaries @@ -252,12 +252,12 @@ def run(self): # dependencies even if not used for the chosen output format. self.state.document.settings.record_dependencies.add(path) except IOError as error: - raise self.severe(u'Problems with "%s" directive path:\n%s.' + raise self.severe('Problems with "%s" directive path:\n%s.' % (self.name, io.error_string(error))) try: text = raw_file.read() except UnicodeError as error: - raise self.severe(u'Problem with "%s" directive:\n%s' + raise self.severe('Problem with "%s" directive:\n%s' % (self.name, io.error_string(error))) attributes['source'] = path elif 'url' in self.options: @@ -270,7 +270,7 @@ def run(self): try: raw_text = urlopen(source).read() except (URLError, IOError, OSError) as error: - raise self.severe(u'Problems with "%s" directive URL "%s":\n%s.' + raise self.severe('Problems with "%s" directive URL "%s":\n%s.' % (self.name, self.options['url'], io.error_string(error))) raw_file = io.StringInput(source=raw_text, source_path=source, encoding=encoding, @@ -278,7 +278,7 @@ def run(self): try: text = raw_file.read() except UnicodeError as error: - raise self.severe(u'Problem with "%s" directive:\n%s' + raise self.severe('Problem with "%s" directive:\n%s' % (self.name, io.error_string(error))) attributes['source'] = source else: @@ -361,7 +361,7 @@ def run(self): try: decoded = directives.unicode_code(code) except ValueError as error: - raise self.error(u'Invalid character code: %s\n%s' + raise self.error('Invalid character code: %s\n%s' % (code, io.error_string(error))) element += nodes.Text(decoded) return element.children @@ -457,7 +457,7 @@ def run(self): options['class'] = directives.class_option(new_role_name) except ValueError as detail: error = self.state_machine.reporter.error( - u'Invalid argument for "%s" directive:\n%s.' + '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] diff --git a/docutils/docutils/parsers/rst/directives/tables.py b/docutils/docutils/parsers/rst/directives/tables.py index 4a01fc6e8..c817fd707 100644 --- a/docutils/docutils/parsers/rst/directives/tables.py +++ b/docutils/docutils/parsers/rst/directives/tables.py @@ -322,7 +322,7 @@ def get_csv_data(self): csv_data = csv_file.read().splitlines() except IOError as error: severe = self.state_machine.reporter.severe( - u'Problems with "%s" directive path:\n%s.' + 'Problems with "%s" directive path:\n%s.' % (self.name, error), nodes.literal_block(self.block_text, self.block_text), line=self.lineno) diff --git a/docutils/docutils/parsers/rst/languages/af.py b/docutils/docutils/parsers/rst/languages/af.py index 70cd1b355..533138b11 100644 --- a/docutils/docutils/parsers/rst/languages/af.py +++ b/docutils/docutils/parsers/rst/languages/af.py @@ -36,8 +36,8 @@ 'epigraaf': 'epigraph', 'hoogtepunte': 'highlights', 'pull-quote (translation required)': 'pull-quote', - u'compound (translation required)': 'compound', - u'container (translation required)': 'container', + 'compound (translation required)': 'compound', + 'container (translation required)': 'container', #'vrae': 'questions', #'qa': 'questions', #'faq': 'questions', @@ -60,8 +60,8 @@ 'inhoud': 'contents', 'sectnum': 'sectnum', 'section-numbering': 'sectnum', - u'header (translation required)': 'header', - u'footer (translation required)': 'footer', + 'header (translation required)': 'header', + 'footer (translation required)': 'footer', #'voetnote': 'footnotes', #'aanhalings': 'citations', 'teikennotas': 'target-notes', @@ -74,7 +74,7 @@ 'ab': 'abbreviation', 'akroniem': 'acronym', 'ac': 'acronym', - u'code (translation required)': 'code', + 'code (translation required)': 'code', 'indeks': 'index', 'i': 'index', 'voetskrif': 'subscript', diff --git a/docutils/docutils/parsers/rst/languages/ar.py b/docutils/docutils/parsers/rst/languages/ar.py index 2edfdef94..23b389949 100644 --- a/docutils/docutils/parsers/rst/languages/ar.py +++ b/docutils/docutils/parsers/rst/languages/ar.py @@ -17,85 +17,85 @@ directives = { # language-dependent: fixed - u'تنبيه': u'attention', - u'احتیاط': u'caution', - u'كود': u'code', - u'كود': u'code', - u'كود': u'code', - u'خطر': u'danger', - u'خطأ': u'error', - u'تلميح': u'hint', - u'مهم': u'important', - u'ملاحظة': u'note', - u'نصيحة': u'tip', - u'تحذير': u'warning', - u'تذكير': u'admonition', - u'شريط-جانبي': u'sidebar', - u'موضوع': u'topic', - u'قالب-سطري': u'line-block', - u'لفظ-حرفي': u'parsed-literal', - u'معيار': u'rubric', - u'فكرة-الكتاب': u'epigraph', - u'تمييز': u'highlights', - u'نقل-قول': u'pull-quote', - u'ترکیب': u'compound', - u'وعاء': u'container', - #'questions': u'questions', - u'جدول': u'table', - u'جدول-csv': u'csv-table', - u'جدول-قوائم': u'list-table', - #'qa': u'questions', - #'faq': u'questions', - u'ميتا': u'meta', - u'رياضيات': u'math', - #'imagemap': u'imagemap', - u'صورة': u'image', - u'رسم-توضيحي': u'figure', - u'تضمين': u'include', - u'خام': u'raw', - u'تبديل': u'replace', - u'یونیکد': u'unicode', - u'تاریخ': u'date', - u'كائن': u'class', - u'قانون': u'role', - u'قانون-افتراضي': u'default-role', - u'عنوان': u'title', - u'المحتوى': u'contents', - u'رقم-الفصل': u'sectnum', - u'رقم-القسم': u'sectnum', - u'رأس-الصفحة': u'header', - u'هامش': u'footer', - #'footnotes': u'footnotes', - #'citations': u'citations', - u'': u'target-notes', + 'تنبيه': 'attention', + 'احتیاط': 'caution', + 'كود': 'code', + 'كود': 'code', + 'كود': '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', } """Arabic name to registered (in directives/__init__.py) directive name mapping.""" roles = { # language-dependent: fixed - u'اختصار': u'abbreviation', - u'اختزال': u'acronym', - u'كود': u'code', - u'فهرس': u'index', - u'خفض': u'subscript', - u'رفع': u'superscript', - u'عنوان-مرجع': u'title-reference', - u'مرجع-pep': u'pep-reference', - u'rfc-مرجع': u'rfc-reference', - u'تأكيد': u'emphasis', - u'عريض': u'strong', - u'لفظی': u'literal', - u'رياضيات': u'math', - u'مرجع-مسمى': u'named-reference', - u'مرجع-مجهول': u'anonymous-reference', - u'مرجع-هامشي': u'footnote-reference', - u'مرجع-منقول': u'citation-reference', - u'مرجع-معوض': u'substitution-reference', - u'هدف': u'target', - u'منبع-uri': u'uri-reference', - u'uri': u'uri-reference', - u'url': u'uri-reference', - u'خام': u'raw',} + 'اختصار': 'abbreviation', + 'اختزال': 'acronym', + 'كود': 'code', + 'فهرس': 'index', + 'خفض': 'subscript', + 'رفع': 'superscript', + 'عنوان-مرجع': 'title-reference', + 'مرجع-pep': 'pep-reference', + 'rfc-مرجع': 'rfc-reference', + 'تأكيد': 'emphasis', + 'عريض': 'strong', + 'لفظی': 'literal', + 'رياضيات': 'math', + 'مرجع-مسمى': 'named-reference', + 'مرجع-مجهول': 'anonymous-reference', + 'مرجع-هامشي': 'footnote-reference', + 'مرجع-منقول': 'citation-reference', + 'مرجع-معوض': 'substitution-reference', + 'هدف': 'target', + 'منبع-uri': 'uri-reference', + 'uri': 'uri-reference', + 'url': 'uri-reference', + 'خام': 'raw',} """Mapping of Arabic role names to canonical role names for interpreted text. """ diff --git a/docutils/docutils/parsers/rst/languages/ca.py b/docutils/docutils/parsers/rst/languages/ca.py index b487a561d..b618af362 100644 --- a/docutils/docutils/parsers/rst/languages/ca.py +++ b/docutils/docutils/parsers/rst/languages/ca.py @@ -17,109 +17,109 @@ directives = { # language-dependent: fixed - u'atenci\u00F3': 'attention', - u'compte': 'caution', - u'code (translation required)': 'code', - u'perill': 'danger', - u'error': 'error', - u'suggeriment': 'hint', - u'important': 'important', - u'nota': 'note', - u'consell': 'tip', - u'av\u00EDs': 'warning', - u'advertiment': 'admonition', - u'nota-al-marge': 'sidebar', - u'nota-marge': 'sidebar', - u'tema': 'topic', - u'bloc-de-l\u00EDnies': 'line-block', - u'bloc-l\u00EDnies': 'line-block', - u'literal-analitzat': 'parsed-literal', - u'r\u00FAbrica': 'rubric', - u'ep\u00EDgraf': 'epigraph', - u'sumari': 'highlights', - u'cita-destacada': 'pull-quote', - u'compost': 'compound', - u'container (translation required)': 'container', + 'atenci\u00F3': 'attention', + 'compte': 'caution', + 'code (translation required)': 'code', + 'perill': 'danger', + 'error': 'error', + 'suggeriment': 'hint', + 'important': 'important', + 'nota': 'note', + 'consell': 'tip', + 'av\u00EDs': 'warning', + 'advertiment': 'admonition', + 'nota-al-marge': 'sidebar', + 'nota-marge': 'sidebar', + 'tema': 'topic', + 'bloc-de-l\u00EDnies': 'line-block', + 'bloc-l\u00EDnies': 'line-block', + 'literal-analitzat': 'parsed-literal', + 'r\u00FAbrica': 'rubric', + 'ep\u00EDgraf': 'epigraph', + 'sumari': 'highlights', + 'cita-destacada': 'pull-quote', + 'compost': 'compound', + 'container (translation required)': 'container', #'questions': 'questions', - u'taula': 'table', - u'taula-csv': 'csv-table', - u'taula-llista': 'list-table', + 'taula': 'table', + 'taula-csv': 'csv-table', + 'taula-llista': 'list-table', #'qa': 'questions', #'faq': 'questions', - u'math (translation required)': 'math', - u'meta': 'meta', + 'math (translation required)': 'math', + 'meta': 'meta', #'imagemap': 'imagemap', - u'imatge': 'image', - u'figura': 'figure', - u'inclou': 'include', - u'incloure': 'include', - u'cru': 'raw', - u'reempla\u00E7a': 'replace', - u'reempla\u00E7ar': 'replace', - u'unicode': 'unicode', - u'data': 'date', - u'classe': 'class', - u'rol': 'role', - u'default-role (translation required)': 'default-role', - u'title (translation required)': 'title', - u'contingut': 'contents', - u'numsec': 'sectnum', - u'numeraci\u00F3-de-seccions': 'sectnum', - u'numeraci\u00F3-seccions': 'sectnum', - u'cap\u00E7alera': 'header', - u'peu-de-p\u00E0gina': 'footer', - u'peu-p\u00E0gina': 'footer', + 'imatge': 'image', + 'figura': 'figure', + 'inclou': 'include', + 'incloure': 'include', + 'cru': 'raw', + 'reempla\u00E7a': 'replace', + 'reempla\u00E7ar': 'replace', + 'unicode': 'unicode', + 'data': 'date', + 'classe': 'class', + 'rol': 'role', + 'default-role (translation required)': 'default-role', + 'title (translation required)': 'title', + 'contingut': 'contents', + 'numsec': 'sectnum', + 'numeraci\u00F3-de-seccions': 'sectnum', + 'numeraci\u00F3-seccions': 'sectnum', + 'cap\u00E7alera': 'header', + 'peu-de-p\u00E0gina': 'footer', + 'peu-p\u00E0gina': 'footer', #'footnotes': 'footnotes', #'citations': 'citations', - u'notes-amb-destinacions': 'target-notes', - u'notes-destinacions': 'target-notes', - u'directiva-de-prova-de-restructuredtext': 'restructuredtext-test-directive'} + 'notes-amb-destinacions': 'target-notes', + 'notes-destinacions': 'target-notes', + 'directiva-de-prova-de-restructuredtext': 'restructuredtext-test-directive'} """Catalan name to registered (in directives/__init__.py) directive name mapping.""" roles = { # language-dependent: fixed - u'abreviatura': 'abbreviation', - u'abreviaci\u00F3': 'abbreviation', - u'abrev': 'abbreviation', - u'ab': 'abbreviation', - u'acr\u00F2nim': 'acronym', - u'ac': 'acronym', - u'code (translation required)': 'code', - u'\u00EDndex': 'index', - u'i': 'index', - u'sub\u00EDndex': 'subscript', - u'sub': 'subscript', - u'super\u00EDndex': 'superscript', - u'sup': 'superscript', - u'refer\u00E8ncia-a-t\u00EDtol': 'title-reference', - u'refer\u00E8ncia-t\u00EDtol': 'title-reference', - u't\u00EDtol': 'title-reference', - u't': 'title-reference', - u'refer\u00E8ncia-a-pep': 'pep-reference', - u'refer\u00E8ncia-pep': 'pep-reference', - u'pep': 'pep-reference', - u'refer\u00E8ncia-a-rfc': 'rfc-reference', - u'refer\u00E8ncia-rfc': 'rfc-reference', - u'rfc': 'rfc-reference', - u'\u00E8mfasi': 'emphasis', - u'destacat': 'strong', - u'literal': 'literal', - u'math (translation required)': 'math', - u'refer\u00E8ncia-amb-nom': 'named-reference', - u'refer\u00E8ncia-nom': 'named-reference', - u'refer\u00E8ncia-an\u00F2nima': 'anonymous-reference', - u'refer\u00E8ncia-a-nota-al-peu': 'footnote-reference', - u'refer\u00E8ncia-nota-al-peu': 'footnote-reference', - u'refer\u00E8ncia-a-cita': 'citation-reference', - u'refer\u00E8ncia-cita': 'citation-reference', - u'refer\u00E8ncia-a-substituci\u00F3': 'substitution-reference', - u'refer\u00E8ncia-substituci\u00F3': 'substitution-reference', - u'destinaci\u00F3': 'target', - u'refer\u00E8ncia-a-uri': 'uri-reference', - u'refer\u00E8ncia-uri': 'uri-reference', - u'uri': 'uri-reference', - u'url': 'uri-reference', - u'cru': 'raw',} + 'abreviatura': 'abbreviation', + 'abreviaci\u00F3': 'abbreviation', + 'abrev': 'abbreviation', + 'ab': 'abbreviation', + 'acr\u00F2nim': 'acronym', + 'ac': 'acronym', + 'code (translation required)': 'code', + '\u00EDndex': 'index', + 'i': 'index', + 'sub\u00EDndex': 'subscript', + 'sub': 'subscript', + 'super\u00EDndex': 'superscript', + 'sup': 'superscript', + 'refer\u00E8ncia-a-t\u00EDtol': 'title-reference', + 'refer\u00E8ncia-t\u00EDtol': 'title-reference', + 't\u00EDtol': 'title-reference', + 't': 'title-reference', + 'refer\u00E8ncia-a-pep': 'pep-reference', + 'refer\u00E8ncia-pep': 'pep-reference', + 'pep': 'pep-reference', + 'refer\u00E8ncia-a-rfc': 'rfc-reference', + 'refer\u00E8ncia-rfc': 'rfc-reference', + 'rfc': 'rfc-reference', + '\u00E8mfasi': 'emphasis', + 'destacat': 'strong', + 'literal': 'literal', + 'math (translation required)': 'math', + 'refer\u00E8ncia-amb-nom': 'named-reference', + 'refer\u00E8ncia-nom': 'named-reference', + 'refer\u00E8ncia-an\u00F2nima': 'anonymous-reference', + 'refer\u00E8ncia-a-nota-al-peu': 'footnote-reference', + 'refer\u00E8ncia-nota-al-peu': 'footnote-reference', + 'refer\u00E8ncia-a-cita': 'citation-reference', + 'refer\u00E8ncia-cita': 'citation-reference', + 'refer\u00E8ncia-a-substituci\u00F3': 'substitution-reference', + 'refer\u00E8ncia-substituci\u00F3': 'substitution-reference', + 'destinaci\u00F3': 'target', + 'refer\u00E8ncia-a-uri': 'uri-reference', + 'refer\u00E8ncia-uri': 'uri-reference', + 'uri': 'uri-reference', + 'url': 'uri-reference', + 'cru': 'raw',} """Mapping of Catalan role names to canonical role names for interpreted text. """ diff --git a/docutils/docutils/parsers/rst/languages/cs.py b/docutils/docutils/parsers/rst/languages/cs.py index 2bde6ec0e..d3eb6da67 100644 --- a/docutils/docutils/parsers/rst/languages/cs.py +++ b/docutils/docutils/parsers/rst/languages/cs.py @@ -17,92 +17,92 @@ directives = { # language-dependent: fixed - u'pozor': 'attention', - u'caution (translation required)': 'caution', # jak rozlisit caution a warning? - u'code (translation required)': 'code', - u'nebezpe\u010D\u00ED': 'danger', - u'chyba': 'error', - u'rada': 'hint', - u'd\u016Fle\u017Eit\u00E9': 'important', - u'pozn\u00E1mka': 'note', - u'tip (translation required)': 'tip', - u'varov\u00E1n\u00ED': 'warning', - u'admonition (translation required)': 'admonition', - u'sidebar (translation required)': 'sidebar', - u't\u00E9ma': 'topic', - u'line-block (translation required)': 'line-block', - u'parsed-literal (translation required)': 'parsed-literal', - u'odd\u00EDl': 'rubric', - u'moto': 'epigraph', - u'highlights (translation required)': 'highlights', - u'pull-quote (translation required)': 'pull-quote', - u'compound (translation required)': 'compound', - u'container (translation required)': 'container', + 'pozor': 'attention', + 'caution (translation required)': 'caution', # jak rozlisit caution a warning? + 'code (translation required)': 'code', + 'nebezpe\u010D\u00ED': 'danger', + 'chyba': 'error', + 'rada': 'hint', + 'd\u016Fle\u017Eit\u00E9': 'important', + 'pozn\u00E1mka': 'note', + 'tip (translation required)': 'tip', + 'varov\u00E1n\u00ED': 'warning', + 'admonition (translation required)': 'admonition', + 'sidebar (translation required)': 'sidebar', + 't\u00E9ma': 'topic', + 'line-block (translation required)': 'line-block', + 'parsed-literal (translation required)': 'parsed-literal', + 'odd\u00EDl': 'rubric', + 'moto': 'epigraph', + 'highlights (translation required)': 'highlights', + 'pull-quote (translation required)': 'pull-quote', + 'compound (translation required)': 'compound', + 'container (translation required)': 'container', #'questions': 'questions', #'qa': 'questions', #'faq': 'questions', - u'table (translation required)': 'table', - u'csv-table (translation required)': 'csv-table', - u'list-table (translation required)': 'list-table', - u'math (translation required)': 'math', - u'meta (translation required)': 'meta', + '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', - u'image (translation required)': 'image', # obrazek - u'figure (translation required)': 'figure', # a tady? - u'include (translation required)': 'include', - u'raw (translation required)': 'raw', - u'replace (translation required)': 'replace', - u'unicode (translation required)': 'unicode', - u'datum': 'date', - u't\u0159\u00EDda': 'class', - u'role (translation required)': 'role', - u'default-role (translation required)': 'default-role', - u'title (translation required)': 'title', - u'obsah': 'contents', - u'sectnum (translation required)': 'sectnum', - u'section-numbering (translation required)': 'sectnum', - u'header (translation required)': 'header', - u'footer (translation required)': 'footer', + 'image (translation required)': 'image', # obrazek + 'figure (translation required)': 'figure', # a tady? + 'include (translation required)': 'include', + 'raw (translation required)': 'raw', + 'replace (translation required)': 'replace', + 'unicode (translation required)': 'unicode', + 'datum': 'date', + 't\u0159\u00EDda': 'class', + 'role (translation required)': 'role', + 'default-role (translation required)': 'default-role', + 'title (translation required)': 'title', + 'obsah': 'contents', + 'sectnum (translation required)': 'sectnum', + 'section-numbering (translation required)': 'sectnum', + 'header (translation required)': 'header', + 'footer (translation required)': 'footer', #'footnotes': 'footnotes', #'citations': 'citations', - u'target-notes (translation required)': 'target-notes', - u'restructuredtext-test-directive': 'restructuredtext-test-directive'} + 'target-notes (translation required)': 'target-notes', + 'restructuredtext-test-directive': 'restructuredtext-test-directive'} """Czech name to registered (in directives/__init__.py) directive name mapping.""" roles = { # language-dependent: fixed - u'abbreviation (translation required)': 'abbreviation', - u'ab (translation required)': 'abbreviation', - u'acronym (translation required)': 'acronym', - u'ac (translation required)': 'acronym', - u'code (translation required)': 'code', - u'index (translation required)': 'index', - u'i (translation required)': 'index', - u'subscript (translation required)': 'subscript', - u'sub (translation required)': 'subscript', - u'superscript (translation required)': 'superscript', - u'sup (translation required)': 'superscript', - u'title-reference (translation required)': 'title-reference', - u'title (translation required)': 'title-reference', - u't (translation required)': 'title-reference', - u'pep-reference (translation required)': 'pep-reference', - u'pep (translation required)': 'pep-reference', - u'rfc-reference (translation required)': 'rfc-reference', - u'rfc (translation required)': 'rfc-reference', - u'emphasis (translation required)': 'emphasis', - u'strong (translation required)': 'strong', - u'literal (translation required)': 'literal', - u'math (translation required)': 'math', - u'named-reference (translation required)': 'named-reference', - u'anonymous-reference (translation required)': 'anonymous-reference', - u'footnote-reference (translation required)': 'footnote-reference', - u'citation-reference (translation required)': 'citation-reference', - u'substitution-reference (translation required)': 'substitution-reference', - u'target (translation required)': 'target', - u'uri-reference (translation required)': 'uri-reference', - u'uri (translation required)': 'uri-reference', - u'url (translation required)': 'uri-reference', - u'raw (translation required)': 'raw',} + 'abbreviation (translation required)': 'abbreviation', + 'ab (translation required)': 'abbreviation', + 'acronym (translation required)': 'acronym', + 'ac (translation required)': 'acronym', + 'code (translation required)': 'code', + 'index (translation required)': 'index', + 'i (translation required)': 'index', + 'subscript (translation required)': 'subscript', + 'sub (translation required)': 'subscript', + 'superscript (translation required)': 'superscript', + 'sup (translation required)': 'superscript', + 'title-reference (translation required)': 'title-reference', + 'title (translation required)': 'title-reference', + 't (translation required)': 'title-reference', + 'pep-reference (translation required)': 'pep-reference', + 'pep (translation required)': 'pep-reference', + 'rfc-reference (translation required)': 'rfc-reference', + 'rfc (translation required)': 'rfc-reference', + 'emphasis (translation required)': 'emphasis', + 'strong (translation required)': 'strong', + 'literal (translation required)': 'literal', + 'math (translation required)': 'math', + 'named-reference (translation required)': 'named-reference', + 'anonymous-reference (translation required)': 'anonymous-reference', + 'footnote-reference (translation required)': 'footnote-reference', + 'citation-reference (translation required)': 'citation-reference', + 'substitution-reference (translation required)': 'substitution-reference', + 'target (translation required)': 'target', + 'uri-reference (translation required)': 'uri-reference', + 'uri (translation required)': 'uri-reference', + 'url (translation required)': 'uri-reference', + 'raw (translation required)': 'raw',} """Mapping of Czech role names to canonical role names for interpreted text. """ diff --git a/docutils/docutils/parsers/rst/languages/da.py b/docutils/docutils/parsers/rst/languages/da.py index 064f2ccb5..3d19357dd 100644 --- a/docutils/docutils/parsers/rst/languages/da.py +++ b/docutils/docutils/parsers/rst/languages/da.py @@ -17,96 +17,96 @@ directives = { # language-dependent: fixed - u'giv agt': 'attention', - u'pas på': 'caution', - u'kode': 'code', - u'kode-blok': 'code', - u'kildekode': 'code', - u'fare': 'danger', - u'fejl': 'error', - u'vink': 'hint', - u'vigtigt': 'important', - u'bemærk': 'note', - u'tips': 'tip', - u'advarsel': 'warning', - u'formaning': 'admonition', - u'sidebjælke': 'sidebar', - u'emne': 'topic', - u'linje-blok': 'line-block', - u'linie-blok': 'line-block', - u'parset-literal': 'parsed-literal', - u'rubrik': 'rubric', - u'epigraf': 'epigraph', - u'fremhævninger': 'highlights', - u'pull-quote (translation required)': 'pull-quote', - u'compound (translation required)': 'compound', - u'container (translation required)': 'container', + 'giv agt': 'attention', + 'pas på': 'caution', + 'kode': 'code', + 'kode-blok': 'code', + 'kildekode': 'code', + 'fare': 'danger', + 'fejl': 'error', + 'vink': 'hint', + 'vigtigt': 'important', + 'bemærk': 'note', + 'tips': 'tip', + 'advarsel': 'warning', + 'formaning': 'admonition', + 'sidebjælke': 'sidebar', + 'emne': 'topic', + 'linje-blok': 'line-block', + 'linie-blok': 'line-block', + 'parset-literal': 'parsed-literal', + 'rubrik': 'rubric', + 'epigraf': 'epigraph', + 'fremhævninger': 'highlights', + 'pull-quote (translation required)': 'pull-quote', + 'compound (translation required)': 'compound', + 'container (translation required)': 'container', #'questions': 'questions', - u'tabel': 'table', - u'csv-tabel': 'csv-table', - u'liste-tabel': 'list-table', + 'tabel': 'table', + 'csv-tabel': 'csv-table', + 'liste-tabel': 'list-table', #'qa': 'questions', #'faq': 'questions', - u'meta': 'meta', - u'math (translation required)': 'math', + 'meta': 'meta', + 'math (translation required)': 'math', #'imagemap': 'imagemap', - u'billede': 'image', - u'figur': 'figure', - u'inkludér': 'include', - u'inkluder': 'include', - u'rå': 'raw', - u'erstat': 'replace', - u'unicode': 'unicode', - u'dato': 'date', - u'klasse': 'class', - u'rolle': 'role', - u'forvalgt-rolle': 'default-role', - u'titel': 'title', - u'indhold': 'contents', - u'sektnum': 'sectnum', - u'sektions-nummerering': 'sectnum', - u'sidehovede': 'header', - u'sidefod': 'footer', + 'billede': 'image', + 'figur': 'figure', + 'inkludér': 'include', + 'inkluder': 'include', + 'rå': 'raw', + 'erstat': 'replace', + 'unicode': 'unicode', + 'dato': 'date', + 'klasse': 'class', + 'rolle': 'role', + 'forvalgt-rolle': 'default-role', + 'titel': 'title', + 'indhold': 'contents', + 'sektnum': 'sectnum', + 'sektions-nummerering': 'sectnum', + 'sidehovede': 'header', + 'sidefod': 'footer', #'footnotes': 'footnotes', #'citations': 'citations', - u'target-notes (translation required)': 'target-notes', - u'restructuredtext-test-direktiv': 'restructuredtext-test-directive'} + 'target-notes (translation required)': 'target-notes', + 'restructuredtext-test-direktiv': 'restructuredtext-test-directive'} """Danish name to registered (in directives/__init__.py) directive name mapping.""" roles = { # language-dependent: fixed - u'forkortelse': 'abbreviation', - u'fork': 'abbreviation', - u'akronym': 'acronym', - u'ac (translation required)': 'acronym', - u'kode': 'code', - u'indeks': 'index', - u'i': 'index', - u'subscript (translation required)': 'subscript', - u'sub (translation required)': 'subscript', - u'superscript (translation required)': 'superscript', - u'sup (translation required)': 'superscript', - u'titel-reference': 'title-reference', - u'titel': 'title-reference', - u't': 'title-reference', - u'pep-reference': 'pep-reference', - u'pep': 'pep-reference', - u'rfc-reference': 'rfc-reference', - u'rfc': 'rfc-reference', - u'emfase': 'emphasis', - u'kraftig': 'strong', - u'literal': 'literal', - u'math (translation required)': 'math', - u'navngivet-reference': 'named-reference', - u'anonym-reference': 'anonymous-reference', - u'fodnote-reference': 'footnote-reference', - u'citation-reference (translation required)': 'citation-reference', - u'substitutions-reference': 'substitution-reference', - u'target (translation required)': 'target', - u'uri-reference': 'uri-reference', - u'uri': 'uri-reference', - u'url': 'uri-reference', - u'rå': 'raw',} + 'forkortelse': 'abbreviation', + 'fork': 'abbreviation', + 'akronym': 'acronym', + 'ac (translation required)': 'acronym', + 'kode': 'code', + 'indeks': 'index', + 'i': 'index', + 'subscript (translation required)': 'subscript', + 'sub (translation required)': 'subscript', + 'superscript (translation required)': 'superscript', + 'sup (translation required)': 'superscript', + 'titel-reference': 'title-reference', + 'titel': 'title-reference', + 't': 'title-reference', + 'pep-reference': 'pep-reference', + 'pep': 'pep-reference', + 'rfc-reference': 'rfc-reference', + 'rfc': 'rfc-reference', + 'emfase': 'emphasis', + 'kraftig': 'strong', + 'literal': 'literal', + 'math (translation required)': 'math', + 'navngivet-reference': 'named-reference', + 'anonym-reference': 'anonymous-reference', + 'fodnote-reference': 'footnote-reference', + 'citation-reference (translation required)': 'citation-reference', + 'substitutions-reference': 'substitution-reference', + 'target (translation required)': 'target', + 'uri-reference': 'uri-reference', + 'uri': 'uri-reference', + 'url': 'uri-reference', + 'rå': 'raw',} """Mapping of Danish role names to canonical role names for interpreted text. """ diff --git a/docutils/docutils/parsers/rst/languages/de.py b/docutils/docutils/parsers/rst/languages/de.py index 518f1f76e..e3555ab03 100644 --- a/docutils/docutils/parsers/rst/languages/de.py +++ b/docutils/docutils/parsers/rst/languages/de.py @@ -37,24 +37,24 @@ 'rubrik': 'rubric', 'epigraph': 'epigraph', 'highlights': 'highlights', - u'pull-quote': 'pull-quote', # commonly used in German too - u'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', - u'container': 'container', + 'container': 'container', #'fragen': 'questions', 'tabelle': 'table', 'csv-tabelle': 'csv-table', 'listentabelle': 'list-table', - u'mathe': 'math', - u'formel': 'math', + 'mathe': 'math', + 'formel': 'math', 'meta': 'meta', #'imagemap': 'imagemap', 'bild': 'image', 'abbildung': 'figure', - u'unverändert': 'raw', - u'roh': 'raw', - u'einfügen': 'include', + 'unverändert': 'raw', + 'roh': 'raw', + 'einfügen': 'include', 'ersetzung': 'replace', 'ersetzen': 'replace', 'ersetze': 'replace', @@ -62,24 +62,24 @@ 'datum': 'date', 'klasse': 'class', 'rolle': 'role', - u'standardrolle': 'default-role', - u'titel': 'title', + 'standardrolle': 'default-role', + 'titel': 'title', 'inhalt': 'contents', - u'kapitelnummerierung': 'sectnum', - u'abschnittsnummerierung': 'sectnum', - u'linkziel-fußnoten': 'target-notes', - u'kopfzeilen': 'header', - u'fußzeilen': 'footer', - #u'fußfnoten': 'footnotes', + 'kapitelnummerierung': 'sectnum', + 'abschnittsnummerierung': 'sectnum', + 'linkziel-fußnoten': 'target-notes', + 'kopfzeilen': 'header', + 'fußzeilen': 'footer', + #'fußfnoten': 'footnotes', #'zitate': 'citations', } """German name to registered (in directives/__init__.py) directive name mapping.""" roles = { - u'abkürzung': 'abbreviation', + 'abkürzung': 'abbreviation', 'akronym': 'acronym', - u'code': 'code', + 'code': 'code', 'index': 'index', 'tiefgestellt': 'subscript', 'hochgestellt': 'superscript', @@ -89,16 +89,16 @@ 'betonung': 'emphasis', # for backwards compatibility 'betont': 'emphasis', 'fett': 'strong', - u'wörtlich': 'literal', - u'mathe': 'math', + 'wörtlich': 'literal', + 'mathe': 'math', 'benannte-referenz': 'named-reference', 'unbenannte-referenz': 'anonymous-reference', - u'fußfnoten-referenz': 'footnote-reference', + 'fußfnoten-referenz': 'footnote-reference', 'zitat-referenz': 'citation-reference', 'ersetzungs-referenz': 'substitution-reference', 'ziel': 'target', 'uri-referenz': 'uri-reference', - u'unverändert': 'raw', - u'roh': 'raw',} + 'unverändert': 'raw', + 'roh': 'raw',} """Mapping of German role names to canonical role names for interpreted text. """ diff --git a/docutils/docutils/parsers/rst/languages/eo.py b/docutils/docutils/parsers/rst/languages/eo.py index a88c9e41c..951c48580 100644 --- a/docutils/docutils/parsers/rst/languages/eo.py +++ b/docutils/docutils/parsers/rst/languages/eo.py @@ -17,102 +17,102 @@ directives = { # language-dependent: fixed - u'atentu': 'attention', - u'zorgu': 'caution', - u'code (translation required)': 'code', - u'dangxero': 'danger', - u'dan\u011dero': 'danger', - u'eraro': 'error', - u'spuro': 'hint', - u'grava': 'important', - u'noto': 'note', - u'helpeto': 'tip', - u'averto': 'warning', - u'admono': 'admonition', - u'flankteksto': 'sidebar', - u'temo': 'topic', - u'linea-bloko': 'line-block', - u'analizota-literalo': 'parsed-literal', - u'rubriko': 'rubric', - u'epigrafo': 'epigraph', - u'elstarajxoj': 'highlights', - u'elstara\u0135oj': 'highlights', - u'ekstera-citajxo': 'pull-quote', - u'ekstera-cita\u0135o': 'pull-quote', - u'kombinajxo': 'compound', - u'kombina\u0135o': 'compound', - u'tekstingo': 'container', - u'enhavilo': 'container', + 'atentu': 'attention', + 'zorgu': 'caution', + 'code (translation required)': 'code', + 'dangxero': 'danger', + 'dan\u011dero': 'danger', + 'eraro': 'error', + 'spuro': 'hint', + 'grava': 'important', + 'noto': 'note', + 'helpeto': 'tip', + 'averto': 'warning', + 'admono': 'admonition', + 'flankteksto': 'sidebar', + 'temo': 'topic', + 'linea-bloko': 'line-block', + 'analizota-literalo': 'parsed-literal', + 'rubriko': 'rubric', + 'epigrafo': 'epigraph', + 'elstarajxoj': 'highlights', + 'elstara\u0135oj': 'highlights', + 'ekstera-citajxo': 'pull-quote', + 'ekstera-cita\u0135o': 'pull-quote', + 'kombinajxo': 'compound', + 'kombina\u0135o': 'compound', + 'tekstingo': 'container', + 'enhavilo': 'container', #'questions': 'questions', #'qa': 'questions', #'faq': 'questions', - u'tabelo': 'table', - u'tabelo-vdk': 'csv-table', # "valoroj disigitaj per komoj" - u'tabelo-csv': 'csv-table', - u'tabelo-lista': 'list-table', - u'meta': 'meta', + 'tabelo': 'table', + 'tabelo-vdk': 'csv-table', # "valoroj disigitaj per komoj" + 'tabelo-csv': 'csv-table', + 'tabelo-lista': 'list-table', + 'meta': 'meta', 'math (translation required)': 'math', #'imagemap': 'imagemap', - u'bildo': 'image', - u'figuro': 'figure', - u'inkludi': 'include', - u'senanaliza': 'raw', - u'anstatauxi': 'replace', - u'anstata\u016di': 'replace', - u'unicode': 'unicode', - u'dato': 'date', - u'klaso': 'class', - u'rolo': 'role', - u'preterlasita-rolo': 'default-role', - u'titolo': 'title', - u'enhavo': 'contents', - u'seknum': 'sectnum', - u'sekcia-numerado': 'sectnum', - u'kapsekcio': 'header', - u'piedsekcio': 'footer', + 'bildo': 'image', + 'figuro': 'figure', + 'inkludi': 'include', + 'senanaliza': 'raw', + 'anstatauxi': 'replace', + 'anstata\u016di': 'replace', + 'unicode': 'unicode', + 'dato': 'date', + 'klaso': 'class', + 'rolo': 'role', + 'preterlasita-rolo': 'default-role', + 'titolo': 'title', + 'enhavo': 'contents', + 'seknum': 'sectnum', + 'sekcia-numerado': 'sectnum', + 'kapsekcio': 'header', + 'piedsekcio': 'footer', #'footnotes': 'footnotes', #'citations': 'citations', - u'celaj-notoj': 'target-notes', - u'restructuredtext-test-directive': 'restructuredtext-test-directive'} + 'celaj-notoj': 'target-notes', + 'restructuredtext-test-directive': 'restructuredtext-test-directive'} """Esperanto name to registered (in directives/__init__.py) directive name mapping.""" roles = { # language-dependent: fixed - u'mallongigo': 'abbreviation', - u'mall': 'abbreviation', - u'komenclitero': 'acronym', - u'kl': 'acronym', - u'code (translation required)': 'code', - u'indekso': 'index', - u'i': 'index', - u'subskribo': 'subscript', - u'sub': 'subscript', - u'supraskribo': 'superscript', - u'sup': 'superscript', - u'titola-referenco': 'title-reference', - u'titolo': 'title-reference', - u't': 'title-reference', - u'pep-referenco': 'pep-reference', - u'pep': 'pep-reference', - u'rfc-referenco': 'rfc-reference', - u'rfc': 'rfc-reference', - u'emfazo': 'emphasis', - u'forta': 'strong', - u'litera': 'literal', + 'mallongigo': 'abbreviation', + 'mall': 'abbreviation', + 'komenclitero': 'acronym', + 'kl': 'acronym', + 'code (translation required)': 'code', + 'indekso': 'index', + 'i': 'index', + 'subskribo': 'subscript', + 'sub': 'subscript', + 'supraskribo': 'superscript', + 'sup': 'superscript', + 'titola-referenco': 'title-reference', + 'titolo': 'title-reference', + 't': 'title-reference', + 'pep-referenco': 'pep-reference', + 'pep': 'pep-reference', + 'rfc-referenco': 'rfc-reference', + 'rfc': 'rfc-reference', + 'emfazo': 'emphasis', + 'forta': 'strong', + 'litera': 'literal', 'math (translation required)': 'math', - u'nomita-referenco': 'named-reference', - u'nenomita-referenco': 'anonymous-reference', - u'piednota-referenco': 'footnote-reference', - u'citajxo-referenco': 'citation-reference', - u'cita\u0135o-referenco': 'citation-reference', - u'anstatauxa-referenco': 'substitution-reference', - u'anstata\u016da-referenco': 'substitution-reference', - u'celo': 'target', - u'uri-referenco': 'uri-reference', - u'uri': 'uri-reference', - u'url': 'uri-reference', - u'senanaliza': 'raw', + 'nomita-referenco': 'named-reference', + 'nenomita-referenco': 'anonymous-reference', + 'piednota-referenco': 'footnote-reference', + 'citajxo-referenco': 'citation-reference', + 'cita\u0135o-referenco': 'citation-reference', + 'anstatauxa-referenco': 'substitution-reference', + 'anstata\u016da-referenco': 'substitution-reference', + 'celo': 'target', + 'uri-referenco': 'uri-reference', + 'uri': 'uri-reference', + 'url': 'uri-reference', + 'senanaliza': 'raw', } """Mapping of Esperanto role names to canonical role names for interpreted text. """ diff --git a/docutils/docutils/parsers/rst/languages/es.py b/docutils/docutils/parsers/rst/languages/es.py index ef5bc6914..149f0dda1 100644 --- a/docutils/docutils/parsers/rst/languages/es.py +++ b/docutils/docutils/parsers/rst/languages/es.py @@ -16,109 +16,109 @@ directives = { - u'atenci\u00f3n': 'attention', - u'atencion': 'attention', - u'precauci\u00f3n': 'caution', - u'code (translation required)': 'code', - u'precaucion': 'caution', - u'peligro': 'danger', - u'error': 'error', - u'sugerencia': 'hint', - u'importante': 'important', - u'nota': 'note', - u'consejo': 'tip', - u'advertencia': 'warning', - u'exhortacion': 'admonition', - u'exhortaci\u00f3n': 'admonition', - u'nota-al-margen': 'sidebar', - u'tema': 'topic', - u'bloque-de-lineas': 'line-block', - u'bloque-de-l\u00edneas': 'line-block', - u'literal-evaluado': 'parsed-literal', - u'firma': 'rubric', - u'ep\u00edgrafe': 'epigraph', - u'epigrafe': 'epigraph', - u'destacado': 'highlights', - u'cita-destacada': 'pull-quote', - u'combinacion': 'compound', - u'combinaci\u00f3n': 'compound', - u'contenedor': 'container', + 'atenci\u00f3n': 'attention', + 'atencion': 'attention', + 'precauci\u00f3n': 'caution', + 'code (translation required)': 'code', + 'precaucion': 'caution', + 'peligro': 'danger', + 'error': 'error', + 'sugerencia': 'hint', + 'importante': 'important', + 'nota': 'note', + 'consejo': 'tip', + 'advertencia': 'warning', + 'exhortacion': 'admonition', + 'exhortaci\u00f3n': 'admonition', + 'nota-al-margen': 'sidebar', + 'tema': 'topic', + 'bloque-de-lineas': 'line-block', + 'bloque-de-l\u00edneas': 'line-block', + 'literal-evaluado': 'parsed-literal', + 'firma': 'rubric', + 'ep\u00edgrafe': 'epigraph', + 'epigrafe': 'epigraph', + 'destacado': 'highlights', + 'cita-destacada': 'pull-quote', + 'combinacion': 'compound', + 'combinaci\u00f3n': 'compound', + 'contenedor': 'container', #'questions': 'questions', #'qa': 'questions', #'faq': 'questions', - u'tabla': 'table', - u'tabla-vsc': 'csv-table', - u'tabla-csv': 'csv-table', - u'tabla-lista': 'list-table', - u'meta': 'meta', + 'tabla': 'table', + 'tabla-vsc': 'csv-table', + 'tabla-csv': 'csv-table', + 'tabla-lista': 'list-table', + 'meta': 'meta', 'math (translation required)': 'math', #'imagemap': 'imagemap', - u'imagen': 'image', - u'figura': 'figure', - u'incluir': 'include', - u'sin-analisis': 'raw', - u'sin-an\u00e1lisis': 'raw', - u'reemplazar': 'replace', - u'unicode': 'unicode', - u'fecha': 'date', - u'clase': 'class', - u'rol': 'role', - u'rol-por-omision': 'default-role', - u'rol-por-omisi\u00f3n': 'default-role', - u'titulo': 'title', - u't\u00edtulo': 'title', - u'contenido': 'contents', - u'numseccion': 'sectnum', - u'numsecci\u00f3n': 'sectnum', - u'numeracion-seccion': 'sectnum', - u'numeraci\u00f3n-secci\u00f3n': 'sectnum', - u'notas-destino': 'target-notes', - u'cabecera': 'header', - u'pie': 'footer', + 'imagen': 'image', + 'figura': 'figure', + 'incluir': 'include', + 'sin-analisis': 'raw', + 'sin-an\u00e1lisis': 'raw', + 'reemplazar': 'replace', + 'unicode': 'unicode', + 'fecha': 'date', + 'clase': 'class', + 'rol': 'role', + 'rol-por-omision': 'default-role', + 'rol-por-omisi\u00f3n': 'default-role', + 'titulo': 'title', + 't\u00edtulo': 'title', + 'contenido': 'contents', + 'numseccion': 'sectnum', + 'numsecci\u00f3n': 'sectnum', + 'numeracion-seccion': 'sectnum', + 'numeraci\u00f3n-secci\u00f3n': 'sectnum', + 'notas-destino': 'target-notes', + 'cabecera': 'header', + 'pie': 'footer', #'footnotes': 'footnotes', #'citations': 'citations', - u'restructuredtext-test-directive': 'restructuredtext-test-directive'} + 'restructuredtext-test-directive': 'restructuredtext-test-directive'} """Spanish name to registered (in directives/__init__.py) directive name mapping.""" roles = { - u'abreviatura': 'abbreviation', - u'ab': 'abbreviation', - u'acronimo': 'acronym', - u'acronimo': 'acronym', - u'ac': 'acronym', - u'code (translation required)': 'code', - u'indice': 'index', - u'i': 'index', - u'subindice': 'subscript', - u'sub\u00edndice': 'subscript', - u'superindice': 'superscript', - u'super\u00edndice': 'superscript', - u'referencia-titulo': 'title-reference', - u'titulo': 'title-reference', - u't': 'title-reference', - u'referencia-pep': 'pep-reference', - u'pep': 'pep-reference', - u'referencia-rfc': 'rfc-reference', - u'rfc': 'rfc-reference', - u'enfasis': 'emphasis', - u'\u00e9nfasis': 'emphasis', - u'destacado': 'strong', - u'literal': 'literal', # "literal" is also a word in Spanish :-) - u'math (translation required)': 'math', - u'referencia-con-nombre': 'named-reference', - u'referencia-anonima': 'anonymous-reference', - u'referencia-an\u00f3nima': 'anonymous-reference', - u'referencia-nota-al-pie': 'footnote-reference', - u'referencia-cita': 'citation-reference', - u'referencia-sustitucion': 'substitution-reference', - u'referencia-sustituci\u00f3n': 'substitution-reference', - u'destino': 'target', - u'referencia-uri': 'uri-reference', - u'uri': 'uri-reference', - u'url': 'uri-reference', - u'sin-analisis': 'raw', - u'sin-an\u00e1lisis': 'raw', + 'abreviatura': 'abbreviation', + 'ab': 'abbreviation', + 'acronimo': 'acronym', + 'acronimo': 'acronym', + 'ac': 'acronym', + 'code (translation required)': 'code', + 'indice': 'index', + 'i': 'index', + 'subindice': 'subscript', + 'sub\u00edndice': 'subscript', + 'superindice': 'superscript', + 'super\u00edndice': 'superscript', + 'referencia-titulo': 'title-reference', + 'titulo': 'title-reference', + 't': 'title-reference', + 'referencia-pep': 'pep-reference', + 'pep': 'pep-reference', + 'referencia-rfc': 'rfc-reference', + 'rfc': 'rfc-reference', + 'enfasis': 'emphasis', + '\u00e9nfasis': 'emphasis', + 'destacado': 'strong', + 'literal': 'literal', # "literal" is also a word in Spanish :-) + 'math (translation required)': 'math', + 'referencia-con-nombre': 'named-reference', + 'referencia-anonima': 'anonymous-reference', + 'referencia-an\u00f3nima': 'anonymous-reference', + 'referencia-nota-al-pie': 'footnote-reference', + 'referencia-cita': 'citation-reference', + 'referencia-sustitucion': 'substitution-reference', + 'referencia-sustituci\u00f3n': 'substitution-reference', + 'destino': 'target', + 'referencia-uri': 'uri-reference', + 'uri': 'uri-reference', + 'url': 'uri-reference', + 'sin-analisis': 'raw', + 'sin-an\u00e1lisis': 'raw', } """Mapping of Spanish role names to canonical role names for interpreted text. """ diff --git a/docutils/docutils/parsers/rst/languages/fa.py b/docutils/docutils/parsers/rst/languages/fa.py index 4d449b1b7..65eb604ce 100644 --- a/docutils/docutils/parsers/rst/languages/fa.py +++ b/docutils/docutils/parsers/rst/languages/fa.py @@ -17,85 +17,85 @@ directives = { # language-dependent: fixed - u'توجه': u'attention', - u'احتیاط': u'caution', - u'کد': u'code', - u'بلوک-کد': u'code', - u'کد-منبع': u'code', - u'خطر': u'danger', - u'خطا': u'error', - u'راهنما': u'hint', - u'مهم': u'important', - u'یادداشت': u'note', - u'نکته': u'tip', - u'اخطار': u'warning', - u'تذکر': u'admonition', - u'نوار-کناری': u'sidebar', - u'موضوع': u'topic', - u'بلوک-خط': u'line-block', - u'تلفظ-پردازش-شده': u'parsed-literal', - u'سر-فصل': u'rubric', - u'کتیبه': u'epigraph', - u'نکات-برجسته': u'highlights', - u'نقل-قول': u'pull-quote', - u'ترکیب': u'compound', - u'ظرف': u'container', - #'questions': u'questions', - u'جدول': u'table', - u'جدول-csv': u'csv-table', - u'جدول-لیست': u'list-table', - #'qa': u'questions', - #'faq': u'questions', - u'متا': u'meta', - u'ریاضی': u'math', - #'imagemap': u'imagemap', - u'تصویر': u'image', - u'شکل': u'figure', - u'شامل': u'include', - u'خام': u'raw', - u'جایگزین': u'replace', - u'یونیکد': u'unicode', - u'تاریخ': u'date', - u'کلاس': u'class', - u'قانون': u'role', - u'قانون-پیش‌فرض': u'default-role', - u'عنوان': u'title', - u'محتوا': u'contents', - u'شماره-فصل': u'sectnum', - u'شماره‌گذاری-فصل': u'sectnum', - u'سرآیند': u'header', - u'پاصفحه': u'footer', - #'footnotes': u'footnotes', - #'citations': u'citations', - u'یادداشت-هدف': u'target-notes', + 'توجه': 'attention', + 'احتیاط': 'caution', + 'کد': 'code', + 'بلوک-کد': 'code', + 'کد-منبع': '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', } """Persian name to registered (in directives/__init__.py) directive name mapping.""" roles = { # language-dependent: fixed - u'مخفف': u'abbreviation', - u'سرنام': u'acronym', - u'کد': u'code', - u'شاخص': u'index', - u'زیرنویس': u'subscript', - u'بالانویس': u'superscript', - u'عنوان': u'title-reference', - u'نیرو': u'pep-reference', - u'rfc-reference (translation required)': u'rfc-reference', - u'تاکید': u'emphasis', - u'قوی': u'strong', - u'لفظی': u'literal', - u'ریاضی': u'math', - u'منبع-نام‌گذاری': u'named-reference', - u'منبع-ناشناس': u'anonymous-reference', - u'منبع-پانویس': u'footnote-reference', - u'منبع-نقل‌فول': u'citation-reference', - u'منبع-جایگزینی': u'substitution-reference', - u'هدف': u'target', - u'منبع-uri': u'uri-reference', - u'uri': u'uri-reference', - u'url': u'uri-reference', - u'خام': u'raw',} + 'مخفف': 'abbreviation', + 'سرنام': 'acronym', + 'کد': 'code', + 'شاخص': 'index', + 'زیرنویس': 'subscript', + 'بالانویس': 'superscript', + 'عنوان': 'title-reference', + 'نیرو': 'pep-reference', + 'rfc-reference (translation required)': 'rfc-reference', + 'تاکید': 'emphasis', + 'قوی': 'strong', + 'لفظی': 'literal', + 'ریاضی': 'math', + 'منبع-نام‌گذاری': 'named-reference', + 'منبع-ناشناس': 'anonymous-reference', + 'منبع-پانویس': 'footnote-reference', + 'منبع-نقل‌فول': 'citation-reference', + 'منبع-جایگزینی': 'substitution-reference', + 'هدف': 'target', + 'منبع-uri': 'uri-reference', + 'uri': 'uri-reference', + 'url': 'uri-reference', + 'خام': 'raw',} """Mapping of Persian role names to canonical role names for interpreted text. """ diff --git a/docutils/docutils/parsers/rst/languages/fi.py b/docutils/docutils/parsers/rst/languages/fi.py index c38d5cb86..b50d43c6c 100644 --- a/docutils/docutils/parsers/rst/languages/fi.py +++ b/docutils/docutils/parsers/rst/languages/fi.py @@ -17,81 +17,81 @@ directives = { # language-dependent: fixed - u'huomio': u'attention', - u'varo': u'caution', - u'code (translation required)': 'code', - u'vaara': u'danger', - u'virhe': u'error', - u'vihje': u'hint', - u't\u00e4rke\u00e4\u00e4': u'important', - u'huomautus': u'note', - u'neuvo': u'tip', - u'varoitus': u'warning', - u'kehotus': u'admonition', - u'sivupalkki': u'sidebar', - u'aihe': u'topic', - u'rivi': u'line-block', - u'tasalevyinen': u'parsed-literal', - u'ohje': u'rubric', - u'epigraafi': u'epigraph', - u'kohokohdat': u'highlights', - u'lainaus': u'pull-quote', - u'taulukko': u'table', - u'csv-taulukko': u'csv-table', - u'list-table (translation required)': 'list-table', - u'compound (translation required)': 'compound', - u'container (translation required)': 'container', - #u'kysymykset': u'questions', - u'meta': u'meta', + 'huomio': 'attention', + 'varo': 'caution', + 'code (translation required)': 'code', + 'vaara': 'danger', + 'virhe': 'error', + 'vihje': 'hint', + 't\u00e4rke\u00e4\u00e4': 'important', + 'huomautus': 'note', + 'neuvo': 'tip', + 'varoitus': 'warning', + 'kehotus': 'admonition', + 'sivupalkki': 'sidebar', + 'aihe': 'topic', + 'rivi': 'line-block', + 'tasalevyinen': 'parsed-literal', + 'ohje': 'rubric', + 'epigraafi': 'epigraph', + 'kohokohdat': 'highlights', + 'lainaus': 'pull-quote', + 'taulukko': 'table', + 'csv-taulukko': 'csv-table', + 'list-table (translation required)': 'list-table', + 'compound (translation required)': 'compound', + 'container (translation required)': 'container', + #'kysymykset': 'questions', + 'meta': 'meta', 'math (translation required)': 'math', - #u'kuvakartta': u'imagemap', - u'kuva': u'image', - u'kaavio': u'figure', - u'sis\u00e4llyt\u00e4': u'include', - u'raaka': u'raw', - u'korvaa': u'replace', - u'unicode': u'unicode', - u'p\u00e4iv\u00e4ys': u'date', - u'luokka': u'class', - u'rooli': u'role', - u'default-role (translation required)': 'default-role', - u'title (translation required)': 'title', - u'sis\u00e4llys': u'contents', - u'kappale': u'sectnum', - u'header (translation required)': 'header', - u'footer (translation required)': 'footer', - #u'alaviitteet': u'footnotes', - #u'viitaukset': u'citations', - u'target-notes (translation required)': u'target-notes'} + #'kuvakartta': 'imagemap', + 'kuva': 'image', + 'kaavio': 'figure', + 'sis\u00e4llyt\u00e4': 'include', + 'raaka': 'raw', + 'korvaa': 'replace', + 'unicode': 'unicode', + 'p\u00e4iv\u00e4ys': 'date', + 'luokka': 'class', + 'rooli': 'role', + 'default-role (translation required)': 'default-role', + 'title (translation required)': 'title', + 'sis\u00e4llys': 'contents', + 'kappale': 'sectnum', + 'header (translation required)': 'header', + 'footer (translation required)': 'footer', + #'alaviitteet': 'footnotes', + #'viitaukset': 'citations', + 'target-notes (translation required)': 'target-notes'} """Finnish name to registered (in directives/__init__.py) directive name mapping.""" roles = { # language-dependent: fixed - u'lyhennys': u'abbreviation', - u'akronyymi': u'acronym', - u'kirjainsana': u'acronym', - u'code (translation required)': 'code', - u'hakemisto': u'index', - u'luettelo': u'index', - u'alaindeksi': u'subscript', - u'indeksi': u'subscript', - u'yl\u00e4indeksi': u'superscript', - u'title-reference (translation required)': u'title-reference', - u'title (translation required)': u'title-reference', - u'pep-reference (translation required)': u'pep-reference', - u'rfc-reference (translation required)': u'rfc-reference', - u'korostus': u'emphasis', - u'vahvistus': u'strong', - u'tasalevyinen': u'literal', + 'lyhennys': 'abbreviation', + 'akronyymi': 'acronym', + 'kirjainsana': 'acronym', + 'code (translation required)': 'code', + 'hakemisto': 'index', + 'luettelo': 'index', + 'alaindeksi': 'subscript', + 'indeksi': 'subscript', + 'yl\u00e4indeksi': 'superscript', + 'title-reference (translation required)': 'title-reference', + 'title (translation required)': 'title-reference', + 'pep-reference (translation required)': 'pep-reference', + 'rfc-reference (translation required)': 'rfc-reference', + 'korostus': 'emphasis', + 'vahvistus': 'strong', + 'tasalevyinen': 'literal', 'math (translation required)': 'math', - u'named-reference (translation required)': u'named-reference', - u'anonymous-reference (translation required)': u'anonymous-reference', - u'footnote-reference (translation required)': u'footnote-reference', - u'citation-reference (translation required)': u'citation-reference', - u'substitution-reference (translation required)': u'substitution-reference', - u'kohde': u'target', - u'uri-reference (translation required)': u'uri-reference', - u'raw (translation required)': 'raw',} + 'named-reference (translation required)': 'named-reference', + 'anonymous-reference (translation required)': 'anonymous-reference', + 'footnote-reference (translation required)': 'footnote-reference', + 'citation-reference (translation required)': 'citation-reference', + 'substitution-reference (translation required)': 'substitution-reference', + 'kohde': 'target', + 'uri-reference (translation required)': 'uri-reference', + 'raw (translation required)': 'raw',} """Mapping of Finnish role names to canonical role names for interpreted text. """ diff --git a/docutils/docutils/parsers/rst/languages/fr.py b/docutils/docutils/parsers/rst/languages/fr.py index e524f51a5..b476ed01f 100644 --- a/docutils/docutils/parsers/rst/languages/fr.py +++ b/docutils/docutils/parsers/rst/languages/fr.py @@ -16,88 +16,88 @@ directives = { - u'attention': 'attention', - u'pr\u00E9caution': 'caution', - u'code': 'code', - u'danger': 'danger', - u'erreur': 'error', - u'conseil': 'hint', - u'important': 'important', - u'note': 'note', - u'astuce': 'tip', - u'avertissement': 'warning', - u'admonition': 'admonition', - u'encadr\u00E9': 'sidebar', - u'sujet': 'topic', - u'bloc-textuel': 'line-block', - u'bloc-interpr\u00E9t\u00E9': 'parsed-literal', - u'code-interpr\u00E9t\u00E9': 'parsed-literal', - u'intertitre': 'rubric', - u'exergue': 'epigraph', - u'\u00E9pigraphe': 'epigraph', - u'chapeau': 'highlights', - u'accroche': 'pull-quote', - u'compound (translation required)': 'compound', - u'container (translation required)': 'container', - #u'questions': 'questions', - #u'qr': 'questions', - #u'faq': 'questions', - u'tableau': 'table', - u'csv-table (translation required)': 'csv-table', - u'list-table (translation required)': 'list-table', - u'm\u00E9ta': 'meta', + 'attention': 'attention', + 'pr\u00E9caution': 'caution', + 'code': 'code', + 'danger': 'danger', + 'erreur': 'error', + 'conseil': 'hint', + 'important': 'important', + 'note': 'note', + 'astuce': 'tip', + 'avertissement': 'warning', + 'admonition': 'admonition', + 'encadr\u00E9': 'sidebar', + 'sujet': 'topic', + 'bloc-textuel': 'line-block', + 'bloc-interpr\u00E9t\u00E9': 'parsed-literal', + 'code-interpr\u00E9t\u00E9': 'parsed-literal', + 'intertitre': 'rubric', + 'exergue': 'epigraph', + '\u00E9pigraphe': 'epigraph', + 'chapeau': 'highlights', + 'accroche': 'pull-quote', + 'compound (translation required)': 'compound', + 'container (translation required)': 'container', + #'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', - #u'imagemap (translation required)': 'imagemap', - u'image': 'image', - u'figure': 'figure', - u'inclure': 'include', - u'brut': 'raw', - u'remplacer': 'replace', - u'remplace': 'replace', - u'unicode': 'unicode', - u'date': 'date', - u'classe': 'class', - u'role (translation required)': 'role', - u'default-role (translation required)': 'default-role', - u'titre (translation required)': 'title', - u'sommaire': 'contents', - u'table-des-mati\u00E8res': 'contents', - u'sectnum': 'sectnum', - u'section-num\u00E9rot\u00E9e': 'sectnum', - u'liens': 'target-notes', - u'header (translation required)': 'header', - u'footer (translation required)': 'footer', - #u'footnotes (translation required)': 'footnotes', - #u'citations (translation required)': 'citations', + #'imagemap (translation required)': 'imagemap', + 'image': 'image', + 'figure': 'figure', + 'inclure': 'include', + 'brut': 'raw', + 'remplacer': 'replace', + 'remplace': 'replace', + 'unicode': 'unicode', + 'date': 'date', + 'classe': 'class', + 'role (translation required)': 'role', + 'default-role (translation required)': 'default-role', + 'titre (translation required)': 'title', + 'sommaire': 'contents', + 'table-des-mati\u00E8res': 'contents', + 'sectnum': 'sectnum', + 'section-num\u00E9rot\u00E9e': 'sectnum', + 'liens': 'target-notes', + 'header (translation required)': 'header', + 'footer (translation required)': 'footer', + #'footnotes (translation required)': 'footnotes', + #'citations (translation required)': 'citations', } """French name to registered (in directives/__init__.py) directive name mapping.""" roles = { - u'abr\u00E9viation': 'abbreviation', - u'acronyme': 'acronym', - u'sigle': 'acronym', - u'code': 'code', - u'index': 'index', - u'indice': 'subscript', - u'ind': 'subscript', - u'exposant': 'superscript', - u'exp': 'superscript', - u'titre-r\u00E9f\u00E9rence': 'title-reference', - u'titre': 'title-reference', - u'pep-r\u00E9f\u00E9rence': 'pep-reference', - u'rfc-r\u00E9f\u00E9rence': 'rfc-reference', - u'emphase': 'emphasis', - u'fort': 'strong', - u'litt\u00E9ral': 'literal', + 'abr\u00E9viation': 'abbreviation', + 'acronyme': 'acronym', + 'sigle': 'acronym', + 'code': 'code', + 'index': 'index', + 'indice': 'subscript', + 'ind': 'subscript', + 'exposant': 'superscript', + 'exp': 'superscript', + 'titre-r\u00E9f\u00E9rence': 'title-reference', + 'titre': 'title-reference', + 'pep-r\u00E9f\u00E9rence': 'pep-reference', + 'rfc-r\u00E9f\u00E9rence': 'rfc-reference', + 'emphase': 'emphasis', + 'fort': 'strong', + 'litt\u00E9ral': 'literal', 'math (translation required)': 'math', - u'nomm\u00E9e-r\u00E9f\u00E9rence': 'named-reference', - u'anonyme-r\u00E9f\u00E9rence': 'anonymous-reference', - u'note-r\u00E9f\u00E9rence': 'footnote-reference', - u'citation-r\u00E9f\u00E9rence': 'citation-reference', - u'substitution-r\u00E9f\u00E9rence': 'substitution-reference', - u'lien': 'target', - u'uri-r\u00E9f\u00E9rence': 'uri-reference', - u'brut': 'raw',} + 'nomm\u00E9e-r\u00E9f\u00E9rence': 'named-reference', + 'anonyme-r\u00E9f\u00E9rence': 'anonymous-reference', + 'note-r\u00E9f\u00E9rence': 'footnote-reference', + 'citation-r\u00E9f\u00E9rence': 'citation-reference', + 'substitution-r\u00E9f\u00E9rence': 'substitution-reference', + 'lien': 'target', + 'uri-r\u00E9f\u00E9rence': 'uri-reference', + 'brut': 'raw',} """Mapping of French role names to canonical role names for interpreted text. """ diff --git a/docutils/docutils/parsers/rst/languages/gl.py b/docutils/docutils/parsers/rst/languages/gl.py index 23a525695..d2c447dd8 100644 --- a/docutils/docutils/parsers/rst/languages/gl.py +++ b/docutils/docutils/parsers/rst/languages/gl.py @@ -19,92 +19,92 @@ directives = { # language-dependent: fixed - u'atenci\u00f3n': 'attention', - u'advertencia': 'caution', - u'code (translation required)': 'code', - u'perigo': 'danger', - u'erro': 'error', - u'pista': 'hint', - u'importante': 'important', - u'nota': 'note', - u'consello': 'tip', - u'aviso': 'warning', - u'admonici\u00f3n': 'admonition', - u'barra lateral': 'sidebar', - u't\u00f3pico': 'topic', - u'bloque-li\u00f1a': 'line-block', - u'literal-analizado': 'parsed-literal', - u'r\u00fabrica': 'rubric', - u'ep\u00edgrafe': 'epigraph', - u'realzados': 'highlights', - u'coller-citaci\u00f3n': 'pull-quote', - u'compor': 'compound', - u'recipiente': 'container', + 'atenci\u00f3n': 'attention', + 'advertencia': 'caution', + 'code (translation required)': 'code', + 'perigo': 'danger', + 'erro': 'error', + 'pista': 'hint', + 'importante': 'important', + 'nota': 'note', + 'consello': 'tip', + 'aviso': 'warning', + 'admonici\u00f3n': 'admonition', + 'barra lateral': 'sidebar', + 't\u00f3pico': 'topic', + 'bloque-li\u00f1a': 'line-block', + 'literal-analizado': 'parsed-literal', + 'r\u00fabrica': 'rubric', + 'ep\u00edgrafe': 'epigraph', + 'realzados': 'highlights', + 'coller-citaci\u00f3n': 'pull-quote', + 'compor': 'compound', + 'recipiente': 'container', #'questions': 'questions', - u't\u00e1boa': 'table', - u't\u00e1boa-csv': 'csv-table', - u't\u00e1boa-listaxe': 'list-table', + 't\u00e1boa': 'table', + 't\u00e1boa-csv': 'csv-table', + 't\u00e1boa-listaxe': 'list-table', #'qa': 'questions', #'faq': 'questions', - u'meta': 'meta', + 'meta': 'meta', 'math (translation required)': 'math', #'imagemap': 'imagemap', - u'imaxe': 'image', - u'figura': 'figure', - u'inclu\u00edr': 'include', - u'cru': 'raw', - u'substitu\u00edr': 'replace', - u'unicode': 'unicode', - u'data': 'date', - u'clase': 'class', - u'regra': 'role', - u'regra-predeterminada': 'default-role', - u't\u00edtulo': 'title', - u'contido': 'contents', - u'seccnum': 'sectnum', - u'secci\u00f3n-numerar': 'sectnum', - u'cabeceira': 'header', - u'p\u00e9 de p\u00e1xina': 'footer', + 'imaxe': 'image', + 'figura': 'figure', + 'inclu\u00edr': 'include', + 'cru': 'raw', + 'substitu\u00edr': 'replace', + 'unicode': 'unicode', + 'data': 'date', + 'clase': 'class', + 'regra': 'role', + 'regra-predeterminada': 'default-role', + 't\u00edtulo': 'title', + 'contido': 'contents', + 'seccnum': 'sectnum', + 'secci\u00f3n-numerar': 'sectnum', + 'cabeceira': 'header', + 'p\u00e9 de p\u00e1xina': 'footer', #'footnotes': 'footnotes', #'citations': 'citations', - u'notas-destino': 'target-notes', - u'texto restruturado-proba-directiva': 'restructuredtext-test-directive'} + 'notas-destino': 'target-notes', + 'texto restruturado-proba-directiva': 'restructuredtext-test-directive'} """Galician name to registered (in directives/__init__.py) directive name mapping.""" roles = { # language-dependent: fixed - u'abreviatura': 'abbreviation', - u'ab': 'abbreviation', - u'acr\u00f3nimo': 'acronym', - u'ac': 'acronym', - u'code (translation required)': 'code', - u'\u00edndice': 'index', - u'i': 'index', - u'sub\u00edndice': 'subscript', - u'sub': 'subscript', - u'super\u00edndice': 'superscript', - u'sup': 'superscript', - u'referencia t\u00edtulo': 'title-reference', - u't\u00edtulo': 'title-reference', - u't': 'title-reference', - u'referencia-pep': 'pep-reference', - u'pep': 'pep-reference', - u'referencia-rfc': 'rfc-reference', - u'rfc': 'rfc-reference', - u'\u00e9nfase': 'emphasis', - u'forte': 'strong', - u'literal': 'literal', + 'abreviatura': 'abbreviation', + 'ab': 'abbreviation', + 'acr\u00f3nimo': 'acronym', + 'ac': 'acronym', + 'code (translation required)': 'code', + '\u00edndice': 'index', + 'i': 'index', + 'sub\u00edndice': 'subscript', + 'sub': 'subscript', + 'super\u00edndice': 'superscript', + 'sup': 'superscript', + 'referencia t\u00edtulo': 'title-reference', + 't\u00edtulo': 'title-reference', + 't': 'title-reference', + 'referencia-pep': 'pep-reference', + 'pep': 'pep-reference', + 'referencia-rfc': 'rfc-reference', + 'rfc': 'rfc-reference', + '\u00e9nfase': 'emphasis', + 'forte': 'strong', + 'literal': 'literal', 'math (translation required)': 'math', - u'referencia-nome': 'named-reference', - u'referencia-an\u00f3nimo': 'anonymous-reference', - u'referencia-nota ao p\u00e9': 'footnote-reference', - u'referencia-citaci\u00f3n': 'citation-reference', - u'referencia-substituci\u00f3n': 'substitution-reference', - u'destino': 'target', - u'referencia-uri': 'uri-reference', - u'uri': 'uri-reference', - u'url': 'uri-reference', - u'cru': 'raw',} + 'referencia-nome': 'named-reference', + 'referencia-an\u00f3nimo': 'anonymous-reference', + 'referencia-nota ao p\u00e9': 'footnote-reference', + 'referencia-citaci\u00f3n': 'citation-reference', + 'referencia-substituci\u00f3n': 'substitution-reference', + 'destino': 'target', + 'referencia-uri': 'uri-reference', + 'uri': 'uri-reference', + 'url': 'uri-reference', + 'cru': 'raw',} """Mapping of Galician role names to canonical role names for interpreted text. """ diff --git a/docutils/docutils/parsers/rst/languages/he.py b/docutils/docutils/parsers/rst/languages/he.py index 89b190cec..aca759033 100644 --- a/docutils/docutils/parsers/rst/languages/he.py +++ b/docutils/docutils/parsers/rst/languages/he.py @@ -17,16 +17,16 @@ directives = { # language-dependent: fixed - u'\u05ea\u05e9\u05d5\u05de\u05ea \u05dc\u05d1': 'attention', - u'\u05d6\u05d4\u05d9\u05e8\u05d5\u05ea': 'caution', - u'code (translation required)': 'code', - u'\u05e1\u05db\u05e0\u05d4': 'danger', - u'\u05e9\u05d2\u05d9\u05d0\u05d4' : 'error', - u'\u05e8\u05de\u05d6': 'hint', - u'\u05d7\u05e9\u05d5\u05d1': 'important', - u'\u05d4\u05e2\u05e8\u05d4': 'note', - u'\u05d8\u05d9\u05e4': 'tip', - u'\u05d0\u05d6\u05d4\u05e8\u05d4': 'warning', + '\u05ea\u05e9\u05d5\u05de\u05ea \u05dc\u05d1': 'attention', + '\u05d6\u05d4\u05d9\u05e8\u05d5\u05ea': 'caution', + 'code (translation required)': 'code', + '\u05e1\u05db\u05e0\u05d4': 'danger', + '\u05e9\u05d2\u05d9\u05d0\u05d4' : 'error', + '\u05e8\u05de\u05d6': 'hint', + '\u05d7\u05e9\u05d5\u05d1': 'important', + '\u05d4\u05e2\u05e8\u05d4': 'note', + '\u05d8\u05d9\u05e4': 'tip', + '\u05d0\u05d6\u05d4\u05e8\u05d4': 'warning', 'admonition': 'admonition', 'sidebar': 'sidebar', 'topic': 'topic', @@ -47,18 +47,18 @@ 'meta': 'meta', 'math (translation required)': 'math', #'imagemap': 'imagemap', - u'\u05ea\u05de\u05d5\u05e0\u05d4': 'image', + '\u05ea\u05de\u05d5\u05e0\u05d4': 'image', 'figure': 'figure', 'include': 'include', 'raw': 'raw', 'replace': 'replace', 'unicode': 'unicode', 'date': 'date', - u'\u05e1\u05d2\u05e0\u05d5\u05df': 'class', + '\u05e1\u05d2\u05e0\u05d5\u05df': 'class', 'role': 'role', 'default-role': 'default-role', 'title': 'title', - u'\u05ea\u05d5\u05db\u05df': 'contents', + '\u05ea\u05d5\u05db\u05df': 'contents', 'sectnum': 'sectnum', 'section-numbering': 'sectnum', 'header': 'header', @@ -76,12 +76,12 @@ 'ab': 'abbreviation', 'acronym': 'acronym', 'ac': 'acronym', - u'code (translation required)': 'code', + 'code (translation required)': 'code', 'index': 'index', 'i': 'index', - u'\u05ea\u05d7\u05ea\u05d9': 'subscript', + '\u05ea\u05d7\u05ea\u05d9': 'subscript', 'sub': 'subscript', - u'\u05e2\u05d9\u05dc\u05d9': 'superscript', + '\u05e2\u05d9\u05dc\u05d9': 'superscript', 'sup': 'superscript', 'title-reference': 'title-reference', 'title': 'title-reference', diff --git a/docutils/docutils/parsers/rst/languages/it.py b/docutils/docutils/parsers/rst/languages/it.py index 79bf12163..6de9d013a 100644 --- a/docutils/docutils/parsers/rst/languages/it.py +++ b/docutils/docutils/parsers/rst/languages/it.py @@ -37,7 +37,7 @@ 'punti-salienti': 'highlights', 'estratto-evidenziato': 'pull-quote', 'composito': 'compound', - u'container (translation required)': 'container', + 'container (translation required)': 'container', #'questions': 'questions', #'qa': 'questions', #'faq': 'questions', @@ -74,7 +74,7 @@ roles = { 'abbreviazione': 'abbreviation', 'acronimo': 'acronym', - u'code (translation required)': 'code', + 'code (translation required)': 'code', 'indice': 'index', 'deponente': 'subscript', 'esponente': 'superscript', diff --git a/docutils/docutils/parsers/rst/languages/ja.py b/docutils/docutils/parsers/rst/languages/ja.py index bf20a754b..6842633b2 100644 --- a/docutils/docutils/parsers/rst/languages/ja.py +++ b/docutils/docutils/parsers/rst/languages/ja.py @@ -19,100 +19,100 @@ directives = { # language-dependent: fixed - u'注目': 'attention', - u'注意': 'caution', - u'code (translation required)': 'code', - u'危険': 'danger', - u'エラー': 'error', - u'ヒント': 'hint', - u'重要': 'important', - u'備考': 'note', - u'通報': 'tip', - u'警告': 'warning', - u'戒告': 'admonition', - u'サイドバー': 'sidebar', - u'トピック': 'topic', - u'ラインブロック': 'line-block', - u'パーズドリテラル': 'parsed-literal', - u'ルブリック': 'rubric', - u'エピグラフ': 'epigraph', - u'題言': 'epigraph', - u'ハイライト': 'highlights', - u'見所': 'highlights', - u'プルクオート': 'pull-quote', - u'合成': 'compound', - u'コンテナー': 'container', - u'容器': 'container', - u'表': 'table', - u'csv表': 'csv-table', - u'リスト表': 'list-table', - #u'質問': 'questions', - #u'問答': 'questions', - #u'faq': 'questions', - u'math (translation required)': 'math', - u'メタ': 'meta', - #u'イメージマプ': 'imagemap', - u'イメージ': 'image', - u'画像': 'image', - u'フィグア': 'figure', - u'図版': 'figure', - u'インクルード': 'include', - u'含む': 'include', - u'組み込み': 'include', - u'生': 'raw', - u'原': 'raw', - u'換える': 'replace', - u'取り換える': 'replace', - u'掛け替える': 'replace', - u'ユニコード': 'unicode', - u'日付': 'date', - u'クラス': 'class', - u'ロール': 'role', - u'役': 'role', - u'ディフォルトロール': 'default-role', - u'既定役': 'default-role', - u'タイトル': 'title', - u'題': 'title', # 題名 件名 - u'目次': 'contents', - u'節数': 'sectnum', - u'ヘッダ': 'header', - u'フッタ': 'footer', - #u'脚注': 'footnotes', # 脚註? - #u'サイテーション': 'citations',   # 出典 引証 引用 - u'ターゲットノート': 'target-notes', # 的注 的脚注 + '注目': 'attention', + '注意': 'caution', + 'code (translation required)': 'code', + '危険': 'danger', + 'エラー': 'error', + 'ヒント': 'hint', + '重要': 'important', + '備考': 'note', + '通報': 'tip', + '警告': 'warning', + '戒告': 'admonition', + 'サイドバー': 'sidebar', + 'トピック': 'topic', + 'ラインブロック': 'line-block', + 'パーズドリテラル': 'parsed-literal', + 'ルブリック': 'rubric', + 'エピグラフ': 'epigraph', + '題言': 'epigraph', + 'ハイライト': 'highlights', + '見所': 'highlights', + 'プルクオート': 'pull-quote', + '合成': 'compound', + 'コンテナー': 'container', + '容器': 'container', + '表': 'table', + 'csv表': 'csv-table', + 'リスト表': 'list-table', + #'質問': 'questions', + #'問答': 'questions', + #'faq': 'questions', + 'math (translation required)': 'math', + 'メタ': 'meta', + #'イメージマプ': 'imagemap', + 'イメージ': 'image', + '画像': 'image', + 'フィグア': 'figure', + '図版': 'figure', + 'インクルード': 'include', + '含む': 'include', + '組み込み': 'include', + '生': 'raw', + '原': 'raw', + '換える': 'replace', + '取り換える': 'replace', + '掛け替える': 'replace', + 'ユニコード': 'unicode', + '日付': 'date', + 'クラス': 'class', + 'ロール': 'role', + '役': 'role', + 'ディフォルトロール': 'default-role', + '既定役': 'default-role', + 'タイトル': 'title', + '題': 'title', # 題名 件名 + '目次': 'contents', + '節数': 'sectnum', + 'ヘッダ': 'header', + 'フッタ': 'footer', + #'脚注': 'footnotes', # 脚註? + #'サイテーション': 'citations',   # 出典 引証 引用 + 'ターゲットノート': 'target-notes', # 的注 的脚注 } """Japanese name to registered (in directives/__init__.py) directive name mapping.""" roles = { # language-dependent: fixed - u'略': 'abbreviation', - u'頭字語': 'acronym', - u'code (translation required)': 'code', - u'インデックス': 'index', - u'索引': 'index', - u'添字': 'subscript', - u'下付': 'subscript', - u'下': 'subscript', - u'上付': 'superscript', - u'上': 'superscript', - u'題参照': 'title-reference', - u'pep参照': 'pep-reference', - u'rfc参照': 'rfc-reference', - u'強調': 'emphasis', - u'強い': 'strong', - u'リテラル': 'literal', - u'整形済み': 'literal', - u'math (translation required)': 'math', - u'名付参照': 'named-reference', - u'無名参照': 'anonymous-reference', - u'脚注参照': 'footnote-reference', - u'出典参照': 'citation-reference', - u'代入参照': 'substitution-reference', - u'的': 'target', - u'uri参照': 'uri-reference', - u'uri': 'uri-reference', - u'url': 'uri-reference', - u'生': 'raw',} + '略': 'abbreviation', + '頭字語': 'acronym', + 'code (translation required)': 'code', + 'インデックス': 'index', + '索引': 'index', + '添字': 'subscript', + '下付': 'subscript', + '下': 'subscript', + '上付': 'superscript', + '上': 'superscript', + '題参照': 'title-reference', + 'pep参照': 'pep-reference', + 'rfc参照': 'rfc-reference', + '強調': 'emphasis', + '強い': 'strong', + 'リテラル': 'literal', + '整形済み': 'literal', + 'math (translation required)': 'math', + '名付参照': 'named-reference', + '無名参照': 'anonymous-reference', + '脚注参照': 'footnote-reference', + '出典参照': 'citation-reference', + '代入参照': 'substitution-reference', + '的': 'target', + 'uri参照': 'uri-reference', + 'uri': 'uri-reference', + 'url': 'uri-reference', + '生': 'raw',} """Mapping of Japanese role names to canonical role names for interpreted text.""" diff --git a/docutils/docutils/parsers/rst/languages/ko.py b/docutils/docutils/parsers/rst/languages/ko.py index 096751d17..757f3ea70 100644 --- a/docutils/docutils/parsers/rst/languages/ko.py +++ b/docutils/docutils/parsers/rst/languages/ko.py @@ -17,94 +17,94 @@ directives = { # language-dependent: fixed - u'집중': 'attention', - u'주의': 'caution', - u'코드': 'code', - u'코드-블록': 'code', - u'소스코드': 'code', - u'위험': 'danger', - u'오류': 'error', - u'실마리': 'hint', - u'중요한': 'important', - u'비고': 'note', - u'팁': 'tip', - u'경고': 'warning', - u'권고': 'admonition', - u'사이드바': 'sidebar', - u'주제': 'topic', - u'라인-블록': 'line-block', - u'파싱된-리터럴': 'parsed-literal', - u'지시문': 'rubric', - u'제명': 'epigraph', - u'하이라이트': 'highlights', - u'발췌문': 'pull-quote', - u'합성어': 'compound', - u'컨테이너': 'container', - #u'질문': 'questions', - u'표': 'table', - u'csv-표': 'csv-table', - u'list-표': 'list-table', - #u'qa': 'questions', - #u'faq': 'questions', - u'메타': 'meta', - u'수학': 'math', - #u'이미지맵': 'imagemap', - u'이미지': 'image', - u'도표': 'figure', - u'포함': 'include', + '집중': 'attention', + '주의': 'caution', + '코드': 'code', + '코드-블록': 'code', + '소스코드': 'code', + '위험': 'danger', + '오류': 'error', + '실마리': 'hint', + '중요한': 'important', + '비고': 'note', + '팁': 'tip', + '경고': 'warning', + '권고': 'admonition', + '사이드바': 'sidebar', + '주제': 'topic', + '라인-블록': 'line-block', + '파싱된-리터럴': 'parsed-literal', + '지시문': 'rubric', + '제명': 'epigraph', + '하이라이트': 'highlights', + '발췌문': 'pull-quote', + '합성어': 'compound', + '컨테이너': 'container', + #'질문': 'questions', + '표': 'table', + 'csv-표': 'csv-table', + 'list-표': 'list-table', + #'qa': 'questions', + #'faq': 'questions', + '메타': 'meta', + '수학': 'math', + #'이미지맵': 'imagemap', + '이미지': 'image', + '도표': 'figure', + '포함': 'include', 'raw': 'raw', - u'대신하다': 'replace', - u'유니코드': 'unicode', - u'날짜': 'date', - u'클래스': 'class', - u'역할': 'role', - u'기본-역할': 'default-role', - u'제목': 'title', - u'내용': 'contents', + '대신하다': 'replace', + '유니코드': 'unicode', + '날짜': 'date', + '클래스': 'class', + '역할': 'role', + '기본-역할': 'default-role', + '제목': 'title', + '내용': 'contents', 'sectnum': 'sectnum', - u'섹션-번호-매기기': 'sectnum', - u'머리말': 'header', - u'꼬리말': 'footer', - #u'긱주': 'footnotes', - #u'인용구': 'citations', - u'목표-노트': 'target-notes', - u'restructuredtext 테스트 지시어': 'restructuredtext-test-directive'} + '섹션-번호-매기기': 'sectnum', + '머리말': 'header', + '꼬리말': 'footer', + #'긱주': 'footnotes', + #'인용구': 'citations', + '목표-노트': 'target-notes', + 'restructuredtext 테스트 지시어': 'restructuredtext-test-directive'} """Korean name to registered (in directives/__init__.py) directive name mapping.""" roles = { # language-dependent: fixed - u'약어': 'abbreviation', - u'ab': 'abbreviation', - u'두음문자': 'acronym', - u'ac': 'acronym', - u'코드': 'code', - u'색인': 'index', - u'i': 'index', - u'다리-글자': 'subscript', - u'sub': 'subscript', - u'어깨-글자': 'superscript', - u'sup': 'superscript', - u'제목-참조': 'title-reference', - u'제목': 'title-reference', - u't': 'title-reference', - u'pep-참조': 'pep-reference', - u'pep': 'pep-reference', - u'rfc-참조': 'rfc-reference', - u'rfc': 'rfc-reference', - u'강조': 'emphasis', - u'굵게': 'strong', - u'기울기': 'literal', - u'수학': 'math', - u'명명된-참조': 'named-reference', - u'익명-참조': 'anonymous-reference', - u'각주-참조': 'footnote-reference', - u'인용-참조': 'citation-reference', - u'대리-참조': 'substitution-reference', - u'대상': 'target', - u'uri-참조': 'uri-reference', - u'uri': 'uri-reference', - u'url': 'uri-reference', + '약어': 'abbreviation', + 'ab': 'abbreviation', + '두음문자': 'acronym', + 'ac': 'acronym', + '코드': 'code', + '색인': 'index', + 'i': 'index', + '다리-글자': 'subscript', + 'sub': 'subscript', + '어깨-글자': 'superscript', + 'sup': 'superscript', + '제목-참조': 'title-reference', + '제목': 'title-reference', + 't': 'title-reference', + 'pep-참조': 'pep-reference', + 'pep': 'pep-reference', + 'rfc-참조': 'rfc-reference', + 'rfc': 'rfc-reference', + '강조': 'emphasis', + '굵게': 'strong', + '기울기': 'literal', + '수학': 'math', + '명명된-참조': 'named-reference', + '익명-참조': 'anonymous-reference', + '각주-참조': 'footnote-reference', + '인용-참조': 'citation-reference', + '대리-참조': 'substitution-reference', + '대상': 'target', + 'uri-참조': 'uri-reference', + 'uri': 'uri-reference', + 'url': 'uri-reference', 'raw': 'raw',} """Mapping of Korean role names to canonical role names for interpreted text. """ diff --git a/docutils/docutils/parsers/rst/languages/lt.py b/docutils/docutils/parsers/rst/languages/lt.py index d5d81804b..fed7c1933 100644 --- a/docutils/docutils/parsers/rst/languages/lt.py +++ b/docutils/docutils/parsers/rst/languages/lt.py @@ -17,56 +17,56 @@ directives = { # language-dependent: fixed - u'dėmesio': 'attention', - u'atsargiai': 'caution', - u'code (translation required)': 'code', - u'pavojinga': 'danger', - u'klaida': 'error', - u'užuomina': 'hint', - u'svarbu': 'important', - u'pastaba': 'note', - u'patarimas': 'tip', - u'įspėjimas': 'warning', - u'perspėjimas': 'admonition', - u'šoninė-juosta': 'sidebar', - u'tema': 'topic', - u'linijinis-blokas': 'line-block', - u'išanalizuotas-literalas': 'parsed-literal', - u'rubrika': 'rubric', - u'epigrafas': 'epigraph', - u'pagridiniai-momentai': 'highlights', - u'atitraukta-citata': 'pull-quote', - u'sudėtinis-darinys': 'compound', - u'konteineris': 'container', + 'dėmesio': 'attention', + 'atsargiai': 'caution', + 'code (translation required)': 'code', + 'pavojinga': 'danger', + 'klaida': 'error', + 'užuomina': 'hint', + 'svarbu': 'important', + 'pastaba': 'note', + 'patarimas': 'tip', + 'įspėjimas': 'warning', + 'perspėjimas': 'admonition', + 'šoninė-juosta': 'sidebar', + 'tema': 'topic', + 'linijinis-blokas': 'line-block', + 'išanalizuotas-literalas': 'parsed-literal', + 'rubrika': 'rubric', + 'epigrafas': 'epigraph', + 'pagridiniai-momentai': 'highlights', + 'atitraukta-citata': 'pull-quote', + 'sudėtinis-darinys': 'compound', + 'konteineris': 'container', #'questions': 'questions', - u'lentelė': 'table', - u'csv-lentelė': 'csv-table', - u'sąrašo-lentelė': 'list-table', + 'lentelė': 'table', + 'csv-lentelė': 'csv-table', + 'sąrašo-lentelė': 'list-table', #'qa': 'questions', #'faq': 'questions', - u'meta': 'meta', - u'matematika': 'math', + 'meta': 'meta', + 'matematika': 'math', #'imagemap': 'imagemap', - u'paveiksliukas': 'image', - u'iliustracija': 'figure', - u'pridėti': 'include', - u'žalia': 'raw', - u'pakeisti': 'replace', - u'unikodas': 'unicode', - u'data': 'date', - u'klasė': 'class', - u'rolė': 'role', - u'numatytoji-rolė': 'default-role', - u'titulas': 'title', - u'turinys': 'contents', - u'seknum': 'sectnum', - u'sekcijos-numeravimas': 'sectnum', - u'antraštė': 'header', - u'poraštė': 'footer', + 'paveiksliukas': 'image', + 'iliustracija': 'figure', + 'pridėti': 'include', + 'žalia': 'raw', + 'pakeisti': 'replace', + 'unikodas': 'unicode', + 'data': 'date', + 'klasė': 'class', + 'rolė': 'role', + 'numatytoji-rolė': 'default-role', + 'titulas': 'title', + 'turinys': 'contents', + 'seknum': 'sectnum', + 'sekcijos-numeravimas': 'sectnum', + 'antraštė': 'header', + 'poraštė': 'footer', #'footnotes': 'footnotes', #'citations': 'citations', - u'nutaikytos-pastaba': 'target-notes', - u'restructuredtext-testinė-direktyva': 'restructuredtext-test-directive'} + 'nutaikytos-pastaba': 'target-notes', + 'restructuredtext-testinė-direktyva': 'restructuredtext-test-directive'} """Lithuanian name to registered (in directives/__init__.py) directive name mapping.""" @@ -76,31 +76,31 @@ 'sa': 'abbreviation', 'akronimas': 'acronym', 'ak': 'acronym', - u'code (translation required)': 'code', + 'code (translation required)': 'code', 'indeksas': 'index', 'i': 'index', - u'apatinis-indeksas': 'subscript', + 'apatinis-indeksas': 'subscript', 'sub': 'subscript', - u'viršutinis-indeksas': 'superscript', + 'viršutinis-indeksas': 'superscript', 'sup': 'superscript', - u'antrašės-nuoroda': 'title-reference', - u'antraštė': 'title-reference', + 'antrašės-nuoroda': 'title-reference', + 'antraštė': 'title-reference', 'a': 'title-reference', 'pep-nuoroda': 'pep-reference', 'pep': 'pep-reference', 'rfc-nuoroda': 'rfc-reference', 'rfc': 'rfc-reference', - u'paryškinimas': 'emphasis', - u'sustiprintas': 'strong', - u'literalas': 'literal', - u'matematika': 'math', - u'vardinė-nuoroda': 'named-reference', - u'anoniminė-nuoroda': 'anonymous-reference', - u'išnašos-nuoroda': 'footnote-reference', - u'citatos-nuoroda': 'citation-reference', - u'pakeitimo-nuoroda': 'substitution-reference', - u'taikinys': 'target', - u'uri-nuoroda': 'uri-reference', + 'paryškinimas': 'emphasis', + 'sustiprintas': 'strong', + 'literalas': 'literal', + 'matematika': 'math', + 'vardinė-nuoroda': 'named-reference', + 'anoniminė-nuoroda': 'anonymous-reference', + 'išnašos-nuoroda': 'footnote-reference', + 'citatos-nuoroda': 'citation-reference', + 'pakeitimo-nuoroda': 'substitution-reference', + 'taikinys': 'target', + 'uri-nuoroda': 'uri-reference', 'uri': 'uri-reference', 'url': 'uri-reference', 'žalia': 'raw',} diff --git a/docutils/docutils/parsers/rst/languages/nl.py b/docutils/docutils/parsers/rst/languages/nl.py index 0052fa30a..731afbf8b 100644 --- a/docutils/docutils/parsers/rst/languages/nl.py +++ b/docutils/docutils/parsers/rst/languages/nl.py @@ -38,7 +38,7 @@ 'pull-quote': 'pull-quote', # Dutch printers use the english term 'samenstelling': 'compound', 'verbinding': 'compound', - u'container (translation required)': 'container', + 'container (translation required)': 'container', #'vragen': 'questions', 'tabel': 'table', 'csv-tabel': 'csv-table', @@ -57,14 +57,14 @@ 'datum': 'date', 'klasse': 'class', 'rol': 'role', - u'default-role (translation required)': 'default-role', + 'default-role (translation required)': 'default-role', 'title (translation required)': 'title', 'inhoud': 'contents', 'sectnum': 'sectnum', 'sectie-nummering': 'sectnum', 'hoofdstuk-nummering': 'sectnum', - u'header (translation required)': 'header', - u'footer (translation required)': 'footer', + 'header (translation required)': 'header', + 'footer (translation required)': 'footer', #'voetnoten': 'footnotes', #'citaten': 'citations', 'verwijzing-voetnoten': 'target-notes', @@ -78,7 +78,7 @@ # 'ab': 'abbreviation', 'acroniem': 'acronym', 'ac': 'acronym', - u'code (translation required)': 'code', + 'code (translation required)': 'code', 'index': 'index', 'i': 'index', 'inferieur': 'subscript', diff --git a/docutils/docutils/parsers/rst/languages/pl.py b/docutils/docutils/parsers/rst/languages/pl.py index ee1fe0336..8994eab0b 100644 --- a/docutils/docutils/parsers/rst/languages/pl.py +++ b/docutils/docutils/parsers/rst/languages/pl.py @@ -17,84 +17,84 @@ directives = { # language-dependent: fixed - u'uwaga': 'attention', - u'ostro\u017cnie': 'caution', - u'code (translation required)': 'code', - u'niebezpiecze\u0144stwo': 'danger', - u'b\u0142\u0105d': 'error', - u'wskaz\u00f3wka': 'hint', - u'wa\u017cne': 'important', - u'przypis': 'note', - u'rada': 'tip', - u'ostrze\u017cenie': 'warning', - u'upomnienie': 'admonition', - u'ramka': 'sidebar', - u'temat': 'topic', - u'blok-linii': 'line-block', - u'sparsowany-litera\u0142': 'parsed-literal', - u'rubryka': 'rubric', - u'epigraf': 'epigraph', - u'highlights': 'highlights', # FIXME no polish equivalent? - u'pull-quote': 'pull-quote', # FIXME no polish equivalent? - u'z\u0142o\u017cony': 'compound', - u'kontener': 'container', + 'uwaga': 'attention', + 'ostro\u017cnie': 'caution', + 'code (translation required)': 'code', + 'niebezpiecze\u0144stwo': 'danger', + 'b\u0142\u0105d': 'error', + 'wskaz\u00f3wka': 'hint', + 'wa\u017cne': 'important', + 'przypis': 'note', + 'rada': 'tip', + 'ostrze\u017cenie': 'warning', + 'upomnienie': 'admonition', + 'ramka': 'sidebar', + 'temat': 'topic', + 'blok-linii': 'line-block', + 'sparsowany-litera\u0142': 'parsed-literal', + 'rubryka': 'rubric', + 'epigraf': 'epigraph', + 'highlights': 'highlights', # FIXME no polish equivalent? + 'pull-quote': 'pull-quote', # FIXME no polish equivalent? + 'z\u0142o\u017cony': 'compound', + 'kontener': 'container', #'questions': 'questions', - u'tabela': 'table', - u'tabela-csv': 'csv-table', - u'tabela-listowa': 'list-table', + 'tabela': 'table', + 'tabela-csv': 'csv-table', + 'tabela-listowa': 'list-table', #'qa': 'questions', #'faq': 'questions', - u'meta': 'meta', + 'meta': 'meta', 'math (translation required)': 'math', #'imagemap': 'imagemap', - u'obraz': 'image', - u'rycina': 'figure', - u'do\u0142\u0105cz': 'include', - u'surowe': 'raw', - u'zast\u0105p': 'replace', - u'unikod': 'unicode', - u'data': 'date', - u'klasa': 'class', - u'rola': 'role', - u'rola-domy\u015blna': 'default-role', - u'tytu\u0142': 'title', - u'tre\u015b\u0107': 'contents', - u'sectnum': 'sectnum', - u'numeracja-sekcji': 'sectnum', - u'nag\u0142\u00f3wek': 'header', - u'stopka': 'footer', + 'obraz': 'image', + 'rycina': 'figure', + 'do\u0142\u0105cz': 'include', + 'surowe': 'raw', + 'zast\u0105p': 'replace', + 'unikod': 'unicode', + 'data': 'date', + 'klasa': 'class', + 'rola': 'role', + 'rola-domy\u015blna': 'default-role', + 'tytu\u0142': 'title', + 'tre\u015b\u0107': 'contents', + 'sectnum': 'sectnum', + 'numeracja-sekcji': 'sectnum', + 'nag\u0142\u00f3wek': 'header', + 'stopka': 'footer', #'footnotes': 'footnotes', #'citations': 'citations', - u'target-notes': 'target-notes', # FIXME no polish equivalent? - u'restructuredtext-test-directive': 'restructuredtext-test-directive'} + 'target-notes': 'target-notes', # FIXME no polish equivalent? + 'restructuredtext-test-directive': 'restructuredtext-test-directive'} """Polish name to registered (in directives/__init__.py) directive name mapping.""" roles = { # language-dependent: fixed - u'skr\u00f3t': 'abbreviation', - u'akronim': 'acronym', - u'code (translation required)': 'code', - u'indeks': 'index', - u'indeks-dolny': 'subscript', - u'indeks-g\u00f3rny': 'superscript', - u'referencja-tytu\u0142': 'title-reference', - u'referencja-pep': 'pep-reference', - u'referencja-rfc': 'rfc-reference', - u'podkre\u015blenie': 'emphasis', - u'wyt\u0142uszczenie': 'strong', - u'dos\u0142ownie': 'literal', + 'skr\u00f3t': 'abbreviation', + 'akronim': 'acronym', + 'code (translation required)': 'code', + 'indeks': 'index', + 'indeks-dolny': 'subscript', + 'indeks-g\u00f3rny': 'superscript', + 'referencja-tytu\u0142': 'title-reference', + 'referencja-pep': 'pep-reference', + 'referencja-rfc': 'rfc-reference', + 'podkre\u015blenie': 'emphasis', + 'wyt\u0142uszczenie': 'strong', + 'dos\u0142ownie': 'literal', 'math (translation required)': 'math', - u'referencja-nazwana': 'named-reference', - u'referencja-anonimowa': 'anonymous-reference', - u'referencja-przypis': 'footnote-reference', - u'referencja-cytat': 'citation-reference', - u'referencja-podstawienie': 'substitution-reference', - u'cel': 'target', - u'referencja-uri': 'uri-reference', - u'uri': 'uri-reference', - u'url': 'uri-reference', - u'surowe': 'raw',} + 'referencja-nazwana': 'named-reference', + 'referencja-anonimowa': 'anonymous-reference', + 'referencja-przypis': 'footnote-reference', + 'referencja-cytat': 'citation-reference', + 'referencja-podstawienie': 'substitution-reference', + 'cel': 'target', + 'referencja-uri': 'uri-reference', + 'uri': 'uri-reference', + 'url': 'uri-reference', + 'surowe': 'raw',} """Mapping of Polish role names to canonical role names for interpreted text. """ diff --git a/docutils/docutils/parsers/rst/languages/pt_br.py b/docutils/docutils/parsers/rst/languages/pt_br.py index 4c8a6ac59..6633461bf 100644 --- a/docutils/docutils/parsers/rst/languages/pt_br.py +++ b/docutils/docutils/parsers/rst/languages/pt_br.py @@ -17,90 +17,90 @@ directives = { # language-dependent: fixed - u'aten\u00E7\u00E3o': 'attention', + 'aten\u00E7\u00E3o': 'attention', 'cuidado': 'caution', - u'code (translation required)': 'code', + 'code (translation required)': 'code', 'perigo': 'danger', 'erro': 'error', - u'sugest\u00E3o': 'hint', + 'sugest\u00E3o': 'hint', 'importante': 'important', 'nota': 'note', 'dica': 'tip', 'aviso': 'warning', - u'exorta\u00E7\u00E3o': 'admonition', + 'exorta\u00E7\u00E3o': 'admonition', 'barra-lateral': 'sidebar', - u't\u00F3pico': 'topic', + 't\u00F3pico': 'topic', 'bloco-de-linhas': 'line-block', 'literal-interpretado': 'parsed-literal', 'rubrica': 'rubric', - u'ep\u00EDgrafo': 'epigraph', + 'ep\u00EDgrafo': 'epigraph', 'destaques': 'highlights', - u'cita\u00E7\u00E3o-destacada': 'pull-quote', - u'compound (translation required)': 'compound', - u'container (translation required)': 'container', + 'cita\u00E7\u00E3o-destacada': 'pull-quote', + 'compound (translation required)': 'compound', + 'container (translation required)': 'container', #'perguntas': 'questions', #'qa': 'questions', #'faq': 'questions', - u'table (translation required)': 'table', - u'csv-table (translation required)': 'csv-table', - u'list-table (translation required)': 'list-table', + 'table (translation required)': 'table', + 'csv-table (translation required)': 'csv-table', + 'list-table (translation required)': 'list-table', 'meta': 'meta', 'math (translation required)': 'math', #'imagemap': 'imagemap', 'imagem': 'image', 'figura': 'figure', - u'inclus\u00E3o': 'include', + 'inclus\u00E3o': 'include', 'cru': 'raw', - u'substitui\u00E7\u00E3o': 'replace', + 'substitui\u00E7\u00E3o': 'replace', 'unicode': 'unicode', 'data': 'date', 'classe': 'class', 'role (translation required)': 'role', - u'default-role (translation required)': 'default-role', - u'title (translation required)': 'title', - u'\u00EDndice': 'contents', + 'default-role (translation required)': 'default-role', + 'title (translation required)': 'title', + '\u00EDndice': 'contents', 'numsec': 'sectnum', - u'numera\u00E7\u00E3o-de-se\u00E7\u00F5es': 'sectnum', - u'header (translation required)': 'header', - u'footer (translation required)': 'footer', - #u'notas-de-rorap\u00E9': 'footnotes', - #u'cita\u00E7\u00F5es': 'citations', - u'links-no-rodap\u00E9': 'target-notes', + 'numera\u00E7\u00E3o-de-se\u00E7\u00F5es': 'sectnum', + 'header (translation required)': 'header', + 'footer (translation required)': 'footer', + #'notas-de-rorap\u00E9': 'footnotes', + #'cita\u00E7\u00F5es': 'citations', + 'links-no-rodap\u00E9': 'target-notes', 'restructuredtext-test-directive': 'restructuredtext-test-directive'} """Brazilian Portuguese name to registered (in directives/__init__.py) directive name mapping.""" roles = { # language-dependent: fixed - u'abbrevia\u00E7\u00E3o': 'abbreviation', + 'abbrevia\u00E7\u00E3o': 'abbreviation', 'ab': 'abbreviation', - u'acr\u00F4nimo': 'acronym', + 'acr\u00F4nimo': 'acronym', 'ac': 'acronym', - u'code (translation required)': 'code', - u'\u00EDndice-remissivo': 'index', + 'code (translation required)': 'code', + '\u00EDndice-remissivo': 'index', 'i': 'index', 'subscrito': 'subscript', 'sub': 'subscript', 'sobrescrito': 'superscript', 'sob': 'superscript', - u'refer\u00EAncia-a-t\u00EDtulo': 'title-reference', - u't\u00EDtulo': 'title-reference', + 'refer\u00EAncia-a-t\u00EDtulo': 'title-reference', + 't\u00EDtulo': 'title-reference', 't': 'title-reference', - u'refer\u00EAncia-a-pep': 'pep-reference', + 'refer\u00EAncia-a-pep': 'pep-reference', 'pep': 'pep-reference', - u'refer\u00EAncia-a-rfc': 'rfc-reference', + 'refer\u00EAncia-a-rfc': 'rfc-reference', 'rfc': 'rfc-reference', - u'\u00EAnfase': 'emphasis', + '\u00EAnfase': 'emphasis', 'forte': 'strong', 'literal': 'literal', 'math (translation required)': 'math', # translation required? - u'refer\u00EAncia-por-nome': 'named-reference', - u'refer\u00EAncia-an\u00F4nima': 'anonymous-reference', - u'refer\u00EAncia-a-nota-de-rodap\u00E9': 'footnote-reference', - u'refer\u00EAncia-a-cita\u00E7\u00E3o': 'citation-reference', - u'refer\u00EAncia-a-substitui\u00E7\u00E3o': 'substitution-reference', + 'refer\u00EAncia-por-nome': 'named-reference', + 'refer\u00EAncia-an\u00F4nima': 'anonymous-reference', + 'refer\u00EAncia-a-nota-de-rodap\u00E9': 'footnote-reference', + 'refer\u00EAncia-a-cita\u00E7\u00E3o': 'citation-reference', + 'refer\u00EAncia-a-substitui\u00E7\u00E3o': 'substitution-reference', 'alvo': 'target', - u'refer\u00EAncia-a-uri': 'uri-reference', + 'refer\u00EAncia-a-uri': 'uri-reference', 'uri': 'uri-reference', 'url': 'uri-reference', 'cru': 'raw',} diff --git a/docutils/docutils/parsers/rst/languages/ru.py b/docutils/docutils/parsers/rst/languages/ru.py index e4492f726..a72401763 100644 --- a/docutils/docutils/parsers/rst/languages/ru.py +++ b/docutils/docutils/parsers/rst/languages/ru.py @@ -15,74 +15,74 @@ __docformat__ = 'reStructuredText' directives = { - u'блок-строк': u'line-block', - u'meta': u'meta', - u'математика': 'math', - u'обработанный-литерал': u'parsed-literal', - u'выделенная-цитата': u'pull-quote', - u'код': 'code', - u'compound (translation required)': 'compound', - u'контейнер': 'container', - u'таблица': 'table', - u'csv-table (translation required)': 'csv-table', - u'list-table (translation required)': 'list-table', - u'сырой': u'raw', - u'замена': u'replace', - u'тестовая-директива-restructuredtext': u'restructuredtext-test-directive', - u'целевые-сноски': u'target-notes', - u'unicode': u'unicode', - u'дата': u'date', - u'боковая-полоса': u'sidebar', - u'важно': u'important', - u'включать': u'include', - u'внимание': u'attention', - u'выделение': u'highlights', - u'замечание': u'admonition', - u'изображение': u'image', - u'класс': u'class', - u'роль': 'role', - u'default-role (translation required)': 'default-role', - u'титул': 'title', - u'номер-раздела': u'sectnum', - u'нумерация-разделов': u'sectnum', - u'опасно': u'danger', - u'осторожно': u'caution', - u'ошибка': u'error', - u'подсказка': u'tip', - u'предупреждение': u'warning', - u'примечание': u'note', - u'рисунок': u'figure', - u'рубрика': u'rubric', - u'совет': u'hint', - u'содержание': u'contents', - u'тема': u'topic', - u'эпиграф': u'epigraph', - u'header (translation required)': 'header', - u'footer (translation required)': 'footer',} + 'блок-строк': 'line-block', + 'meta': 'meta', + 'математика': 'math', + 'обработанный-литерал': 'parsed-literal', + 'выделенная-цитата': 'pull-quote', + 'код': 'code', + 'compound (translation required)': 'compound', + 'контейнер': 'container', + 'таблица': 'table', + 'csv-table (translation required)': 'csv-table', + 'list-table (translation required)': 'list-table', + 'сырой': 'raw', + 'замена': 'replace', + 'тестовая-директива-restructuredtext': 'restructuredtext-test-directive', + 'целевые-сноски': 'target-notes', + 'unicode': 'unicode', + 'дата': 'date', + 'боковая-полоса': 'sidebar', + 'важно': 'important', + 'включать': 'include', + 'внимание': 'attention', + 'выделение': 'highlights', + 'замечание': 'admonition', + 'изображение': 'image', + 'класс': 'class', + 'роль': 'role', + 'default-role (translation required)': 'default-role', + 'титул': 'title', + 'номер-раздела': 'sectnum', + 'нумерация-разделов': 'sectnum', + 'опасно': 'danger', + 'осторожно': 'caution', + 'ошибка': 'error', + 'подсказка': 'tip', + 'предупреждение': 'warning', + 'примечание': 'note', + 'рисунок': 'figure', + 'рубрика': 'rubric', + 'совет': 'hint', + 'содержание': 'contents', + 'тема': 'topic', + 'эпиграф': 'epigraph', + 'header (translation required)': 'header', + 'footer (translation required)': 'footer',} """Russian name to registered (in directives/__init__.py) directive name mapping.""" roles = { - u'акроним': 'acronym', - u'код': 'code', - u'анонимная-ссылка': 'anonymous-reference', - u'буквально': 'literal', - u'математика': 'math', - u'верхний-индекс': 'superscript', - u'выделение': 'emphasis', - u'именованная-ссылка': 'named-reference', - u'индекс': 'index', - u'нижний-индекс': 'subscript', - u'сильное-выделение': 'strong', - u'сокращение': 'abbreviation', - u'ссылка-замена': 'substitution-reference', - u'ссылка-на-pep': 'pep-reference', - u'ссылка-на-rfc': 'rfc-reference', - u'ссылка-на-uri': 'uri-reference', - u'ссылка-на-заглавие': 'title-reference', - u'ссылка-на-сноску': 'footnote-reference', - u'цитатная-ссылка': 'citation-reference', - u'цель': 'target', - u'сырой': 'raw',} + 'акроним': 'acronym', + 'код': 'code', + 'анонимная-ссылка': 'anonymous-reference', + 'буквально': 'literal', + 'математика': 'math', + 'верхний-индекс': 'superscript', + 'выделение': 'emphasis', + 'именованная-ссылка': 'named-reference', + 'индекс': 'index', + 'нижний-индекс': 'subscript', + 'сильное-выделение': 'strong', + 'сокращение': 'abbreviation', + 'ссылка-замена': 'substitution-reference', + 'ссылка-на-pep': 'pep-reference', + 'ссылка-на-rfc': 'rfc-reference', + 'ссылка-на-uri': 'uri-reference', + 'ссылка-на-заглавие': 'title-reference', + 'ссылка-на-сноску': 'footnote-reference', + 'цитатная-ссылка': 'citation-reference', + 'цель': 'target', + 'сырой': 'raw',} """Mapping of Russian role names to canonical role names for interpreted text. """ diff --git a/docutils/docutils/parsers/rst/languages/sk.py b/docutils/docutils/parsers/rst/languages/sk.py index 86b6807f9..e1ca5fae9 100644 --- a/docutils/docutils/parsers/rst/languages/sk.py +++ b/docutils/docutils/parsers/rst/languages/sk.py @@ -16,80 +16,80 @@ directives = { - u'pozor': 'attention', - u'opatrne': 'caution', - u'code (translation required)': 'code', - u'nebezpe\xe8enstvo': 'danger', - u'chyba': 'error', - u'rada': 'hint', - u'd\xf4le\x9eit\xe9': 'important', - u'pozn\xe1mka': 'note', - u'tip (translation required)': 'tip', - u'varovanie': 'warning', - u'admonition (translation required)': 'admonition', - u'sidebar (translation required)': 'sidebar', - u't\xe9ma': 'topic', - u'blok-riadkov': 'line-block', - u'parsed-literal': 'parsed-literal', - u'rubric (translation required)': 'rubric', - u'epigraph (translation required)': 'epigraph', - u'highlights (translation required)': 'highlights', - u'pull-quote (translation required)': 'pull-quote', - u'compound (translation required)': 'compound', - u'container (translation required)': 'container', - #u'questions': 'questions', - #u'qa': 'questions', - #u'faq': 'questions', - u'table (translation required)': 'table', - u'csv-table (translation required)': 'csv-table', - u'list-table (translation required)': 'list-table', - u'meta': 'meta', + 'pozor': 'attention', + 'opatrne': 'caution', + 'code (translation required)': 'code', + 'nebezpe\xe8enstvo': 'danger', + 'chyba': 'error', + 'rada': 'hint', + 'd\xf4le\x9eit\xe9': 'important', + 'pozn\xe1mka': 'note', + 'tip (translation required)': 'tip', + 'varovanie': 'warning', + 'admonition (translation required)': 'admonition', + 'sidebar (translation required)': 'sidebar', + 't\xe9ma': 'topic', + 'blok-riadkov': 'line-block', + 'parsed-literal': 'parsed-literal', + 'rubric (translation required)': 'rubric', + 'epigraph (translation required)': 'epigraph', + 'highlights (translation required)': 'highlights', + 'pull-quote (translation required)': 'pull-quote', + 'compound (translation required)': 'compound', + 'container (translation required)': 'container', + #'questions': 'questions', + #'qa': 'questions', + #'faq': 'questions', + 'table (translation required)': 'table', + 'csv-table (translation required)': 'csv-table', + 'list-table (translation required)': 'list-table', + 'meta': 'meta', 'math (translation required)': 'math', - #u'imagemap': 'imagemap', - u'obr\xe1zok': 'image', - u'tvar': 'figure', - u'vlo\x9ei\x9d': 'include', - u'raw (translation required)': 'raw', - u'nahradi\x9d': 'replace', - u'unicode': 'unicode', - u'd\u00E1tum': 'date', - u'class (translation required)': 'class', - u'role (translation required)': 'role', - u'default-role (translation required)': 'default-role', - u'title (translation required)': 'title', - u'obsah': 'contents', - u'\xe8as\x9d': 'sectnum', - u'\xe8as\x9d-\xe8\xedslovanie': 'sectnum', - u'cie\xbeov\xe9-pozn\xe1mky': 'target-notes', - u'header (translation required)': 'header', - u'footer (translation required)': 'footer', - #u'footnotes': 'footnotes', - #u'citations': 'citations', + #'imagemap': 'imagemap', + 'obr\xe1zok': 'image', + 'tvar': 'figure', + 'vlo\x9ei\x9d': 'include', + 'raw (translation required)': 'raw', + 'nahradi\x9d': 'replace', + 'unicode': 'unicode', + 'd\u00E1tum': 'date', + 'class (translation required)': 'class', + 'role (translation required)': 'role', + 'default-role (translation required)': 'default-role', + 'title (translation required)': 'title', + 'obsah': 'contents', + '\xe8as\x9d': 'sectnum', + '\xe8as\x9d-\xe8\xedslovanie': 'sectnum', + 'cie\xbeov\xe9-pozn\xe1mky': 'target-notes', + 'header (translation required)': 'header', + 'footer (translation required)': 'footer', + #'footnotes': 'footnotes', + #'citations': 'citations', } """Slovak name to registered (in directives/__init__.py) directive name mapping.""" roles = { - u'abbreviation (translation required)': 'abbreviation', - u'acronym (translation required)': 'acronym', - u'code (translation required)': 'code', - u'index (translation required)': 'index', - u'subscript (translation required)': 'subscript', - u'superscript (translation required)': 'superscript', - u'title-reference (translation required)': 'title-reference', - u'pep-reference (translation required)': 'pep-reference', - u'rfc-reference (translation required)': 'rfc-reference', - u'emphasis (translation required)': 'emphasis', - u'strong (translation required)': 'strong', - u'literal (translation required)': 'literal', + 'abbreviation (translation required)': 'abbreviation', + 'acronym (translation required)': 'acronym', + 'code (translation required)': 'code', + 'index (translation required)': 'index', + 'subscript (translation required)': 'subscript', + 'superscript (translation required)': 'superscript', + 'title-reference (translation required)': 'title-reference', + 'pep-reference (translation required)': 'pep-reference', + 'rfc-reference (translation required)': 'rfc-reference', + 'emphasis (translation required)': 'emphasis', + 'strong (translation required)': 'strong', + 'literal (translation required)': 'literal', 'math (translation required)': 'math', - u'named-reference (translation required)': 'named-reference', - u'anonymous-reference (translation required)': 'anonymous-reference', - u'footnote-reference (translation required)': 'footnote-reference', - u'citation-reference (translation required)': 'citation-reference', - u'substitution-reference (translation required)': 'substitution-reference', - u'target (translation required)': 'target', - u'uri-reference (translation required)': 'uri-reference', - u'raw (translation required)': 'raw',} + 'named-reference (translation required)': 'named-reference', + 'anonymous-reference (translation required)': 'anonymous-reference', + 'footnote-reference (translation required)': 'footnote-reference', + 'citation-reference (translation required)': 'citation-reference', + 'substitution-reference (translation required)': 'substitution-reference', + 'target (translation required)': 'target', + 'uri-reference (translation required)': 'uri-reference', + 'raw (translation required)': 'raw',} """Mapping of Slovak role names to canonical role names for interpreted text. """ diff --git a/docutils/docutils/parsers/rst/languages/sv.py b/docutils/docutils/parsers/rst/languages/sv.py index 611457ea4..f0e78525f 100644 --- a/docutils/docutils/parsers/rst/languages/sv.py +++ b/docutils/docutils/parsers/rst/languages/sv.py @@ -14,81 +14,81 @@ __docformat__ = 'reStructuredText' directives = { - u'observera': 'attention', - u'akta': 'caution', # also 'försiktigt' - u'kod': 'code', - u'fara': 'danger', - u'fel': 'error', - u'vink': 'hint', # also 'hint' - u'viktigt': 'important', - u'notera': 'note', - u'tips': 'tip', - u'varning': 'warning', - u'anmärkning': 'admonition', # literal 'tillrättavisning', 'förmaning' - u'sidorad': 'sidebar', - u'ämne': 'topic', - u'tema': 'topic', - u'rad-block': 'line-block', - u'parsed-literal (translation required)': 'parsed-literal', # 'tolkad-bokstavlig'? - u'rubrik': 'rubric', - u'epigraf': 'epigraph', - u'höjdpunkter': 'highlights', - u'pull-quote (translation required)': 'pull-quote', - u'sammansatt': 'compound', - u'container': 'container', - # u'frågor': 'questions', + 'observera': 'attention', + 'akta': 'caution', # also 'försiktigt' + 'kod': 'code', + 'fara': 'danger', + 'fel': 'error', + 'vink': 'hint', # also 'hint' + 'viktigt': 'important', + 'notera': 'note', + 'tips': 'tip', + 'varning': 'warning', + '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'? + 'rubrik': 'rubric', + 'epigraf': 'epigraph', + 'höjdpunkter': 'highlights', + 'pull-quote (translation required)': 'pull-quote', + 'sammansatt': 'compound', + 'container': 'container', + # 'frågor': 'questions', # NOTE: A bit long, but recommended by http://www.nada.kth.se/dataterm/: - # u'frågor-och-svar': 'questions', - # u'vanliga-frågor': 'questions', - u'tabell': 'table', - u'csv-tabell': 'csv-table', - u'list-tabell': 'list-table', - u'meta': 'meta', - u'matematik': 'math', - # u'bildkarta': 'imagemap', # FIXME: Translation might be too literal. - u'bild': 'image', - u'figur': 'figure', - u'inkludera': 'include', - u'rå': 'raw', - u'ersätta': 'replace', - u'unicode': 'unicode', - u'datum': 'date', - u'klass': 'class', - u'roll': 'role', - u'standardroll': 'default-role', - u'titel': 'title', - u'innehåll': 'contents', - u'sektionsnumrering': 'sectnum', - u'target-notes (translation required)': 'target-notes', - u'sidhuvud': 'header', - u'sidfot': 'footer', - # u'fotnoter': 'footnotes', - # u'citeringar': 'citations', + # 'frågor-och-svar': 'questions', + # 'vanliga-frågor': 'questions', + 'tabell': 'table', + 'csv-tabell': 'csv-table', + 'list-tabell': 'list-table', + 'meta': 'meta', + 'matematik': 'math', + # 'bildkarta': 'imagemap', # FIXME: Translation might be too literal. + 'bild': 'image', + 'figur': 'figure', + 'inkludera': 'include', + 'rå': 'raw', + 'ersätta': 'replace', + 'unicode': 'unicode', + 'datum': 'date', + 'klass': 'class', + 'roll': 'role', + 'standardroll': 'default-role', + 'titel': 'title', + 'innehåll': 'contents', + 'sektionsnumrering': 'sectnum', + 'target-notes (translation required)': 'target-notes', + 'sidhuvud': 'header', + 'sidfot': 'footer', + # 'fotnoter': 'footnotes', + # 'citeringar': 'citations', } """Swedish name to registered (in directives/__init__.py) directive name mapping.""" roles = { - u'förkortning': 'abbreviation', - u'akronym': 'acronym', - u'kod': 'code', - u'index': 'index', - u'nedsänkt': 'subscript', - u'upphöjd': 'superscript', - u'titel-referens': 'title-reference', - u'pep-referens': 'pep-reference', - u'rfc-referens': 'rfc-reference', - u'betoning': 'emphasis', - u'stark': 'strong', - u'bokstavlig': 'literal', # also 'ordagranna' - u'matematik': 'math', - u'namngiven-referens': 'named-reference', - u'anonym-referens': 'anonymous-reference', - u'fotnot-referens': 'footnote-reference', - u'citat-referens': 'citation-reference', - u'ersättnings-referens': 'substitution-reference', - u'mål': 'target', - u'uri-referens': 'uri-reference', - u'rå': 'raw',} + 'förkortning': 'abbreviation', + 'akronym': 'acronym', + 'kod': 'code', + 'index': 'index', + 'nedsänkt': 'subscript', + 'upphöjd': 'superscript', + 'titel-referens': 'title-reference', + 'pep-referens': 'pep-reference', + 'rfc-referens': 'rfc-reference', + 'betoning': 'emphasis', + 'stark': 'strong', + 'bokstavlig': 'literal', # also 'ordagranna' + 'matematik': 'math', + 'namngiven-referens': 'named-reference', + 'anonym-referens': 'anonymous-reference', + 'fotnot-referens': 'footnote-reference', + 'citat-referens': 'citation-reference', + 'ersättnings-referens': 'substitution-reference', + 'mål': 'target', + 'uri-referens': 'uri-reference', + 'rå': 'raw',} """Mapping of Swedish role names to canonical role names for interpreted text. """ diff --git a/docutils/docutils/parsers/rst/languages/zh_cn.py b/docutils/docutils/parsers/rst/languages/zh_cn.py index d45f3f35c..beeab9b78 100644 --- a/docutils/docutils/parsers/rst/languages/zh_cn.py +++ b/docutils/docutils/parsers/rst/languages/zh_cn.py @@ -17,87 +17,87 @@ directives = { # language-dependent: fixed - u'注意': 'attention', - u'小心': 'caution', - u'code (translation required)': 'code', - u'危险': 'danger', - u'错误': 'error', - u'提示': 'hint', - u'重要': 'important', - u'注解': 'note', - u'技巧': 'tip', - u'警告': 'warning', - u'忠告': 'admonition', - u'侧框': 'sidebar', - u'主题': 'topic', - u'line-block (translation required)': 'line-block', - u'parsed-literal (translation required)': 'parsed-literal', - u'醒目': 'rubric', - u'铭文': 'epigraph', - u'要点': 'highlights', - u'pull-quote (translation required)': 'pull-quote', - u'复合': 'compound', - u'容器': 'container', - #u'questions (translation required)': 'questions', - u'表格': 'table', - u'csv表格': 'csv-table', - u'列表表格': 'list-table', - #u'qa (translation required)': 'questions', - #u'faq (translation required)': 'questions', - u'元数据': 'meta', - u'math (translation required)': 'math', - #u'imagemap (translation required)': 'imagemap', - u'图片': 'image', - u'图例': 'figure', - u'包含': 'include', - u'原文': 'raw', - u'代替': 'replace', - u'统一码': 'unicode', - u'日期': 'date', - u'类型': 'class', - u'角色': 'role', - u'默认角色': 'default-role', - u'标题': 'title', - u'目录': 'contents', - u'章节序号': 'sectnum', - u'题头': 'header', - u'页脚': 'footer', - #u'footnotes (translation required)': 'footnotes', - #u'citations (translation required)': 'citations', - u'target-notes (translation required)': 'target-notes', - u'restructuredtext-test-directive': 'restructuredtext-test-directive'} + '注意': 'attention', + '小心': 'caution', + 'code (translation required)': 'code', + '危险': 'danger', + '错误': 'error', + '提示': 'hint', + '重要': 'important', + '注解': 'note', + '技巧': 'tip', + '警告': 'warning', + '忠告': 'admonition', + '侧框': 'sidebar', + '主题': 'topic', + 'line-block (translation required)': 'line-block', + 'parsed-literal (translation required)': 'parsed-literal', + '醒目': 'rubric', + '铭文': 'epigraph', + '要点': 'highlights', + 'pull-quote (translation required)': 'pull-quote', + '复合': 'compound', + '容器': 'container', + #'questions (translation required)': 'questions', + '表格': 'table', + 'csv表格': 'csv-table', + '列表表格': 'list-table', + #'qa (translation required)': 'questions', + #'faq (translation required)': 'questions', + '元数据': 'meta', + 'math (translation required)': 'math', + #'imagemap (translation required)': 'imagemap', + '图片': 'image', + '图例': 'figure', + '包含': 'include', + '原文': 'raw', + '代替': 'replace', + '统一码': 'unicode', + '日期': 'date', + '类型': 'class', + '角色': 'role', + '默认角色': 'default-role', + '标题': 'title', + '目录': 'contents', + '章节序号': 'sectnum', + '题头': 'header', + '页脚': 'footer', + #'footnotes (translation required)': 'footnotes', + #'citations (translation required)': 'citations', + 'target-notes (translation required)': 'target-notes', + 'restructuredtext-test-directive': 'restructuredtext-test-directive'} """Simplified Chinese name to registered (in directives/__init__.py) directive name mapping.""" roles = { # language-dependent: fixed - u'缩写': 'abbreviation', - u'简称': 'acronym', - u'code (translation required)': 'code', - u'index (translation required)': 'index', - u'i (translation required)': 'index', - u'下标': 'subscript', - u'上标': 'superscript', - u'title-reference (translation required)': 'title-reference', - u'title (translation required)': 'title-reference', - u't (translation required)': 'title-reference', - u'pep-reference (translation required)': 'pep-reference', - u'pep (translation required)': 'pep-reference', - u'rfc-reference (translation required)': 'rfc-reference', - u'rfc (translation required)': 'rfc-reference', - u'强调': 'emphasis', - u'加粗': 'strong', - u'字面': 'literal', - u'math (translation required)': 'math', - u'named-reference (translation required)': 'named-reference', - u'anonymous-reference (translation required)': 'anonymous-reference', - u'footnote-reference (translation required)': 'footnote-reference', - u'citation-reference (translation required)': 'citation-reference', - u'substitution-reference (translation required)': 'substitution-reference', - u'target (translation required)': 'target', - u'uri-reference (translation required)': 'uri-reference', - u'uri (translation required)': 'uri-reference', - u'url (translation required)': 'uri-reference', - u'raw (translation required)': 'raw',} + '缩写': 'abbreviation', + '简称': 'acronym', + 'code (translation required)': 'code', + 'index (translation required)': 'index', + 'i (translation required)': 'index', + '下标': 'subscript', + '上标': 'superscript', + 'title-reference (translation required)': 'title-reference', + 'title (translation required)': 'title-reference', + 't (translation required)': 'title-reference', + 'pep-reference (translation required)': 'pep-reference', + 'pep (translation required)': 'pep-reference', + 'rfc-reference (translation required)': 'rfc-reference', + 'rfc (translation required)': 'rfc-reference', + '强调': 'emphasis', + '加粗': 'strong', + '字面': 'literal', + 'math (translation required)': 'math', + 'named-reference (translation required)': 'named-reference', + 'anonymous-reference (translation required)': 'anonymous-reference', + 'footnote-reference (translation required)': 'footnote-reference', + 'citation-reference (translation required)': 'citation-reference', + 'substitution-reference (translation required)': 'substitution-reference', + 'target (translation required)': 'target', + 'uri-reference (translation required)': 'uri-reference', + 'uri (translation required)': 'uri-reference', + 'url (translation required)': 'uri-reference', + 'raw (translation required)': 'raw',} """Mapping of Simplified Chinese role names to canonical role names for interpreted text.""" diff --git a/docutils/docutils/parsers/rst/languages/zh_tw.py b/docutils/docutils/parsers/rst/languages/zh_tw.py index f5c010c67..e259a23dc 100644 --- a/docutils/docutils/parsers/rst/languages/zh_tw.py +++ b/docutils/docutils/parsers/rst/languages/zh_tw.py @@ -37,7 +37,7 @@ 'highlights (translation required)': 'highlights', 'pull-quote (translation required)': 'pull-quote', 'compound (translation required)': 'compound', - u'container (translation required)': 'container', + 'container (translation required)': 'container', #'questions (translation required)': 'questions', 'table (translation required)': 'table', 'csv-table (translation required)': 'csv-table', @@ -53,16 +53,16 @@ 'raw (translation required)': 'raw', 'replace (translation required)': 'replace', 'unicode (translation required)': 'unicode', - u'日期': 'date', + '日期': 'date', 'class (translation required)': 'class', 'role (translation required)': 'role', - u'default-role (translation required)': 'default-role', - u'title (translation required)': 'title', + 'default-role (translation required)': 'default-role', + 'title (translation required)': 'title', 'contents (translation required)': 'contents', 'sectnum (translation required)': 'sectnum', 'section-numbering (translation required)': 'sectnum', - u'header (translation required)': 'header', - u'footer (translation required)': 'footer', + 'header (translation required)': 'header', + 'footer (translation required)': 'footer', #'footnotes (translation required)': 'footnotes', #'citations (translation required)': 'citations', 'target-notes (translation required)': 'target-notes', @@ -76,7 +76,7 @@ 'ab (translation required)': 'abbreviation', 'acronym (translation required)': 'acronym', 'ac (translation required)': 'acronym', - u'code (translation required)': 'code', + 'code (translation required)': 'code', 'index (translation required)': 'index', 'i (translation required)': 'index', 'subscript (translation required)': 'subscript', diff --git a/docutils/docutils/parsers/rst/states.py b/docutils/docutils/parsers/rst/states.py index 55b01e4b6..cbacc6541 100644 --- a/docutils/docutils/parsers/rst/states.py +++ b/docutils/docutils/parsers/rst/states.py @@ -473,13 +473,13 @@ def __init__(self): def init_customizations(self, settings): # lookahead and look-behind expressions for inline markup rules if getattr(settings, 'character_level_inline_markup', False): - start_string_prefix = u'(^|(?<!\x00))' - end_string_suffix = u'' + start_string_prefix = '(^|(?<!\x00))' + end_string_suffix = '' else: - start_string_prefix = (u'(^|(?<=\\s|[%s%s]))' % + start_string_prefix = ('(^|(?<=\\s|[%s%s]))' % (punctuation_chars.openers, punctuation_chars.delimiters)) - end_string_suffix = (u'($|(?=\\s|[\x00%s%s%s]))' % + end_string_suffix = ('($|(?=\\s|[\x00%s%s%s]))' % (punctuation_chars.closing_delimiters, punctuation_chars.delimiters, punctuation_chars.closers)) @@ -1135,7 +1135,7 @@ class Body(RSTState): pats['enum'], re.escape(enum.formatinfo[format].suffix)) patterns = { - 'bullet': u'[-+*\u2022\u2023\u2043]( +|$)', + 'bullet': '[-+*\u2022\u2023\u2043]( +|$)', 'enumerator': r'(%(parens)s|%(rparen)s|%(period)s)( +|$)' % pats, 'field_marker': r':(?![: ])([^:\\]|\\.|:(?!([ `]|$)))*(?<! ):( +|$)', 'option_marker': r'%(option)s(, %(option)s)*( +| ?$)' % pats, @@ -1196,7 +1196,7 @@ def block_quote(self, indented, line_offset): return elements # U+2014 is an em-dash: - attribution_pattern = re.compile(u'(---?(?!-)|\u2014) *(?=[^ \\n])', + attribution_pattern = re.compile('(---?(?!-)|\u2014) *(?=[^ \\n])', re.UNICODE) def split_attribution(self, indented, line_offset): @@ -1502,7 +1502,7 @@ def option_marker(self, match, context, next_state): listitem, blank_finish = self.option_list_item(match) except MarkupError as error: # This shouldn't happen; pattern won't match. - msg = self.reporter.error(u'Invalid option list marker: %s' % + msg = self.reporter.error('Invalid option list marker: %s' % error) self.parent += msg indented, indent, line_offset, blank_finish = \ @@ -1622,7 +1622,7 @@ def line_block_line(self, match, lineno): indented, indent, line_offset, blank_finish = \ self.state_machine.get_first_known_indented(match.end(), until_blank=True) - text = u'\n'.join(indented) + text = '\n'.join(indented) text_nodes, messages = self.inline_text(text, lineno) line = nodes.line(text, '', *text_nodes) if match.string.rstrip() != '|': # not empty diff --git a/docutils/docutils/statemachine.py b/docutils/docutils/statemachine.py index 162d255df..b250f7e79 100644 --- a/docutils/docutils/statemachine.py +++ b/docutils/docutils/statemachine.py @@ -212,8 +212,8 @@ def run(self, input_lines, input_offset=0, context=None, self.line_offset = -1 self.current_state = initial_state or self.initial_state if self.debug: - print(u'\nStateMachine.run: input_lines (line_offset=%s):\n| %s' - % (self.line_offset, u'\n| '.join(self.input_lines)), file=self._stderr) + print('\nStateMachine.run: input_lines (line_offset=%s):\n| %s' + % (self.line_offset, '\n| '.join(self.input_lines)), file=self._stderr) transitions = None results = [] state = self.get_state() @@ -229,8 +229,8 @@ def run(self, input_lines, input_offset=0, context=None, if self.debug: source, offset = self.input_lines.info( self.line_offset) - print(u'\nStateMachine.run: line (source=%r, ' - u'offset=%r):\n| %s' + print('\nStateMachine.run: line (source=%r, ' + 'offset=%r):\n| %s' % (source, offset, self.line), file=self._stderr) context, next_state, result = self.check_line( context, state, transitions) @@ -480,9 +480,9 @@ def runtime_init(self): def error(self): """Report error details.""" type, value, module, line, function = _exception_data() - print(u'%s: %s' % (type, value), file=self._stderr) + print('%s: %s' % (type, value), file=self._stderr) print('input line %s' % (self.abs_line_number()), file=self._stderr) - print((u'module %s, line %s, function %s' % + print(('module %s, line %s, function %s' % (module, line, function)), file=self._stderr) def attach_observer(self, observer): diff --git a/docutils/docutils/transforms/parts.py b/docutils/docutils/transforms/parts.py index f42c38aa5..670010e9e 100644 --- a/docutils/docutils/transforms/parts.py +++ b/docutils/docutils/transforms/parts.py @@ -58,7 +58,7 @@ def update_section_numbers(self, node, prefix=(), depth=0): # Use   for spacing: generated = nodes.generated( '', (self.prefix + '.'.join(numbers) + self.suffix - + u'\u00a0' * 3), + + '\u00a0' * 3), classes=['sectnum']) title.insert(0, generated) title['auto'] = 1 diff --git a/docutils/docutils/transforms/references.py b/docutils/docutils/transforms/references.py index dc156b7b1..d23a7a76a 100644 --- a/docutils/docutils/transforms/references.py +++ b/docutils/docutils/transforms/references.py @@ -478,17 +478,17 @@ class Footnotes(Transform): # Entries 1-4 and 6 below are from section 12.51 of # The Chicago Manual of Style, 14th edition. '*', # asterisk/star - u'\u2020', # † † dagger - u'\u2021', # ‡ ‡ double dagger - u'\u00A7', # § § section mark - u'\u00B6', # ¶ ¶ paragraph mark (pilcrow) + '\u2020', # † † dagger + '\u2021', # ‡ ‡ double dagger + '\u00A7', # § § section mark + '\u00B6', # ¶ ¶ paragraph mark (pilcrow) # (parallels ['||'] in CMoS) '#', # number sign # The entries below were chosen arbitrarily. - u'\u2660', # ♠ ♠ spade suit - u'\u2665', # ♡ ♥ heart suit - u'\u2666', # ♢ ♦ diamond suit - u'\u2663', # ♣ ♣ club suit + '\u2660', # ♠ ♠ spade suit + '\u2665', # ♡ ♥ heart suit + '\u2666', # ♢ ♦ diamond suit + '\u2663', # ♣ ♣ club suit ] def apply(self): diff --git a/docutils/docutils/utils/__init__.py b/docutils/docutils/utils/__init__.py index 6cd0a38c9..6e0c17324 100644 --- a/docutils/docutils/utils/__init__.py +++ b/docutils/docutils/utils/__init__.py @@ -597,13 +597,13 @@ def split_escaped_whitespace(text): return list(itertools.chain(*strings)) def strip_combining_chars(text): - return u''.join([c for c in text if not unicodedata.combining(c)]) + return ''.join([c for c in text if not unicodedata.combining(c)]) def find_combining_chars(text): """Return indices of all combining chars in Unicode string `text`. >>> from docutils.utils import find_combining_chars - >>> find_combining_chars(u'A t̆ab̆lĕ') + >>> find_combining_chars('A t̆ab̆lĕ') [3, 6, 9] """ @@ -613,7 +613,7 @@ def column_indices(text): """Indices of Unicode string `text` when skipping combining characters. >>> from docutils.utils import column_indices - >>> column_indices(u'A t̆ab̆lĕ') + >>> column_indices('A t̆ab̆lĕ') [0, 1, 2, 4, 5, 7, 8] """ diff --git a/docutils/docutils/utils/error_reporting.py b/docutils/docutils/utils/error_reporting.py index ec6a05ec0..a5c873db4 100644 --- a/docutils/docutils/utils/error_reporting.py +++ b/docutils/docutils/utils/error_reporting.py @@ -26,7 +26,7 @@ Error reporting should be safe from encoding/decoding errors. However, implicit conversions of strings and exceptions like ->>> u'%s world: %s' % ('H\xe4llo', Exception(u'H\xe4llo')) +>>> '%s world: %s' % ('H\xe4llo', Exception('H\xe4llo')) fail in some Python versions: @@ -131,7 +131,7 @@ def __unicode__(self): try: u = unicode(self.data) if isinstance(self.data, EnvironmentError): - u = u.replace(": u'", ": '") # normalize filename quoting + u = u.replace(": '", ": '") # normalize filename quoting return u except UnicodeError as error: # catch ..Encode.. and ..Decode.. errors if isinstance(self.data, EnvironmentError): @@ -144,7 +144,7 @@ def __unicode__(self): args = [unicode(SafeString(arg, self.encoding, decoding_errors=self.decoding_errors)) for arg in self.data.args] - return u', '.join(args) + return ', '.join(args) if isinstance(error, UnicodeDecodeError): return unicode(self.data, self.encoding, self.decoding_errors) raise @@ -158,7 +158,7 @@ def __str__(self): super(ErrorString, self).__str__()) def __unicode__(self): - return u'%s: %s' % (self.data.__class__.__name__, + return '%s: %s' % (self.data.__class__.__name__, super(ErrorString, self).__unicode__()) diff --git a/docutils/docutils/utils/math/latex2mathml.py b/docutils/docutils/utils/math/latex2mathml.py index e65879efd..bd5603b9f 100644 --- a/docutils/docutils/utils/math/latex2mathml.py +++ b/docutils/docutils/utils/math/latex2mathml.py @@ -42,22 +42,22 @@ # identifiers -> <mi> letters = tex2unichar.mathalpha -letters['hbar'] = u'\u210F' # compatibility mapping to ℏ (\hslash). +letters['hbar'] = '\u210F' # compatibility mapping to ℏ (\hslash). # (ħ LATIN SMALL LETTER H WITH STROKE is upright) # special case: Capital Greek letters: (upright in TeX style) greek_capitals = { - 'Phi':u'\u03a6', 'Xi':u'\u039e', 'Sigma':u'\u03a3', - 'Psi':u'\u03a8', 'Delta':u'\u0394', 'Theta':u'\u0398', - 'Upsilon':u'\u03d2', 'Pi':u'\u03a0', 'Omega':u'\u03a9', - 'Gamma':u'\u0393', 'Lambda':u'\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 - 'liminf': u'lim\u202finf', - 'limsup': u'lim\u202fsup', - 'injlim': u'inj\u202flim', - 'projlim': u'proj\u202flim', + 'liminf': 'lim\u202finf', + 'limsup': 'lim\u202fsup', + 'injlim': 'inj\u202flim', + 'projlim': 'proj\u202flim', # embellished function names (see handle_cmd() below) 'varlimsup': 'lim', 'varliminf': 'lim', @@ -101,21 +101,21 @@ stretchables = {# extensible delimiters allowed in left/right cmds 'backslash': '\\', - 'uparrow': u'\u2191', # ↑ UPWARDS ARROW - 'downarrow': u'\u2193', # ↓ DOWNWARDS ARROW - 'updownarrow': u'\u2195', # ↕ UP DOWN ARROW - 'Uparrow': u'\u21d1', # ⇑ UPWARDS DOUBLE ARROW - 'Downarrow': u'\u21d3', # ⇓ DOWNWARDS DOUBLE ARROW - 'Updownarrow': u'\u21d5', # ⇕ UP DOWN DOUBLE ARROW - 'lmoustache': u'\u23b0', # ⎰ UPPER LEFT OR LOWER RIGHT CURLY BRACKET SECTION - 'rmoustache': u'\u23b1', # ⎱ UPPER RIGHT OR LOWER LEFT CURLY BRACKET SECTION - 'arrowvert': u'\u23d0', # ⏐ VERTICAL LINE EXTENSION - 'bracevert': u'\u23aa', # ⎪ CURLY BRACKET EXTENSION - 'lvert': u'|', # left | - 'lVert': u'\u2016', # left ‖ - 'rvert': u'|', # right | - 'rVert': u'\u2016', # right ‖ - 'Arrowvert': u'\u2016', # ‖ + 'uparrow': '\u2191', # ↑ UPWARDS ARROW + 'downarrow': '\u2193', # ↓ DOWNWARDS ARROW + 'updownarrow': '\u2195', # ↕ UP DOWN ARROW + 'Uparrow': '\u21d1', # ⇑ UPWARDS DOUBLE ARROW + 'Downarrow': '\u21d3', # ⇓ DOWNWARDS DOUBLE ARROW + 'Updownarrow': '\u21d5', # ⇕ UP DOWN DOUBLE ARROW + 'lmoustache': '\u23b0', # ⎰ UPPER LEFT OR LOWER RIGHT CURLY BRACKET SECTION + 'rmoustache': '\u23b1', # ⎱ UPPER RIGHT OR LOWER LEFT CURLY BRACKET SECTION + 'arrowvert': '\u23d0', # ⏐ VERTICAL LINE EXTENSION + 'bracevert': '\u23aa', # ⎪ CURLY BRACKET EXTENSION + 'lvert': '|', # left | + 'lVert': '\u2016', # left ‖ + 'rvert': '|', # right | + 'rVert': '\u2016', # right ‖ + 'Arrowvert': '\u2016', # ‖ } stretchables.update(tex2unichar.mathfence) stretchables.update(tex2unichar.mathopen) # Braces @@ -125,26 +125,26 @@ # [ \ ] { | } ‖ ↑ ↓ ↕ ⇑ ⇓ ⇕ ⌈ ⌉ ⌊ ⌋ ⌜ ⌝ ⌞ ⌟ ⎪ ⎰ ⎱ ⏐ ⟅ ⟆ ⟦ ⟧ ⟨ ⟩ ⟮ ⟯ ⦇ ⦈ operators = {# negated symbols without pre-composed Unicode character - 'nleqq': u'\u2266\u0338', # ≦̸ - 'ngeqq': u'\u2267\u0338', # ≧̸ - 'nleqslant': u'\u2a7d\u0338', # ⩽̸ - 'ngeqslant': u'\u2a7e\u0338', # ⩾̸ - 'ngtrless': u'\u2277\u0338', # txfonts - 'nlessgtr': u'\u2276\u0338', # txfonts - 'nsubseteqq': u'\u2AC5\u0338', # ⫅̸ - 'nsupseteqq': u'\u2AC6\u0338', # ⫆̸ + 'nleqq': '\u2266\u0338', # ≦̸ + 'ngeqq': '\u2267\u0338', # ≧̸ + 'nleqslant': '\u2a7d\u0338', # ⩽̸ + 'ngeqslant': '\u2a7e\u0338', # ⩾̸ + 'ngtrless': '\u2277\u0338', # txfonts + 'nlessgtr': '\u2276\u0338', # txfonts + 'nsubseteqq': '\u2AC5\u0338', # ⫅̸ + 'nsupseteqq': '\u2AC6\u0338', # ⫆̸ # compatibility definitions: - 'centerdot': u'\u2B1D', # BLACK VERY SMALL SQUARE | mathbin - 'varnothing': u'\u2300', # ⌀ DIAMETER SIGN | empty set - 'varpropto': u'\u221d', # ∝ PROPORTIONAL TO | sans serif - 'triangle': u'\u25B3', # WHITE UP-POINTING TRIANGLE | mathord - 'triangledown': u'\u25BD', # WHITE DOWN-POINTING TRIANGLE | mathord + 'centerdot': '\u2B1D', # BLACK VERY SMALL SQUARE | mathbin + 'varnothing': '\u2300', # ⌀ DIAMETER SIGN | empty set + 'varpropto': '\u221d', # ∝ PROPORTIONAL TO | sans serif + 'triangle': '\u25B3', # WHITE UP-POINTING TRIANGLE | mathord + 'triangledown': '\u25BD', # WHITE DOWN-POINTING TRIANGLE | mathord # alias commands: - 'dotsb': u'\u22ef', # ⋯ with binary operators/relations - 'dotsc': u'\u2026', # … with commas - 'dotsi': u'\u22ef', # ⋯ with integrals - 'dotsm': u'\u22ef', # ⋯ multiplication dots - 'dotso': u'\u2026', # … other dots + 'dotsb': '\u22ef', # ⋯ with binary operators/relations + 'dotsc': '\u2026', # … with commas + 'dotsi': '\u22ef', # ⋯ with integrals + 'dotsm': '\u22ef', # ⋯ multiplication dots + 'dotso': '\u2026', # … other dots # functions with movable limits (requires <mo>) 'lim': 'lim', 'sup': 'sup', @@ -163,18 +163,18 @@ # special cases thick_operators = {# style='font-weight: bold;' - 'thicksim': u'\u223C', # ∼ - 'thickapprox':u'\u2248', # ≈ + 'thicksim': '\u223C', # ∼ + 'thickapprox':'\u2248', # ≈ } small_operators = {# mathsize='75%' - 'shortmid': u'\u2223', # ∣ - 'shortparallel': u'\u2225', # ∥ - 'nshortmid': u'\u2224', # ∤ - 'nshortparallel': u'\u2226', # ∦ - 'smallfrown': u'\u2322', # ⌢ FROWN - 'smallsmile': u'\u2323', # ⌣ SMILE - 'smallint': u'\u222b', # ∫ INTEGRAL + 'shortmid': '\u2223', # ∣ + 'shortparallel': '\u2225', # ∥ + 'nshortmid': '\u2224', # ∤ + 'nshortparallel': '\u2226', # ∦ + 'smallfrown': '\u2322', # ⌢ FROWN + 'smallsmile': '\u2323', # ⌣ SMILE + 'smallint': '\u222b', # ∫ INTEGRAL } # Operators and functions with limits above/below in display formulas @@ -209,53 +209,53 @@ # accents -> <mover stretchy="false"> accents = {# TeX: (spacing, combining) - 'acute': (u'´', u'\u0301'), - 'bar': (u'ˉ', u'\u0304'), - 'breve': (u'˘', u'\u0306'), - 'check': (u'ˇ', u'\u030C'), - 'dot': (u'˙', u'\u0307'), - 'ddot': (u'¨', u'\u0308'), - 'dddot': (u'⋯', u'\u20DB'), - 'grave': (u'`', u'\u0300'), - 'hat': (u'ˆ', u'\u0302'), - 'mathring': (u'˚', u'\u030A'), - 'tilde': (u'˜', u'\u0303'), # tilde ~ or small tilde ˜? - 'vec': (u'→', u'\u20d7'), # → too heavy, accents="false" + 'acute': ('´', '\u0301'), + 'bar': ('ˉ', '\u0304'), + 'breve': ('˘', '\u0306'), + 'check': ('ˇ', '\u030C'), + 'dot': ('˙', '\u0307'), + 'ddot': ('¨', '\u0308'), + 'dddot': ('⋯', '\u20DB'), + 'grave': ('`', '\u0300'), + 'hat': ('ˆ', '\u0302'), + 'mathring': ('˚', '\u030A'), + 'tilde': ('˜', '\u0303'), # tilde ~ or small tilde ˜? + 'vec': ('→', '\u20d7'), # → too heavy, accents="false" # TODO: ddddot } # limits etc. -> <mover> or <munder> over = {# TeX: (char, offset-correction/em) - 'overbrace': (u'\u23DE', -0.2), # DejaVu Math -0.6 - 'overleftarrow': (u'\u2190', -0.2), - 'overleftrightarrow': (u'\u2194', -0.2), - 'overline': (u'_', -0.2), # \u2012' FIGURE DASH does not stretch - 'overrightarrow': (u'\u2192', -0.2), - 'widehat': (u'^', -0.5), - 'widetilde': (u'~', -0.3), + 'overbrace': ('\u23DE', -0.2), # DejaVu Math -0.6 + 'overleftarrow': ('\u2190', -0.2), + 'overleftrightarrow': ('\u2194', -0.2), + 'overline': ('_', -0.2), # \u2012' FIGURE DASH does not stretch + 'overrightarrow': ('\u2192', -0.2), + 'widehat': ('^', -0.5), + 'widetilde': ('~', -0.3), } -under = {'underbrace': (u'\u23DF', 0.1), # DejaVu Math -0.7 - 'underleftarrow': (u'\u2190', -0.2), - 'underleftrightarrow': (u'\u2194', -0.2), - 'underline': (u'_', -0.8), - 'underrightarrow': (u'\u2192', -0.2), +under = {'underbrace': ('\u23DF', 0.1), # DejaVu Math -0.7 + 'underleftarrow': ('\u2190', -0.2), + 'underleftrightarrow': ('\u2194', -0.2), + 'underline': ('_', -0.8), + 'underrightarrow': ('\u2192', -0.2), } # Character translations # ---------------------- # characters with preferred alternative in mathematical use # cf. https://www.w3.org/TR/MathML3/chapter7.html#chars.anomalous -anomalous_chars = {'-': u'\u2212', # HYPHEN-MINUS -> MINUS SIGN - ':': u'\u2236', # COLON -> RATIO - '~': u'\u00a0', # NO-BREAK SPACE +anomalous_chars = {'-': '\u2212', # HYPHEN-MINUS -> MINUS SIGN + ':': '\u2236', # COLON -> RATIO + '~': '\u00a0', # NO-BREAK SPACE } # blackboard bold (Greek characters not working with "mathvariant" (Firefox 78) -mathbb = {u'Γ': u'\u213E', # ℾ - u'Π': u'\u213F', # ℿ - u'Σ': u'\u2140', # ⅀ - u'γ': u'\u213D', # ℽ - u'π': u'\u213C', # ℼ +mathbb = {'Γ': '\u213E', # ℾ + 'Π': '\u213F', # ℿ + 'Σ': '\u2140', # ⅀ + 'γ': '\u213D', # ℽ + 'π': '\u213C', # ℼ } # Matrix environments @@ -266,7 +266,7 @@ 'bmatrix': ('[', ']'), 'Bmatrix': ('{', '}'), 'vmatrix': ('|', '|'), - 'Vmatrix': (u'\u2016', u'\u2016'), # ‖ + 'Vmatrix': ('\u2016', '\u2016'), # ‖ 'cases': ('{', ''), } @@ -316,10 +316,10 @@ class math(object): """Parent node in MathML DOM tree.""" _level = 0 # indentation level (static class variable) xml_entities = { # for invalid and invisible characters - ord('<'): u'<', - ord('>'): u'>', - ord('&'): u'&', - 0x2061: u'⁡', + ord('<'): '<', + ord('>'): '>', + ord('&'): '&', + 0x2061: '⁡', } _boolstrings = {True: 'true', False: 'false'} """String representation of boolean MathML attribute values.""" @@ -519,9 +519,9 @@ class mi(MathToken): pass class mo(MathToken): pass class mn(MathToken): pass -# >>> mo(u'<') +# >>> mo('<') # mo('<') -# >>> mo(u'<')._xml() +# >>> mo('<')._xml() # ['<mo>', '<', '</mo>'] class MathSchema(math): @@ -830,7 +830,7 @@ def parse_latex_math(node, string): elif c in "+*=<>,.!?`';@": node = node.append(mo(c)) else: - raise SyntaxError(u'Unsupported character: "%s"' % c) + raise SyntaxError('Unsupported character: "%s"' % c) return tree # Test: @@ -900,19 +900,19 @@ def handle_cmd(name, node, string): # noqa: C901 TODO make this less complex new_node = mi(functions[name]) # embellished function names: if name == 'varliminf': # \underline\lim - new_node = munder(new_node, mo(u'_')) + new_node = munder(new_node, mo('_')) elif name == 'varlimsup': # \overline\lim - new_node = mover(new_node, mo(u'¯'), accent=False) + new_node = mover(new_node, mo('¯'), accent=False) elif name == 'varprojlim': # \underleftarrow\lim - new_node = munder(new_node, mo(u'\u2190')) + new_node = munder(new_node, mo('\u2190')) elif name == 'varinjlim': # \underrightarrow\lim - new_node = munder(new_node, mo(u'\u2192')) + new_node = munder(new_node, mo('\u2192')) node = node.append(new_node) # add ApplyFunction when appropriate (not \sin^2(x), say) # cf. https://www.w3.org/TR/MathML3/chapter3.html#presm.mi if string and string[0] not in ('^', '_'): - node = node.append(mo(u'\u2061')) # ⁡ + node = node.append(mo('\u2061')) # ⁡ return node, string if name in math_alphabets: @@ -932,7 +932,7 @@ def handle_cmd(name, node, string): # noqa: C901 TODO make this less complex # mathvariant="double-struck" is ignored for Greek letters # (tested in Firefox 78). Use literal Unicode characters. arg = mathbb.get(arg, arg) - if arg.isalpha() or arg == u'\u2140': + if arg.isalpha() or arg == '\u2140': node = node.append(mi(arg, **attributes)) return node, remainder # Wrap in <style> @@ -976,7 +976,7 @@ def handle_cmd(name, node, string): # noqa: C901 TODO make this less complex try: delimiter = stretchables[delimiter.lstrip('\\')] except KeyError: - raise SyntaxError(u'Unsupported "\\%s" delimiter "%s"!' + raise SyntaxError('Unsupported "\\%s" delimiter "%s"!' % (name, delimiter)) if size: delimiter_attributes['maxsize'] = size @@ -1000,8 +1000,8 @@ def handle_cmd(name, node, string): # noqa: C901 TODO make this less complex try: arg = operators[arg[1:]] except KeyError: - raise SyntaxError(u'\\not: Cannot negate: "%s"!'%arg) - arg = unicodedata.normalize('NFC', arg+u'\u0338') + raise SyntaxError('\\not: Cannot negate: "%s"!'%arg) + arg = unicodedata.normalize('NFC', arg+'\u0338') node = node.append(mo(arg)) return node, string @@ -1011,7 +1011,7 @@ def handle_cmd(name, node, string): # noqa: C901 TODO make this less complex parts = arg.split('$') # extract inline math for i, part in enumerate(parts): if i % 2 == 0: # i is even - part = re.sub('(^ | $)', u'\u00a0', part) + part = re.sub('(^ | $)', '\u00a0', part) node = node.append(mtext(part)) else: parse_latex_math(node, part) @@ -1136,8 +1136,8 @@ def handle_cmd(name, node, string): # noqa: C901 TODO make this less complex elif node.__class__.__name__ == 'math': node.append(new_node) else: - raise SyntaxError(u'Declaration "\\%s" must be first command ' - u'in a group.' % name) + raise SyntaxError('Declaration "\\%s" must be first command ' + 'in a group.' % name) return new_node, string if name.endswith('limits'): @@ -1155,7 +1155,7 @@ def handle_cmd(name, node, string): # noqa: C901 TODO make this less complex if name == 'end': return end_environment(node, string) - raise SyntaxError(u'Unknown LaTeX command: ' + name) + raise SyntaxError('Unknown LaTeX command: ' + name) # >>> handle_cmd('left', math(), '[a\\right]') # (mrow(mo('[')), 'a\\right]') @@ -1249,7 +1249,7 @@ def begin_environment(node, string): node.append(mtable(mtr(entry), **attributes)) node = entry else: - raise SyntaxError(u'Environment not supported!') + raise SyntaxError('Environment not supported!') return node, string @@ -1264,7 +1264,7 @@ def end_environment(node, string): elif name == 'cases': node = node.close() else: - raise SyntaxError(u'Environment not supported!') + raise SyntaxError('Environment not supported!') return node, string diff --git a/docutils/docutils/utils/math/math2html.py b/docutils/docutils/utils/math/math2html.py index 6f9eb0f5f..c59de617c 100755 --- a/docutils/docutils/utils/math/math2html.py +++ b/docutils/docutils/utils/math/math2html.py @@ -29,7 +29,7 @@ from docutils.utils.math import tex2unichar -__version__ = u'1.3 (2021-06-02)' +__version__ = '1.3 (2021-06-02)' class Trace(object): @@ -82,24 +82,24 @@ class ContainerConfig(object): "Configuration class from elyxer.config file" extracttext = { - u'allowed': [u'FormulaConstant',], - u'extracted': [ - u'AlphaCommand', - u'Bracket', - u'BracketCommand', - u'CombiningFunction', - u'EmptyCommand', - u'FontFunction', - u'Formula', - u'FormulaNumber', - u'FormulaSymbol', - u'OneParamFunction', - u'OversetFunction', - u'RawText', - u'SpacedCommand', - u'SymbolFunction', - u'TextFunction', - u'UndersetFunction', + 'allowed': ['FormulaConstant',], + 'extracted': [ + 'AlphaCommand', + 'Bracket', + 'BracketCommand', + 'CombiningFunction', + 'EmptyCommand', + 'FontFunction', + 'Formula', + 'FormulaNumber', + 'FormulaSymbol', + 'OneParamFunction', + 'OversetFunction', + 'RawText', + 'SpacedCommand', + 'SymbolFunction', + 'TextFunction', + 'UndersetFunction', ], } @@ -108,15 +108,15 @@ class EscapeConfig(object): "Configuration class from elyxer.config file" chars = { - u'\n': u'', - "'": u'’', - u'`': u'‘', + '\n': '', + "'": '’', + '`': '‘', } entities = { - u'&': u'&', - u'<': u'<', - u'>': u'>', + '&': '&', + '<': '<', + '>': '>', } @@ -124,158 +124,158 @@ class FormulaConfig(object): "Configuration class from elyxer.config file" alphacommands = { - '\\AmS': u'<span class="textsc">AmS</span>', - '\\AA': u'Å', - '\\AE': u'Æ', - '\\DH': u'Ð', - '\\L': u'Ł', - '\\O': u'Ø', - '\\OE': u'Œ', - '\\TH': u'Þ', - '\\aa': u'å', - '\\ae': u'æ', - '\\dh': u'ð', - '\\i': u'ı', - '\\j': u'ȷ', - '\\l': u'ł', - '\\o': u'ø', - '\\oe': u'œ', - '\\ss': u'ß', - '\\th': u'þ', + '\\AmS': '<span class="textsc">AmS</span>', + '\\AA': 'Å', + '\\AE': 'Æ', + '\\DH': 'Ð', + '\\L': 'Ł', + '\\O': 'Ø', + '\\OE': 'Œ', + '\\TH': 'Þ', + '\\aa': 'å', + '\\ae': 'æ', + '\\dh': 'ð', + '\\i': 'ı', + '\\j': 'ȷ', + '\\l': 'ł', + '\\o': 'ø', + '\\oe': 'œ', + '\\ss': 'ß', + '\\th': 'þ', } for key, value in tex2unichar.mathalpha.items(): alphacommands['\\'+key] = value array = { - u'begin': u'\\begin', - u'cellseparator': u'&', - u'end': u'\\end', - u'rowseparator': u'\\\\', + 'begin': '\\begin', + 'cellseparator': '&', + 'end': '\\end', + 'rowseparator': '\\\\', } - bigbrackets = {u'(': [u'⎛', u'⎜', u'⎝',], - u')': [u'⎞', u'⎟', u'⎠',], - u'[': [u'⎡', u'⎢', u'⎣',], - u']': [u'⎤', u'⎥', u'⎦',], - u'{': [u'⎧', u'⎪', u'⎨', u'⎩',], - u'}': [u'⎫', u'⎪', u'⎬', u'⎭',], + bigbrackets = {'(': ['⎛', '⎜', '⎝',], + ')': ['⎞', '⎟', '⎠',], + '[': ['⎡', '⎢', '⎣',], + ']': ['⎤', '⎥', '⎦',], + '{': ['⎧', '⎪', '⎨', '⎩',], + '}': ['⎫', '⎪', '⎬', '⎭',], # TODO: 2-row brackets with ⎰⎱ (\lmoustache \rmoustache) - u'|': [u'|',], # 007C VERTICAL LINE - # u'|': [u'⎮',], # 23AE INTEGRAL EXTENSION - # u'|': [u'⎪',], # 23AA CURLY BRACKET EXTENSION - u'‖': [u'‖'], # 2016 DOUBLE VERTICAL LINE - # u'∥': [u'∥'], # 2225 PARALLEL TO + '|': ['|',], # 007C VERTICAL LINE + # '|': ['⎮',], # 23AE INTEGRAL EXTENSION + # '|': ['⎪',], # 23AA CURLY BRACKET EXTENSION + '‖': ['‖'], # 2016 DOUBLE VERTICAL LINE + # '∥': ['∥'], # 2225 PARALLEL TO } bracketcommands = { - u'\\left': u'span class="stretchy"', - u'\\left.': u'<span class="leftdot"></span>', - u'\\middle': u'span class="stretchy"', - u'\\right': u'span class="stretchy"', - u'\\right.': u'<span class="rightdot"></span>', + '\\left': 'span class="stretchy"', + '\\left.': '<span class="leftdot"></span>', + '\\middle': 'span class="stretchy"', + '\\right': 'span class="stretchy"', + '\\right.': '<span class="rightdot"></span>', } combiningfunctions = { - "\\'": u'́', - u'\\"': u'̈', - u'\\^': u'̂', - u'\\`': u'̀', - u'\\~': u'̃', - u'\\c': u'̧', - u'\\r': u'̊', - u'\\s': u'̩', - u'\\textcircled': u'⃝', - u'\\textsubring': u'̥', - u'\\v': u'̌', + "\\'": '́', + '\\"': '̈', + '\\^': '̂', + '\\`': '̀', + '\\~': '̃', + '\\c': '̧', + '\\r': '̊', + '\\s': '̩', + '\\textcircled': '⃝', + '\\textsubring': '̥', + '\\v': '̌', } for key, value in tex2unichar.mathaccent.items(): combiningfunctions['\\'+key] = value commands = { - '\\\\': u'<br/>', - '\\\n': u' ', # escaped whitespace - '\\\t': u' ', # escaped whitespace - '\\centerdot': u'\u2B1D', # BLACK VERY SMALL SQUARE, mathbin - '\\colon': u': ', - '\\copyright': u'©', - '\\dotminus': u'∸', - '\\dots': u'…', - '\\dotsb': u'⋯', - '\\dotsc': u'…', - '\\dotsi': u'⋯', - '\\dotsm': u'⋯', - '\\dotso': u'…', - '\\euro': u'€', - '\\guillemotleft': u'«', - '\\guillemotright': u'»', - '\\hbar': u'<i>\u0127</i>', # ħ LATIN SMALL LETTER H WITH STROKE - '\\lVert': u'‖', - '\\Arrowvert': u'\u2016', # ‖ - '\\lvert': u'|', - '\\newline': u'<br/>', - '\\nobreakspace': u' ', - '\\nolimits': u'', - '\\nonumber': u'', - '\\qquad': u'  ', - '\\rVert': u'‖', - '\\rvert': u'|', - '\\textasciicircum': u'^', - '\\textasciitilde': u'~', - '\\textbackslash': u'\\', - '\\textcopyright': u'©', - '\\textdegree': u'°', - '\\textellipsis': u'…', - '\\textemdash': u'—', - '\\textendash': u'—', - '\\texteuro': u'€', - '\\textgreater': u'>', - '\\textless': u'<', - '\\textordfeminine': u'ª', - '\\textordmasculine': u'º', - '\\textquotedblleft': u'“', - '\\textquotedblright': u'”', - '\\textquoteright': u'’', - '\\textregistered': u'®', - '\\textrightarrow': u'→', - '\\textsection': u'§', - '\\texttrademark': u'™', - '\\texttwosuperior': u'²', - '\\textvisiblespace': u' ', - '\\thickspace': u'<span class="thickspace"> </span>', # 5/13 em - '\\;': u'<span class="thickspace"> </span>', # 5/13 em - '\\triangle': u'\u25B3', # WHITE UP-POINTING TRIANGLE, mathord - '\\triangledown': u'\u25BD', # WHITE DOWN-POINTING TRIANGLE, mathord - '\\varnothing': u'\u2300', # ⌀ DIAMETER SIGN + '\\\\': '<br/>', + '\\\n': ' ', # escaped whitespace + '\\\t': ' ', # escaped whitespace + '\\centerdot': '\u2B1D', # BLACK VERY SMALL SQUARE, mathbin + '\\colon': ': ', + '\\copyright': '©', + '\\dotminus': '∸', + '\\dots': '…', + '\\dotsb': '⋯', + '\\dotsc': '…', + '\\dotsi': '⋯', + '\\dotsm': '⋯', + '\\dotso': '…', + '\\euro': '€', + '\\guillemotleft': '«', + '\\guillemotright': '»', + '\\hbar': '<i>\u0127</i>', # ħ LATIN SMALL LETTER H WITH STROKE + '\\lVert': '‖', + '\\Arrowvert': '\u2016', # ‖ + '\\lvert': '|', + '\\newline': '<br/>', + '\\nobreakspace': ' ', + '\\nolimits': '', + '\\nonumber': '', + '\\qquad': '  ', + '\\rVert': '‖', + '\\rvert': '|', + '\\textasciicircum': '^', + '\\textasciitilde': '~', + '\\textbackslash': '\\', + '\\textcopyright': '©', + '\\textdegree': '°', + '\\textellipsis': '…', + '\\textemdash': '—', + '\\textendash': '—', + '\\texteuro': '€', + '\\textgreater': '>', + '\\textless': '<', + '\\textordfeminine': 'ª', + '\\textordmasculine': 'º', + '\\textquotedblleft': '“', + '\\textquotedblright': '”', + '\\textquoteright': '’', + '\\textregistered': '®', + '\\textrightarrow': '→', + '\\textsection': '§', + '\\texttrademark': '™', + '\\texttwosuperior': '²', + '\\textvisiblespace': ' ', + '\\thickspace': '<span class="thickspace"> </span>', # 5/13 em + '\\;': '<span class="thickspace"> </span>', # 5/13 em + '\\triangle': '\u25B3', # WHITE UP-POINTING TRIANGLE, mathord + '\\triangledown': '\u25BD', # WHITE DOWN-POINTING TRIANGLE, mathord + '\\varnothing': '\u2300', # ⌀ DIAMETER SIGN # functions - '\\Pr': u'Pr', - '\\arccos': u'arccos', - '\\arcsin': u'arcsin', - '\\arctan': u'arctan', - '\\arg': u'arg', - '\\cos': u'cos', - '\\cosh': u'cosh', - '\\cot': u'cot', - '\\coth': u'coth', - '\\csc': u'csc', - '\\deg': u'deg', - '\\det': u'det', - '\\dim': u'dim', - '\\exp': u'exp', - '\\gcd': u'gcd', - '\\hom': u'hom', - '\\injlim': u'inj lim', - '\\ker': u'ker', - '\\lg': u'lg', - '\\liminf': u'lim inf', - '\\limsup': u'lim sup', - '\\ln': u'ln', - '\\log': u'log', - '\\projlim': u'proj lim', - '\\sec': u'sec', - '\\sin': u'sin', - '\\sinh': u'sinh', - '\\tan': u'tan', - '\\tanh': u'tanh', + '\\Pr': 'Pr', + '\\arccos': 'arccos', + '\\arcsin': 'arcsin', + '\\arctan': 'arctan', + '\\arg': 'arg', + '\\cos': 'cos', + '\\cosh': 'cosh', + '\\cot': 'cot', + '\\coth': 'coth', + '\\csc': 'csc', + '\\deg': 'deg', + '\\det': 'det', + '\\dim': 'dim', + '\\exp': 'exp', + '\\gcd': 'gcd', + '\\hom': 'hom', + '\\injlim': 'inj lim', + '\\ker': 'ker', + '\\lg': 'lg', + '\\liminf': 'lim inf', + '\\limsup': 'lim sup', + '\\ln': 'ln', + '\\log': 'log', + '\\projlim': 'proj lim', + '\\sec': 'sec', + '\\sin': 'sin', + '\\sinh': 'sinh', + '\\tan': 'tan', + '\\tanh': 'tanh', } cmddict = {} cmddict.update(tex2unichar.mathbin) # TODO: spacing around binary operators @@ -289,180 +289,180 @@ class FormulaConfig(object): oversetfunctions = { # math accents (cf. combiningfunctions) - # '\\acute': u'´', - '\\bar': u'‒', # FIGURE DASH - # '\\breve': u'˘', - # '\\check': u'ˇ', - '\\dddot': u'<span class="smallsymbol">⋯</span>', - # '\\ddot': u'··', # ¨ too high - # '\\dot': u'·', - # '\\grave': u'`', - # '\\hat': u'^', - # '\\mathring': u'˚', - # '\\tilde': u'~', - '\\vec': u'<span class="smallsymbol">→</span>', + # '\\acute': '´', + '\\bar': '‒', # FIGURE DASH + # '\\breve': '˘', + # '\\check': 'ˇ', + '\\dddot': '<span class="smallsymbol">⋯</span>', + # '\\ddot': '··', # ¨ too high + # '\\dot': '·', + # '\\grave': '`', + # '\\hat': '^', + # '\\mathring': '˚', + # '\\tilde': '~', + '\\vec': '<span class="smallsymbol">→</span>', # embellishments - '\\overleftarrow': u'⟵', - '\\overleftrightarrow': u'⟷', - '\\overrightarrow': u'⟶', - '\\widehat': u'^', - '\\widetilde': u'~', + '\\overleftarrow': '⟵', + '\\overleftrightarrow': '⟷', + '\\overrightarrow': '⟶', + '\\widehat': '^', + '\\widetilde': '~', } undersetfunctions = { - '\\underleftarrow': u'⟵', - '\\underleftrightarrow': u'⟷', - '\\underrightarrow': u'⟶', + '\\underleftarrow': '⟵', + '\\underleftrightarrow': '⟷', + '\\underrightarrow': '⟶', } endings = { - u'bracket': u'}', - u'complex': u'\\]', - u'endafter': u'}', - u'endbefore': u'\\end{', - u'squarebracket': u']', + 'bracket': '}', + 'complex': '\\]', + 'endafter': '}', + 'endbefore': '\\end{', + 'squarebracket': ']', } environments = { - u'align': [u'r', u'l',], - u'eqnarray': [u'r', u'c', u'l',], - u'gathered': [u'l', u'l',], - u'smallmatrix': [u'c', u'c',], + 'align': ['r', 'l',], + 'eqnarray': ['r', 'c', 'l',], + 'gathered': ['l', 'l',], + 'smallmatrix': ['c', 'c',], } fontfunctions = { - u'\\boldsymbol': u'b', u'\\mathbb': u'span class="blackboard"', - u'\\mathbb{A}': u'𝔸', u'\\mathbb{B}': u'𝔹', u'\\mathbb{C}': u'ℂ', - u'\\mathbb{D}': u'𝔻', u'\\mathbb{E}': u'𝔼', u'\\mathbb{F}': u'𝔽', - u'\\mathbb{G}': u'𝔾', u'\\mathbb{H}': u'ℍ', u'\\mathbb{J}': u'𝕁', - u'\\mathbb{K}': u'𝕂', u'\\mathbb{L}': u'𝕃', u'\\mathbb{N}': u'ℕ', - u'\\mathbb{O}': u'𝕆', u'\\mathbb{P}': u'ℙ', u'\\mathbb{Q}': u'ℚ', - u'\\mathbb{R}': u'ℝ', u'\\mathbb{S}': u'𝕊', u'\\mathbb{T}': u'𝕋', - u'\\mathbb{W}': u'𝕎', u'\\mathbb{Z}': u'ℤ', u'\\mathbf': u'b', - u'\\mathcal': u'span class="scriptfont"', - u'\\mathcal{B}': u'ℬ', u'\\mathcal{E}': u'ℰ', u'\\mathcal{F}': - u'ℱ', u'\\mathcal{H}': u'ℋ', u'\\mathcal{I}': u'ℐ', - u'\\mathcal{L}': u'ℒ', u'\\mathcal{M}': u'ℳ', u'\\mathcal{R}': u'ℛ', - u'\\mathfrak': u'span class="fraktur"', - u'\\mathfrak{C}': u'ℭ', u'\\mathfrak{F}': u'𝔉', u'\\mathfrak{H}': u'ℌ', - u'\\mathfrak{I}': u'ℑ', u'\\mathfrak{R}': u'ℜ', u'\\mathfrak{Z}': u'ℨ', - u'\\mathit': u'i', - u'\\mathring{A}': u'Å', u'\\mathring{U}': u'Ů', - u'\\mathring{a}': u'å', u'\\mathring{u}': u'ů', u'\\mathring{w}': u'ẘ', - u'\\mathring{y}': u'ẙ', - u'\\mathrm': u'span class="mathrm"', - u'\\mathscr': u'span class="mathscr"', - u'\\mathscr{B}': u'ℬ', u'\\mathscr{E}': u'ℰ', u'\\mathscr{F}': u'ℱ', - u'\\mathscr{H}': u'ℋ', u'\\mathscr{I}': u'ℐ', u'\\mathscr{L}': u'ℒ', - u'\\mathscr{M}': u'ℳ', u'\\mathscr{R}': u'ℛ', - u'\\mathsf': u'span class="mathsf"', - u'\\mathtt': u'span class="mathtt"', - u'\\operatorname': u'span class="mathrm"', + '\\boldsymbol': 'b', '\\mathbb': 'span class="blackboard"', + '\\mathbb{A}': '𝔸', '\\mathbb{B}': '𝔹', '\\mathbb{C}': 'ℂ', + '\\mathbb{D}': '𝔻', '\\mathbb{E}': '𝔼', '\\mathbb{F}': '𝔽', + '\\mathbb{G}': '𝔾', '\\mathbb{H}': 'ℍ', '\\mathbb{J}': '𝕁', + '\\mathbb{K}': '𝕂', '\\mathbb{L}': '𝕃', '\\mathbb{N}': 'ℕ', + '\\mathbb{O}': '𝕆', '\\mathbb{P}': 'ℙ', '\\mathbb{Q}': 'ℚ', + '\\mathbb{R}': 'ℝ', '\\mathbb{S}': '𝕊', '\\mathbb{T}': '𝕋', + '\\mathbb{W}': '𝕎', '\\mathbb{Z}': 'ℤ', '\\mathbf': 'b', + '\\mathcal': 'span class="scriptfont"', + '\\mathcal{B}': 'ℬ', '\\mathcal{E}': 'ℰ', '\\mathcal{F}': + 'ℱ', '\\mathcal{H}': 'ℋ', '\\mathcal{I}': 'ℐ', + '\\mathcal{L}': 'ℒ', '\\mathcal{M}': 'ℳ', '\\mathcal{R}': 'ℛ', + '\\mathfrak': 'span class="fraktur"', + '\\mathfrak{C}': 'ℭ', '\\mathfrak{F}': '𝔉', '\\mathfrak{H}': 'ℌ', + '\\mathfrak{I}': 'ℑ', '\\mathfrak{R}': 'ℜ', '\\mathfrak{Z}': 'ℨ', + '\\mathit': 'i', + '\\mathring{A}': 'Å', '\\mathring{U}': 'Ů', + '\\mathring{a}': 'å', '\\mathring{u}': 'ů', '\\mathring{w}': 'ẘ', + '\\mathring{y}': 'ẙ', + '\\mathrm': 'span class="mathrm"', + '\\mathscr': 'span class="mathscr"', + '\\mathscr{B}': 'ℬ', '\\mathscr{E}': 'ℰ', '\\mathscr{F}': 'ℱ', + '\\mathscr{H}': 'ℋ', '\\mathscr{I}': 'ℐ', '\\mathscr{L}': 'ℒ', + '\\mathscr{M}': 'ℳ', '\\mathscr{R}': 'ℛ', + '\\mathsf': 'span class="mathsf"', + '\\mathtt': 'span class="mathtt"', + '\\operatorname': 'span class="mathrm"', } hybridfunctions = { - u'\\addcontentsline': [u'{$p!}{$q!}{$r!}', u'f0{}', u'ignored',], - u'\\addtocontents': [u'{$p!}{$q!}', u'f0{}', u'ignored',], - u'\\backmatter': [u'', u'f0{}', u'ignored',], - u'\\binom': [u'{$1}{$2}', u'f2{(}f0{f1{$1}f1{$2}}f2{)}', u'span class="binom"', u'span class="binomstack"', u'span class="bigdelimiter size2"',], - u'\\boxed': [u'{$1}', u'f0{$1}', u'span class="boxed"',], - u'\\cfrac': [u'[$p!]{$1}{$2}', u'f0{f3{(}f1{$1}f3{)/(}f2{$2}f3{)}}', u'span class="fullfraction"', u'span class="numerator align-$p"', u'span class="denominator"', u'span class="ignored"',], - u'\\color': [u'{$p!}{$1}', u'f0{$1}', u'span style="color: $p;"',], - u'\\colorbox': [u'{$p!}{$1}', u'f0{$1}', u'span class="colorbox" style="background: $p;"',], - u'\\dbinom': [u'{$1}{$2}', u'(f0{f1{f2{$1}}f1{f2{ }}f1{f2{$2}}})', u'span class="binomial"', u'span class="binomrow"', u'span class="binomcell"',], - u'\\dfrac': [u'{$1}{$2}', u'f0{f3{(}f1{$1}f3{)/(}f2{$2}f3{)}}', u'span class="fullfraction"', u'span class="numerator"', u'span class="denominator"', u'span class="ignored"',], - u'\\displaystyle': [u'{$1}', u'f0{$1}', u'span class="displaystyle"',], - u'\\fancyfoot': [u'[$p!]{$q!}', u'f0{}', u'ignored',], - u'\\fancyhead': [u'[$p!]{$q!}', u'f0{}', u'ignored',], - u'\\fbox': [u'{$1}', u'f0{$1}', u'span class="fbox"',], - u'\\fboxrule': [u'{$p!}', u'f0{}', u'ignored',], - u'\\fboxsep': [u'{$p!}', u'f0{}', u'ignored',], - u'\\fcolorbox': [u'{$p!}{$q!}{$1}', u'f0{$1}', u'span class="boxed" style="border-color: $p; background: $q;"',], - u'\\frac': [u'{$1}{$2}', u'f0{f3{(}f1{$1}f3{)/(}f2{$2}f3{)}}', u'span class="fraction"', u'span class="numerator"', u'span class="denominator"', u'span class="ignored"',], - u'\\framebox': [u'[$p!][$q!]{$1}', u'f0{$1}', u'span class="framebox align-$q" style="width: $p;"',], - u'\\frontmatter': [u'', u'f0{}', u'ignored',], - u'\\href': [u'[$o]{$u!}{$t!}', u'f0{$t}', u'a href="$u"',], - u'\\hspace': [u'{$p!}', u'f0{ }', u'span class="hspace" style="width: $p;"',], - u'\\leftroot': [u'{$p!}', u'f0{ }', u'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"',], # TODO: convert 1 mu to 1/18 em - # u'\\mspace': [u'{$p!}', u'f0{ }', u'span class="hspace" style="width: $p;"',], - u'\\nicefrac': [u'{$1}{$2}', u'f0{f1{$1}⁄f2{$2}}', u'span class="fraction"', u'sup class="numerator"', u'sub class="denominator"', u'span class="ignored"',], - u'\\parbox': [u'[$p!]{$w!}{$1}', u'f0{1}', u'div class="Boxed" style="width: $w;"',], - u'\\raisebox': [u'{$p!}{$1}', u'f0{$1.font}', u'span class="raisebox" style="vertical-align: $p;"',], - u'\\renewenvironment': [u'{$1!}{$2!}{$3!}', u'',], - u'\\rule': [u'[$v!]{$w!}{$h!}', u'f0/', u'hr class="line" style="width: $w; height: $h;"',], - u'\\scriptscriptstyle': [u'{$1}', u'f0{$1}', u'span class="scriptscriptstyle"',], - u'\\scriptstyle': [u'{$1}', u'f0{$1}', u'span class="scriptstyle"',], + # '\\mspace': ['{$p!}', 'f0{ }', 'span class="hspace" style="width: $p;"',], + '\\nicefrac': ['{$1}{$2}', 'f0{f1{$1}⁄f2{$2}}', 'span class="fraction"', 'sup class="numerator"', 'sub class="denominator"', 'span class="ignored"',], + '\\parbox': ['[$p!]{$w!}{$1}', 'f0{1}', 'div class="Boxed" style="width: $w;"',], + '\\raisebox': ['{$p!}{$1}', 'f0{$1.font}', 'span class="raisebox" style="vertical-align: $p;"',], + '\\renewenvironment': ['{$1!}{$2!}{$3!}', '',], + '\\rule': ['[$v!]{$w!}{$h!}', 'f0/', 'hr class="line" style="width: $w; height: $h;"',], + '\\scriptscriptstyle': ['{$1}', 'f0{$1}', 'span class="scriptscriptstyle"',], + '\\scriptstyle': ['{$1}', 'f0{$1}', 'span class="scriptstyle"',], # TODO: increase √-size with argument (\frac in display mode, ...) - u'\\sqrt': [u'[$0]{$1}', u'f0{f1{$0}f2{√}f4{(}f3{$1}f4{)}}', u'span class="sqrt"', u'sup class="root"', u'span class="radical"', u'span class="root"', u'span class="ignored"',], - u'\\stackrel': [u'{$1}{$2}', u'f0{f1{$1}f2{$2}}', u'span class="stackrel"', u'span class="upstackrel"', u'span class="downstackrel"',], - u'\\tbinom': [u'{$1}{$2}', u'(f0{f1{f2{$1}}f1{f2{ }}f1{f2{$2}}})', u'span class="binomial"', u'span class="binomrow"', u'span class="binomcell"',], - u'\\tfrac': [u'{$1}{$2}', u'f0{f3{(}f1{$1}f3{)/(}f2{$2}f3{)}}', u'span class="textfraction"', u'span class="numerator"', u'span class="denominator"', u'span class="ignored"',], - u'\\textcolor': [u'{$p!}{$1}', u'f0{$1}', u'span style="color: $p;"',], - u'\\textstyle': [u'{$1}', u'f0{$1}', u'span class="textstyle"',], - u'\\thispagestyle': [u'{$p!}', u'f0{}', u'ignored',], - u'\\unit': [u'[$0]{$1}', u'$0f0{$1.font}', u'span class="unit"',], - u'\\unitfrac': [u'[$0]{$1}{$2}', u'$0f0{f1{$1.font}⁄f2{$2.font}}', u'span class="fraction"', u'sup class="unit"', u'sub class="unit"',], - u'\\uproot': [u'{$p!}', u'f0{ }', u'span class="uproot" style="width: $p;px"',], - u'\\url': [u'{$u!}', u'f0{$u}', u'a href="$u"',], - u'\\vspace': [u'{$p!}', u'f0{ }', u'span class="vspace" style="height: $p;"',], + '\\sqrt': ['[$0]{$1}', 'f0{f1{$0}f2{√}f4{(}f3{$1}f4{)}}', 'span class="sqrt"', 'sup class="root"', 'span class="radical"', 'span class="root"', 'span class="ignored"',], + '\\stackrel': ['{$1}{$2}', 'f0{f1{$1}f2{$2}}', 'span class="stackrel"', 'span class="upstackrel"', 'span class="downstackrel"',], + '\\tbinom': ['{$1}{$2}', '(f0{f1{f2{$1}}f1{f2{ }}f1{f2{$2}}})', 'span class="binomial"', 'span class="binomrow"', 'span class="binomcell"',], + '\\tfrac': ['{$1}{$2}', 'f0{f3{(}f1{$1}f3{)/(}f2{$2}f3{)}}', 'span class="textfraction"', 'span class="numerator"', 'span class="denominator"', 'span class="ignored"',], + '\\textcolor': ['{$p!}{$1}', 'f0{$1}', 'span style="color: $p;"',], + '\\textstyle': ['{$1}', 'f0{$1}', 'span class="textstyle"',], + '\\thispagestyle': ['{$p!}', 'f0{}', 'ignored',], + '\\unit': ['[$0]{$1}', '$0f0{$1.font}', 'span class="unit"',], + '\\unitfrac': ['[$0]{$1}{$2}', '$0f0{f1{$1.font}⁄f2{$2.font}}', 'span class="fraction"', 'sup class="unit"', 'sub class="unit"',], + '\\uproot': ['{$p!}', 'f0{ }', 'span class="uproot" style="width: $p;px"',], + '\\url': ['{$u!}', 'f0{$u}', 'a href="$u"',], + '\\vspace': ['{$p!}', 'f0{ }', 'span class="vspace" style="height: $p;"',], } hybridsizes = { - u'\\binom': u'$1+$2', u'\\cfrac': u'$1+$2', u'\\dbinom': u'$1+$2+1', - u'\\dfrac': u'$1+$2', u'\\frac': u'$1+$2', u'\\tbinom': u'$1+$2+1', + '\\binom': '$1+$2', '\\cfrac': '$1+$2', '\\dbinom': '$1+$2+1', + '\\dfrac': '$1+$2', '\\frac': '$1+$2', '\\tbinom': '$1+$2+1', } labelfunctions = { - '\\label': u'a name="#"', + '\\label': 'a name="#"', } limitcommands = { - '\\biginterleave': u'⫼', - '\\inf': u'inf', - '\\lim': u'lim', - '\\max': u'max', - '\\min': u'min', - '\\sup': u'sup', - '\\ointop': u'<span class="bigoperator integral">∮</span>', - '\\bigcap': u'<span class="bigoperator">⋂</span>', - '\\bigcup': u'<span class="bigoperator">⋃</span>', - '\\bigodot': u'<span class="bigoperator">⨀</span>', - '\\bigoplus': u'<span class="bigoperator">⨁</span>', - '\\bigotimes': u'<span class="bigoperator">⨂</span>', - '\\bigsqcap': u'<span class="bigoperator">⨅</span>', - '\\bigsqcup': u'<span class="bigoperator">⨆</span>', - '\\biguplus': u'<span class="bigoperator">⨄</span>', - '\\bigvee': u'<span class="bigoperator">⋁</span>', - '\\bigwedge': u'<span class="bigoperator">⋀</span>', - '\\coprod': u'<span class="bigoperator">∐</span>', - '\\intop': u'<span class="bigoperator integral">∫</span>', - '\\prod': u'<span class="bigoperator">∏</span>', - '\\sum': u'<span class="bigoperator">∑</span>', - '\\varprod': u'<span class="bigoperator">⨉</span>', - '\\zcmp': u'⨟', '\\zhide': u'⧹', '\\zpipe': u'⨠', '\\zproject': u'⨡', + '\\biginterleave': '⫼', + '\\inf': 'inf', + '\\lim': 'lim', + '\\max': 'max', + '\\min': 'min', + '\\sup': 'sup', + '\\ointop': '<span class="bigoperator integral">∮</span>', + '\\bigcap': '<span class="bigoperator">⋂</span>', + '\\bigcup': '<span class="bigoperator">⋃</span>', + '\\bigodot': '<span class="bigoperator">⨀</span>', + '\\bigoplus': '<span class="bigoperator">⨁</span>', + '\\bigotimes': '<span class="bigoperator">⨂</span>', + '\\bigsqcap': '<span class="bigoperator">⨅</span>', + '\\bigsqcup': '<span class="bigoperator">⨆</span>', + '\\biguplus': '<span class="bigoperator">⨄</span>', + '\\bigvee': '<span class="bigoperator">⋁</span>', + '\\bigwedge': '<span class="bigoperator">⋀</span>', + '\\coprod': '<span class="bigoperator">∐</span>', + '\\intop': '<span class="bigoperator integral">∫</span>', + '\\prod': '<span class="bigoperator">∏</span>', + '\\sum': '<span class="bigoperator">∑</span>', + '\\varprod': '<span class="bigoperator">⨉</span>', + '\\zcmp': '⨟', '\\zhide': '⧹', '\\zpipe': '⨠', '\\zproject': '⨡', # integrals have limits in index position with LaTeX default settings # TODO: move to commands? - '\\int': u'<span class="bigoperator integral">∫</span>', - '\\iint': u'<span class="bigoperator integral">∬</span>', - '\\iiint': u'<span class="bigoperator integral">∭</span>', - '\\iiiint': u'<span class="bigoperator integral">⨌</span>', - '\\fint': u'<span class="bigoperator integral">⨏</span>', - '\\idotsint': u'<span class="bigoperator integral">∫⋯∫</span>', - '\\oint': u'<span class="bigoperator integral">∮</span>', - '\\oiint': u'<span class="bigoperator integral">∯</span>', - '\\oiiint': u'<span class="bigoperator integral">∰</span>', - '\\ointclockwise': u'<span class="bigoperator integral">∲</span>', - '\\ointctrclockwise': u'<span class="bigoperator integral">∳</span>', - '\\smallint': u'<span class="smallsymbol integral">∫</span>', - '\\sqint': u'<span class="bigoperator integral">⨖</span>', - '\\varointclockwise': u'<span class="bigoperator integral">∲</span>', + '\\int': '<span class="bigoperator integral">∫</span>', + '\\iint': '<span class="bigoperator integral">∬</span>', + '\\iiint': '<span class="bigoperator integral">∭</span>', + '\\iiiint': '<span class="bigoperator integral">⨌</span>', + '\\fint': '<span class="bigoperator integral">⨏</span>', + '\\idotsint': '<span class="bigoperator integral">∫⋯∫</span>', + '\\oint': '<span class="bigoperator integral">∮</span>', + '\\oiint': '<span class="bigoperator integral">∯</span>', + '\\oiiint': '<span class="bigoperator integral">∰</span>', + '\\ointclockwise': '<span class="bigoperator integral">∲</span>', + '\\ointctrclockwise': '<span class="bigoperator integral">∳</span>', + '\\smallint': '<span class="smallsymbol integral">∫</span>', + '\\sqint': '<span class="bigoperator integral">⨖</span>', + '\\varointclockwise': '<span class="bigoperator integral">∲</span>', } modified = { - u'\n': u'', u' ': u'', u'$': u'', u'&': u' ', u'\'': u'’', u'+': u'\u2009+\u2009', - u',': u',\u2009', u'-': u'\u2009−\u2009', u'/': u'\u2009⁄\u2009', u':': u' : ', u'<': u'\u2009<\u2009', - u'=': u'\u2009=\u2009', u'>': u'\u2009>\u2009', u'@': u'', u'~': u'\u00a0', + '\n': '', ' ': '', '$': '', '&': ' ', '\'': '’', '+': '\u2009+\u2009', + ',': ',\u2009', '-': '\u2009−\u2009', '/': '\u2009⁄\u2009', ':': ' : ', '<': '\u2009<\u2009', + '=': '\u2009=\u2009', '>': '\u2009>\u2009', '@': '', '~': '\u00a0', } onefunctions = { @@ -495,53 +495,53 @@ class FormulaConfig(object): # relations (put additional space before and after the symbol) spacedcommands = { # negated symbols without pre-composed Unicode character - '\\nleqq': u'\u2266\u0338', # ≦̸ - '\\ngeqq': u'\u2267\u0338', # ≧̸ - '\\nleqslant': u'\u2a7d\u0338', # ⩽̸ - '\\ngeqslant': u'\u2a7e\u0338', # ⩾̸ - '\\nsubseteqq': u'\u2AC5\u0338', # ⫅̸ - '\\nsupseteqq': u'\u2AC6\u0338', # ⫆̸ - '\\nsqsubset': u'\u2276\u228F', # ⊏̸ + '\\nleqq': '\u2266\u0338', # ≦̸ + '\\ngeqq': '\u2267\u0338', # ≧̸ + '\\nleqslant': '\u2a7d\u0338', # ⩽̸ + '\\ngeqslant': '\u2a7e\u0338', # ⩾̸ + '\\nsubseteqq': '\u2AC5\u0338', # ⫅̸ + '\\nsupseteqq': '\u2AC6\u0338', # ⫆̸ + '\\nsqsubset': '\u2276\u228F', # ⊏̸ # modified glyphs - '\\shortmid': u'<span class="smallsymbol">∣</span>', - '\\shortparallel': u'<span class="smallsymbol">∥</span>', - '\\nshortmid': u'<span class="smallsymbol">∤</span>', - '\\nshortparallel': u'<span class="smallsymbol">∦</span>', - '\\smallfrown': u'<span class="smallsymbol">⌢</span>', - '\\smallsmile': u'<span class="smallsymbol">⌣</span>', - '\\thickapprox': u'<span class="boldsymbol">≈</span>', - '\\thicksim': u'<span class="boldsymbol">∼</span>', - '\\varpropto': u'<span class="mathsf">\u221d</span>', # ∝ PROPORTIONAL TO + '\\shortmid': '<span class="smallsymbol">∣</span>', + '\\shortparallel': '<span class="smallsymbol">∥</span>', + '\\nshortmid': '<span class="smallsymbol">∤</span>', + '\\nshortparallel': '<span class="smallsymbol">∦</span>', + '\\smallfrown': '<span class="smallsymbol">⌢</span>', + '\\smallsmile': '<span class="smallsymbol">⌣</span>', + '\\thickapprox': '<span class="boldsymbol">≈</span>', + '\\thicksim': '<span class="boldsymbol">∼</span>', + '\\varpropto': '<span class="mathsf">\u221d</span>', # ∝ PROPORTIONAL TO } for key, value in tex2unichar.mathrel.items(): spacedcommands['\\'+key] = value starts = { - u'beginafter': u'}', u'beginbefore': u'\\begin{', u'bracket': u'{', - u'command': u'\\', u'comment': u'%', u'complex': u'\\[', u'simple': u'$', - u'squarebracket': u'[', u'unnumbered': u'*', + 'beginafter': '}', 'beginbefore': '\\begin{', 'bracket': '{', + 'command': '\\', 'comment': '%', 'complex': '\\[', 'simple': '$', + 'squarebracket': '[', 'unnumbered': '*', } symbolfunctions = { - u'^': u'sup', u'_': u'sub', + '^': 'sup', '_': 'sub', } textfunctions = { - u'\\mbox': u'span class="mbox"', - u'\\text': u'span class="text"', - u'\\textbf': u'span class="textbf"', - u'\\textit': u'span class="textit"', - u'\\textnormal': u'span class="textnormal"', - u'\\textrm': u'span class="textrm"', - u'\\textsc': u'span class="textsc"', - u'\\textsf': u'span class="textsf"', - u'\\textsl': u'span class="textsl"', - u'\\texttt': u'span class="texttt"', - u'\\textup': u'span class="normal"', + '\\mbox': 'span class="mbox"', + '\\text': 'span class="text"', + '\\textbf': 'span class="textbf"', + '\\textit': 'span class="textit"', + '\\textnormal': 'span class="textnormal"', + '\\textrm': 'span class="textrm"', + '\\textsc': 'span class="textsc"', + '\\textsf': 'span class="textsf"', + '\\textsl': 'span class="textsl"', + '\\texttt': 'span class="texttt"', + '\\textup': 'span class="normal"', } unmodified = { - u'characters': [u'.', u'*', u'€', u'(', u')', u'[', u']', - u'·', u'!', u';', u'|', u'§', u'"', u'?'], + 'characters': ['.', '*', '€', '(', ')', '[', ']', + '·', '!', ';', '|', '§', '"', '?'], } @@ -1923,7 +1923,7 @@ def traversewhole(self, formula): if bit.type == 'alpha': self.italicize(bit, contents) elif bit.type == 'font' and last and last.type == 'number': - bit.contents.insert(0, FormulaConstant(u'\u2009')) + bit.contents.insert(0, FormulaConstant('\u2009')) last = bit def traverse(self, bit): @@ -2266,9 +2266,9 @@ class SpacedCommand(CommandBit): def parsebit(self, pos): "Place as contents the command translated and spaced." # pad with MEDIUM MATHEMATICAL SPACE (4/18 em): too wide in STIX fonts :( - # self.contents = [FormulaConstant(u'\u205f' + self.translated + u'\u205f')] + # self.contents = [FormulaConstant('\u205f' + self.translated + '\u205f')] # pad with THIN SPACE (1/5 em) - self.contents = [FormulaConstant(u'\u2009' + self.translated + u'\u2009')] + self.contents = [FormulaConstant('\u2009' + self.translated + '\u2009')] class AlphaCommand(EmptyCommand): """A command without parameters whose result is alphabetical.""" @@ -2501,7 +2501,7 @@ def addempty(self): row = self.factory.create(FormulaRow).setalignments(self.alignments) for index, originalcell in enumerate(self.rows[-1].contents): cell = row.createcell(index) - cell.add(FormulaConstant(u' ')) + cell.add(FormulaConstant(' ')) row.add(cell) self.addrow(row) @@ -2559,7 +2559,7 @@ def parsebit(self, pos): for row in self.contents: for cell in row.contents: cell.output.settag('span class="case align-l"', True) - cell.contents.append(FormulaConstant(u' ')) + cell.contents.append(FormulaConstant(' ')) array = TaggedBit().complete(self.contents, 'span class="bracketcases"', True) brace = BigBracket(len(self.contents), '{', 'l') self.contents = brace.getcontents() + [array] @@ -2635,7 +2635,7 @@ def parsebit(self, pos): return # Trace.message(' basechar: %r' % parameter.string) # Insert combining character after the first character: - if parameter.string.startswith(u'\u2009'): + if parameter.string.startswith('\u2009'): i = 2 # skip padding by SpacedCommand and FormulaConfig.modified else: i = 1 @@ -2742,7 +2742,7 @@ def modifylimits(self, contents, index): if self.checkscript(contents, index + 1): superscript = self.getlimit(contents, index + 1) else: - superscript = TaggedBit().constant(u'\u2009', 'sup class="limit"') + superscript = TaggedBit().constant('\u2009', 'sup class="limit"') # fix order if source is x^i if subscript.command == '^': superscript, subscript = subscript, superscript diff --git a/docutils/docutils/utils/math/tex2mathml_extern.py b/docutils/docutils/utils/math/tex2mathml_extern.py index 8fda1605b..ff55c0e2e 100644 --- a/docutils/docutils/utils/math/tex2mathml_extern.py +++ b/docutils/docutils/utils/math/tex2mathml_extern.py @@ -78,7 +78,7 @@ def ttm(math_code, reporter=None): """ p = subprocess.Popen(['ttm', # '-i', # italic font for equations. Default roman. - '-u', # unicode character encoding. (Default iso-8859-1). + '-', # unicode character encoding. (Default iso-8859-1). '-r', # output raw MathML (no preamble or postlude) ], stdin=subprocess.PIPE, @@ -141,8 +141,8 @@ def blahtexml(math_code, inline=True, reporter=None): # self-test if __name__ == "__main__": - example = (u'\\frac{\\partial \\sin^2(\\alpha)}{\\partial \\vec r}' - u'\\varpi \\, \\text{Grüße}') + example = ('\\frac{\\partial \\sin^2(\\alpha)}{\\partial \\vec r}' + '\\varpi \\, \\text{Grüße}') # print(latexml(example).encode('utf8')) # print(ttm(example)) print(blahtexml(example).encode('utf8')) diff --git a/docutils/docutils/utils/math/tex2unichar.py b/docutils/docutils/utils/math/tex2unichar.py index c33f51c8c..f266b8614 100644 --- a/docutils/docutils/utils/math/tex2unichar.py +++ b/docutils/docutils/utils/math/tex2unichar.py @@ -5,700 +5,700 @@ # Includes commands from: wasysym, stmaryrd, txfonts, mathdots, mathabx, esint, bbold, amsxtra, amsmath, amssymb, standard LaTeX mathaccent = { - 'acute': u'\u0301', #  ́ COMBINING ACUTE ACCENT - 'bar': u'\u0304', #  ̄ COMBINING MACRON - 'breve': u'\u0306', #  ̆ COMBINING BREVE - 'check': u'\u030c', #  ̌ COMBINING CARON - 'ddddot': u'\u20dc', #  ⃜ COMBINING FOUR DOTS ABOVE - 'dddot': u'\u20db', #  ⃛ COMBINING THREE DOTS ABOVE - 'ddot': u'\u0308', #  ̈ COMBINING DIAERESIS - 'dot': u'\u0307', #  ̇ COMBINING DOT ABOVE - 'grave': u'\u0300', #  ̀ COMBINING GRAVE ACCENT - 'hat': u'\u0302', #  ̂ COMBINING CIRCUMFLEX ACCENT - 'mathring': u'\u030a', #  ̊ COMBINING RING ABOVE - 'not': u'\u0338', #  ̸ COMBINING LONG SOLIDUS OVERLAY - 'overleftrightarrow': u'\u20e1', #  ⃡ COMBINING LEFT RIGHT ARROW ABOVE - 'overline': u'\u0305', #  ̅ COMBINING OVERLINE - 'tilde': u'\u0303', #  ̃ COMBINING TILDE - 'underbar': u'\u0331', #  ̱ COMBINING MACRON BELOW - 'underleftarrow': u'\u20ee', #  ⃮ COMBINING LEFT ARROW BELOW - 'underline': u'\u0332', #  ̲ COMBINING LOW LINE - 'underrightarrow': u'\u20ef', #  ⃯ COMBINING RIGHT ARROW BELOW - 'vec': u'\u20d7', #  ⃗ COMBINING RIGHT ARROW ABOVE + 'acute': '\u0301', #  ́ COMBINING ACUTE ACCENT + 'bar': '\u0304', #  ̄ COMBINING MACRON + 'breve': '\u0306', #  ̆ COMBINING BREVE + 'check': '\u030c', #  ̌ COMBINING CARON + 'ddddot': '\u20dc', #  ⃜ COMBINING FOUR DOTS ABOVE + 'dddot': '\u20db', #  ⃛ COMBINING THREE DOTS ABOVE + 'ddot': '\u0308', #  ̈ COMBINING DIAERESIS + 'dot': '\u0307', #  ̇ COMBINING DOT ABOVE + 'grave': '\u0300', #  ̀ COMBINING GRAVE ACCENT + 'hat': '\u0302', #  ̂ COMBINING CIRCUMFLEX ACCENT + 'mathring': '\u030a', #  ̊ COMBINING RING ABOVE + 'not': '\u0338', #  ̸ COMBINING LONG SOLIDUS OVERLAY + 'overleftrightarrow': '\u20e1', #  ⃡ COMBINING LEFT RIGHT ARROW ABOVE + 'overline': '\u0305', #  ̅ COMBINING OVERLINE + 'tilde': '\u0303', #  ̃ COMBINING TILDE + 'underbar': '\u0331', #  ̱ COMBINING MACRON BELOW + 'underleftarrow': '\u20ee', #  ⃮ COMBINING LEFT ARROW BELOW + 'underline': '\u0332', #  ̲ COMBINING LOW LINE + 'underrightarrow': '\u20ef', #  ⃯ COMBINING RIGHT ARROW BELOW + 'vec': '\u20d7', #  ⃗ COMBINING RIGHT ARROW ABOVE } mathalpha = { - 'Bbbk': u'\U0001d55c', # 𝕜 MATHEMATICAL DOUBLE-STRUCK SMALL K - 'Delta': u'\u0394', # Δ GREEK CAPITAL LETTER DELTA - 'Gamma': u'\u0393', # Γ GREEK CAPITAL LETTER GAMMA - 'Im': u'\u2111', # ℑ BLACK-LETTER CAPITAL I - 'Lambda': u'\u039b', # Λ GREEK CAPITAL LETTER LAMDA - 'Omega': u'\u03a9', # Ω GREEK CAPITAL LETTER OMEGA - 'Phi': u'\u03a6', # Φ GREEK CAPITAL LETTER PHI - 'Pi': u'\u03a0', # Π GREEK CAPITAL LETTER PI - 'Psi': u'\u03a8', # Ψ GREEK CAPITAL LETTER PSI - 'Re': u'\u211c', # ℜ BLACK-LETTER CAPITAL R - 'Sigma': u'\u03a3', # Σ GREEK CAPITAL LETTER SIGMA - 'Theta': u'\u0398', # Θ GREEK CAPITAL LETTER THETA - 'Upsilon': u'\u03a5', # Υ GREEK CAPITAL LETTER UPSILON - 'Xi': u'\u039e', # Ξ GREEK CAPITAL LETTER XI - 'aleph': u'\u2135', # ℵ ALEF SYMBOL - 'alpha': u'\u03b1', # α GREEK SMALL LETTER ALPHA - 'beta': u'\u03b2', # β GREEK SMALL LETTER BETA - 'beth': u'\u2136', # ℶ BET SYMBOL - 'chi': u'\u03c7', # χ GREEK SMALL LETTER CHI - 'daleth': u'\u2138', # ℸ DALET SYMBOL - 'delta': u'\u03b4', # δ GREEK SMALL LETTER DELTA - 'digamma': u'\u03dd', # ϝ GREEK SMALL LETTER DIGAMMA - 'ell': u'\u2113', # ℓ SCRIPT SMALL L - 'epsilon': u'\u03f5', # ϵ GREEK LUNATE EPSILON SYMBOL - 'eta': u'\u03b7', # η GREEK SMALL LETTER ETA - 'eth': u'\xf0', # ð LATIN SMALL LETTER ETH - 'gamma': u'\u03b3', # γ GREEK SMALL LETTER GAMMA - 'gimel': u'\u2137', # ℷ GIMEL SYMBOL - 'hslash': u'\u210f', # ℏ PLANCK CONSTANT OVER TWO PI - 'imath': u'\u0131', # ı LATIN SMALL LETTER DOTLESS I - 'iota': u'\u03b9', # ι GREEK SMALL LETTER IOTA - 'jmath': u'\u0237', # ȷ LATIN SMALL LETTER DOTLESS J - 'kappa': u'\u03ba', # κ GREEK SMALL LETTER KAPPA - 'lambda': u'\u03bb', # λ GREEK SMALL LETTER LAMDA - 'mu': u'\u03bc', # μ GREEK SMALL LETTER MU - 'nu': u'\u03bd', # ν GREEK SMALL LETTER NU - 'omega': u'\u03c9', # ω GREEK SMALL LETTER OMEGA - 'phi': u'\u03d5', # ϕ GREEK PHI SYMBOL - 'pi': u'\u03c0', # π GREEK SMALL LETTER PI - 'psi': u'\u03c8', # ψ GREEK SMALL LETTER PSI - 'rho': u'\u03c1', # ρ GREEK SMALL LETTER RHO - 'sigma': u'\u03c3', # σ GREEK SMALL LETTER SIGMA - 'tau': u'\u03c4', # τ GREEK SMALL LETTER TAU - 'theta': u'\u03b8', # θ GREEK SMALL LETTER THETA - 'upsilon': u'\u03c5', # υ GREEK SMALL LETTER UPSILON - 'varDelta': u'\U0001d6e5', # 𝛥 MATHEMATICAL ITALIC CAPITAL DELTA - 'varGamma': u'\U0001d6e4', # 𝛤 MATHEMATICAL ITALIC CAPITAL GAMMA - 'varLambda': u'\U0001d6ec', # 𝛬 MATHEMATICAL ITALIC CAPITAL LAMDA - 'varOmega': u'\U0001d6fa', # 𝛺 MATHEMATICAL ITALIC CAPITAL OMEGA - 'varPhi': u'\U0001d6f7', # 𝛷 MATHEMATICAL ITALIC CAPITAL PHI - 'varPi': u'\U0001d6f1', # 𝛱 MATHEMATICAL ITALIC CAPITAL PI - 'varPsi': u'\U0001d6f9', # 𝛹 MATHEMATICAL ITALIC CAPITAL PSI - 'varSigma': u'\U0001d6f4', # 𝛴 MATHEMATICAL ITALIC CAPITAL SIGMA - 'varTheta': u'\U0001d6e9', # 𝛩 MATHEMATICAL ITALIC CAPITAL THETA - 'varUpsilon': u'\U0001d6f6', # 𝛶 MATHEMATICAL ITALIC CAPITAL UPSILON - 'varXi': u'\U0001d6ef', # 𝛯 MATHEMATICAL ITALIC CAPITAL XI - 'varepsilon': u'\u03b5', # ε GREEK SMALL LETTER EPSILON - 'varkappa': u'\u03f0', # ϰ GREEK KAPPA SYMBOL - 'varphi': u'\u03c6', # φ GREEK SMALL LETTER PHI - 'varpi': u'\u03d6', # ϖ GREEK PI SYMBOL - 'varrho': u'\u03f1', # ϱ GREEK RHO SYMBOL - 'varsigma': u'\u03c2', # ς GREEK SMALL LETTER FINAL SIGMA - 'vartheta': u'\u03d1', # ϑ GREEK THETA SYMBOL - 'wp': u'\u2118', # ℘ SCRIPT CAPITAL P - 'xi': u'\u03be', # ξ GREEK SMALL LETTER XI - 'zeta': u'\u03b6', # ζ GREEK SMALL LETTER ZETA + 'Bbbk': '\U0001d55c', # 𝕜 MATHEMATICAL DOUBLE-STRUCK SMALL K + 'Delta': '\u0394', # Δ GREEK CAPITAL LETTER DELTA + 'Gamma': '\u0393', # Γ GREEK CAPITAL LETTER GAMMA + 'Im': '\u2111', # ℑ BLACK-LETTER CAPITAL I + 'Lambda': '\u039b', # Λ GREEK CAPITAL LETTER LAMDA + 'Omega': '\u03a9', # Ω GREEK CAPITAL LETTER OMEGA + 'Phi': '\u03a6', # Φ GREEK CAPITAL LETTER PHI + 'Pi': '\u03a0', # Π GREEK CAPITAL LETTER PI + 'Psi': '\u03a8', # Ψ GREEK CAPITAL LETTER PSI + 'Re': '\u211c', # ℜ BLACK-LETTER CAPITAL R + 'Sigma': '\u03a3', # Σ GREEK CAPITAL LETTER SIGMA + 'Theta': '\u0398', # Θ GREEK CAPITAL LETTER THETA + 'Upsilon': '\u03a5', # Υ GREEK CAPITAL LETTER UPSILON + 'Xi': '\u039e', # Ξ GREEK CAPITAL LETTER XI + 'aleph': '\u2135', # ℵ ALEF SYMBOL + 'alpha': '\u03b1', # α GREEK SMALL LETTER ALPHA + 'beta': '\u03b2', # β GREEK SMALL LETTER BETA + 'beth': '\u2136', # ℶ BET SYMBOL + 'chi': '\u03c7', # χ GREEK SMALL LETTER CHI + 'daleth': '\u2138', # ℸ DALET SYMBOL + 'delta': '\u03b4', # δ GREEK SMALL LETTER DELTA + 'digamma': '\u03dd', # ϝ GREEK SMALL LETTER DIGAMMA + 'ell': '\u2113', # ℓ SCRIPT SMALL L + 'epsilon': '\u03f5', # ϵ GREEK LUNATE EPSILON SYMBOL + 'eta': '\u03b7', # η GREEK SMALL LETTER ETA + 'eth': '\xf0', # ð LATIN SMALL LETTER ETH + 'gamma': '\u03b3', # γ GREEK SMALL LETTER GAMMA + 'gimel': '\u2137', # ℷ GIMEL SYMBOL + 'hslash': '\u210f', # ℏ PLANCK CONSTANT OVER TWO PI + 'imath': '\u0131', # ı LATIN SMALL LETTER DOTLESS I + 'iota': '\u03b9', # ι GREEK SMALL LETTER IOTA + 'jmath': '\u0237', # ȷ LATIN SMALL LETTER DOTLESS J + 'kappa': '\u03ba', # κ GREEK SMALL LETTER KAPPA + 'lambda': '\u03bb', # λ GREEK SMALL LETTER LAMDA + '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 + 'psi': '\u03c8', # ψ GREEK SMALL LETTER PSI + 'rho': '\u03c1', # ρ GREEK SMALL LETTER RHO + 'sigma': '\u03c3', # σ GREEK SMALL LETTER SIGMA + 'tau': '\u03c4', # τ GREEK SMALL LETTER TAU + 'theta': '\u03b8', # θ GREEK SMALL LETTER THETA + 'upsilon': '\u03c5', # υ GREEK SMALL LETTER UPSILON + 'varDelta': '\U0001d6e5', # 𝛥 MATHEMATICAL ITALIC CAPITAL DELTA + 'varGamma': '\U0001d6e4', # 𝛤 MATHEMATICAL ITALIC CAPITAL GAMMA + 'varLambda': '\U0001d6ec', # 𝛬 MATHEMATICAL ITALIC CAPITAL LAMDA + 'varOmega': '\U0001d6fa', # 𝛺 MATHEMATICAL ITALIC CAPITAL OMEGA + 'varPhi': '\U0001d6f7', # 𝛷 MATHEMATICAL ITALIC CAPITAL PHI + 'varPi': '\U0001d6f1', # 𝛱 MATHEMATICAL ITALIC CAPITAL PI + 'varPsi': '\U0001d6f9', # 𝛹 MATHEMATICAL ITALIC CAPITAL PSI + 'varSigma': '\U0001d6f4', # 𝛴 MATHEMATICAL ITALIC CAPITAL SIGMA + 'varTheta': '\U0001d6e9', # 𝛩 MATHEMATICAL ITALIC CAPITAL THETA + 'varUpsilon': '\U0001d6f6', # 𝛶 MATHEMATICAL ITALIC CAPITAL UPSILON + 'varXi': '\U0001d6ef', # 𝛯 MATHEMATICAL ITALIC CAPITAL XI + 'varepsilon': '\u03b5', # ε GREEK SMALL LETTER EPSILON + 'varkappa': '\u03f0', # ϰ GREEK KAPPA SYMBOL + 'varphi': '\u03c6', # φ GREEK SMALL LETTER PHI + 'varpi': '\u03d6', # ϖ GREEK PI SYMBOL + 'varrho': '\u03f1', # ϱ GREEK RHO SYMBOL + 'varsigma': '\u03c2', # ς GREEK SMALL LETTER FINAL SIGMA + 'vartheta': '\u03d1', # ϑ GREEK THETA SYMBOL + 'wp': '\u2118', # ℘ SCRIPT CAPITAL P + 'xi': '\u03be', # ξ GREEK SMALL LETTER XI + 'zeta': '\u03b6', # ζ GREEK SMALL LETTER ZETA } mathbin = { - 'Cap': u'\u22d2', # ⋒ DOUBLE INTERSECTION - 'Circle': u'\u25cb', # ○ WHITE CIRCLE - 'Cup': u'\u22d3', # ⋓ DOUBLE UNION - 'LHD': u'\u25c0', # ◀ BLACK LEFT-POINTING TRIANGLE - 'RHD': u'\u25b6', # ▶ BLACK RIGHT-POINTING TRIANGLE - 'amalg': u'\u2a3f', # ⨿ AMALGAMATION OR COPRODUCT - 'ast': u'\u2217', # ∗ ASTERISK OPERATOR - 'barwedge': u'\u22bc', # ⊼ NAND - 'bigcirc': u'\u25ef', # ◯ LARGE CIRCLE - 'bigtriangledown': u'\u25bd', # ▽ WHITE DOWN-POINTING TRIANGLE - 'bigtriangleup': u'\u25b3', # △ WHITE UP-POINTING TRIANGLE - 'bindnasrepma': u'\u214b', # ⅋ TURNED AMPERSAND - 'blacklozenge': u'\u29eb', # ⧫ BLACK LOZENGE - 'boxast': u'\u29c6', # ⧆ SQUARED ASTERISK - 'boxbar': u'\u25eb', # ◫ WHITE SQUARE WITH VERTICAL BISECTING LINE - 'boxbox': u'\u29c8', # ⧈ SQUARED SQUARE - 'boxbslash': u'\u29c5', # ⧅ SQUARED FALLING DIAGONAL SLASH - 'boxcircle': u'\u29c7', # ⧇ SQUARED SMALL CIRCLE - 'boxdot': u'\u22a1', # ⊡ SQUARED DOT OPERATOR - 'boxminus': u'\u229f', # ⊟ SQUARED MINUS - 'boxplus': u'\u229e', # ⊞ SQUARED PLUS - 'boxslash': u'\u29c4', # ⧄ SQUARED RISING DIAGONAL SLASH - 'boxtimes': u'\u22a0', # ⊠ SQUARED TIMES - 'bullet': u'\u2022', # • BULLET - 'cap': u'\u2229', # ∩ INTERSECTION - 'cdot': u'\u22c5', # ⋅ DOT OPERATOR - 'circ': u'\u2218', # ∘ RING OPERATOR - 'circledast': u'\u229b', # ⊛ CIRCLED ASTERISK OPERATOR - 'circledbslash': u'\u29b8', # ⦸ CIRCLED REVERSE SOLIDUS - 'circledcirc': u'\u229a', # ⊚ CIRCLED RING OPERATOR - 'circleddash': u'\u229d', # ⊝ CIRCLED DASH - 'circledgtr': u'\u29c1', # ⧁ CIRCLED GREATER-THAN - 'circledless': u'\u29c0', # ⧀ CIRCLED LESS-THAN - 'cup': u'\u222a', # ∪ UNION - 'curlyvee': u'\u22ce', # ⋎ CURLY LOGICAL OR - 'curlywedge': u'\u22cf', # ⋏ CURLY LOGICAL AND - 'dagger': u'\u2020', # † DAGGER - 'ddagger': u'\u2021', # ‡ DOUBLE DAGGER - 'diamond': u'\u22c4', # ⋄ DIAMOND OPERATOR - 'div': u'\xf7', # ÷ DIVISION SIGN - 'divideontimes': u'\u22c7', # ⋇ DIVISION TIMES - 'dotplus': u'\u2214', # ∔ DOT PLUS - 'doublebarwedge': u'\u2a5e', # ⩞ LOGICAL AND WITH DOUBLE OVERBAR - 'gtrdot': u'\u22d7', # ⋗ GREATER-THAN WITH DOT - 'intercal': u'\u22ba', # ⊺ INTERCALATE - 'interleave': u'\u2af4', # ⫴ TRIPLE VERTICAL BAR BINARY RELATION - 'invamp': u'\u214b', # ⅋ TURNED AMPERSAND - 'land': u'\u2227', # ∧ LOGICAL AND - 'leftthreetimes': u'\u22cb', # ⋋ LEFT SEMIDIRECT PRODUCT - 'lessdot': u'\u22d6', # ⋖ LESS-THAN WITH DOT - 'lor': u'\u2228', # ∨ LOGICAL OR - 'ltimes': u'\u22c9', # ⋉ LEFT NORMAL FACTOR SEMIDIRECT PRODUCT - 'mp': u'\u2213', # ∓ MINUS-OR-PLUS SIGN - 'odot': u'\u2299', # ⊙ CIRCLED DOT OPERATOR - 'ominus': u'\u2296', # ⊖ CIRCLED MINUS - 'oplus': u'\u2295', # ⊕ CIRCLED PLUS - 'oslash': u'\u2298', # ⊘ CIRCLED DIVISION SLASH - 'otimes': u'\u2297', # ⊗ CIRCLED TIMES - 'pm': u'\xb1', # ± PLUS-MINUS SIGN - 'rightthreetimes': u'\u22cc', # ⋌ RIGHT SEMIDIRECT PRODUCT - 'rtimes': u'\u22ca', # ⋊ RIGHT NORMAL FACTOR SEMIDIRECT PRODUCT - 'setminus': u'\u29f5', # ⧵ REVERSE SOLIDUS OPERATOR - 'slash': u'\u2215', # ∕ DIVISION SLASH - 'smallsetminus': u'\u2216', # ∖ SET MINUS - 'smalltriangledown': u'\u25bf', # ▿ WHITE DOWN-POINTING SMALL TRIANGLE - 'smalltriangleleft': u'\u25c3', # ◃ WHITE LEFT-POINTING SMALL TRIANGLE - 'smalltriangleright': u'\u25b9', # ▹ WHITE RIGHT-POINTING SMALL TRIANGLE - 'sqcap': u'\u2293', # ⊓ SQUARE CAP - 'sqcup': u'\u2294', # ⊔ SQUARE CUP - 'sslash': u'\u2afd', # ⫽ DOUBLE SOLIDUS OPERATOR - 'star': u'\u22c6', # ⋆ STAR OPERATOR - 'talloblong': u'\u2afe', # ⫾ WHITE VERTICAL BAR - 'times': u'\xd7', # × MULTIPLICATION SIGN - 'triangleleft': u'\u25c3', # ◃ WHITE LEFT-POINTING SMALL TRIANGLE - 'triangleright': u'\u25b9', # ▹ WHITE RIGHT-POINTING SMALL TRIANGLE - 'uplus': u'\u228e', # ⊎ MULTISET UNION - 'vee': u'\u2228', # ∨ LOGICAL OR - 'veebar': u'\u22bb', # ⊻ XOR - 'wedge': u'\u2227', # ∧ LOGICAL AND - 'wr': u'\u2240', # ≀ WREATH PRODUCT + 'Cap': '\u22d2', # ⋒ DOUBLE INTERSECTION + 'Circle': '\u25cb', # ○ WHITE CIRCLE + 'Cup': '\u22d3', # ⋓ DOUBLE UNION + 'LHD': '\u25c0', # ◀ BLACK LEFT-POINTING TRIANGLE + 'RHD': '\u25b6', # ▶ BLACK RIGHT-POINTING TRIANGLE + 'amalg': '\u2a3f', # ⨿ AMALGAMATION OR COPRODUCT + 'ast': '\u2217', # ∗ ASTERISK OPERATOR + 'barwedge': '\u22bc', # ⊼ NAND + 'bigcirc': '\u25ef', # ◯ LARGE CIRCLE + 'bigtriangledown': '\u25bd', # ▽ WHITE DOWN-POINTING TRIANGLE + 'bigtriangleup': '\u25b3', # △ WHITE UP-POINTING TRIANGLE + 'bindnasrepma': '\u214b', # ⅋ TURNED AMPERSAND + 'blacklozenge': '\u29eb', # ⧫ BLACK LOZENGE + 'boxast': '\u29c6', # ⧆ SQUARED ASTERISK + 'boxbar': '\u25eb', # ◫ WHITE SQUARE WITH VERTICAL BISECTING LINE + 'boxbox': '\u29c8', # ⧈ SQUARED SQUARE + 'boxbslash': '\u29c5', # ⧅ SQUARED FALLING DIAGONAL SLASH + 'boxcircle': '\u29c7', # ⧇ SQUARED SMALL CIRCLE + 'boxdot': '\u22a1', # ⊡ SQUARED DOT OPERATOR + 'boxminus': '\u229f', # ⊟ SQUARED MINUS + 'boxplus': '\u229e', # ⊞ SQUARED PLUS + 'boxslash': '\u29c4', # ⧄ SQUARED RISING DIAGONAL SLASH + 'boxtimes': '\u22a0', # ⊠ SQUARED TIMES + 'bullet': '\u2022', # • BULLET + 'cap': '\u2229', # ∩ INTERSECTION + 'cdot': '\u22c5', # ⋅ DOT OPERATOR + 'circ': '\u2218', # ∘ RING OPERATOR + 'circledast': '\u229b', # ⊛ CIRCLED ASTERISK OPERATOR + 'circledbslash': '\u29b8', # ⦸ CIRCLED REVERSE SOLIDUS + 'circledcirc': '\u229a', # ⊚ CIRCLED RING OPERATOR + 'circleddash': '\u229d', # ⊝ CIRCLED DASH + 'circledgtr': '\u29c1', # ⧁ CIRCLED GREATER-THAN + 'circledless': '\u29c0', # ⧀ CIRCLED LESS-THAN + 'cup': '\u222a', # ∪ UNION + 'curlyvee': '\u22ce', # ⋎ CURLY LOGICAL OR + 'curlywedge': '\u22cf', # ⋏ CURLY LOGICAL AND + 'dagger': '\u2020', # † DAGGER + 'ddagger': '\u2021', # ‡ DOUBLE DAGGER + 'diamond': '\u22c4', # ⋄ DIAMOND OPERATOR + 'div': '\xf7', # ÷ DIVISION SIGN + 'divideontimes': '\u22c7', # ⋇ DIVISION TIMES + 'dotplus': '\u2214', # ∔ DOT PLUS + 'doublebarwedge': '\u2a5e', # ⩞ LOGICAL AND WITH DOUBLE OVERBAR + 'gtrdot': '\u22d7', # ⋗ GREATER-THAN WITH DOT + 'intercal': '\u22ba', # ⊺ INTERCALATE + 'interleave': '\u2af4', # ⫴ TRIPLE VERTICAL BAR BINARY RELATION + 'invamp': '\u214b', # ⅋ TURNED AMPERSAND + 'land': '\u2227', # ∧ LOGICAL AND + 'leftthreetimes': '\u22cb', # ⋋ LEFT SEMIDIRECT PRODUCT + 'lessdot': '\u22d6', # ⋖ LESS-THAN WITH DOT + 'lor': '\u2228', # ∨ LOGICAL OR + 'ltimes': '\u22c9', # ⋉ LEFT NORMAL FACTOR SEMIDIRECT PRODUCT + 'mp': '\u2213', # ∓ MINUS-OR-PLUS SIGN + 'odot': '\u2299', # ⊙ CIRCLED DOT OPERATOR + 'ominus': '\u2296', # ⊖ CIRCLED MINUS + 'oplus': '\u2295', # ⊕ CIRCLED PLUS + 'oslash': '\u2298', # ⊘ CIRCLED DIVISION SLASH + 'otimes': '\u2297', # ⊗ CIRCLED TIMES + 'pm': '\xb1', # ± PLUS-MINUS SIGN + 'rightthreetimes': '\u22cc', # ⋌ RIGHT SEMIDIRECT PRODUCT + 'rtimes': '\u22ca', # ⋊ RIGHT NORMAL FACTOR SEMIDIRECT PRODUCT + 'setminus': '\u29f5', # ⧵ REVERSE SOLIDUS OPERATOR + 'slash': '\u2215', # ∕ DIVISION SLASH + 'smallsetminus': '\u2216', # ∖ SET MINUS + 'smalltriangledown': '\u25bf', # ▿ WHITE DOWN-POINTING SMALL TRIANGLE + 'smalltriangleleft': '\u25c3', # ◃ WHITE LEFT-POINTING SMALL TRIANGLE + 'smalltriangleright': '\u25b9', # ▹ WHITE RIGHT-POINTING SMALL TRIANGLE + 'sqcap': '\u2293', # ⊓ SQUARE CAP + 'sqcup': '\u2294', # ⊔ SQUARE CUP + 'sslash': '\u2afd', # ⫽ DOUBLE SOLIDUS OPERATOR + 'star': '\u22c6', # ⋆ STAR OPERATOR + 'talloblong': '\u2afe', # ⫾ WHITE VERTICAL BAR + 'times': '\xd7', # × MULTIPLICATION SIGN + 'triangleleft': '\u25c3', # ◃ WHITE LEFT-POINTING SMALL TRIANGLE + 'triangleright': '\u25b9', # ▹ WHITE RIGHT-POINTING SMALL TRIANGLE + 'uplus': '\u228e', # ⊎ MULTISET UNION + 'vee': '\u2228', # ∨ LOGICAL OR + 'veebar': '\u22bb', # ⊻ XOR + 'wedge': '\u2227', # ∧ LOGICAL AND + 'wr': '\u2240', # ≀ WREATH PRODUCT } mathclose = { - 'Rbag': u'\u27c6', # ⟆ RIGHT S-SHAPED BAG DELIMITER - 'lrcorner': u'\u231f', # ⌟ BOTTOM RIGHT CORNER - 'rangle': u'\u27e9', # ⟩ MATHEMATICAL RIGHT ANGLE BRACKET - 'rbag': u'\u27c6', # ⟆ RIGHT S-SHAPED BAG DELIMITER - 'rbrace': u'}', # } RIGHT CURLY BRACKET - 'rbrack': u']', # ] RIGHT SQUARE BRACKET - 'rceil': u'\u2309', # ⌉ RIGHT CEILING - 'rfloor': u'\u230b', # ⌋ RIGHT FLOOR - 'rgroup': u'\u27ef', # ⟯ MATHEMATICAL RIGHT FLATTENED PARENTHESIS - 'rrbracket': u'\u27e7', # ⟧ MATHEMATICAL RIGHT WHITE SQUARE BRACKET - 'rrparenthesis': u'\u2988', # ⦈ Z NOTATION RIGHT IMAGE BRACKET - 'urcorner': u'\u231d', # ⌝ TOP RIGHT CORNER - '}': u'}', # } RIGHT CURLY BRACKET + 'Rbag': '\u27c6', # ⟆ RIGHT S-SHAPED BAG DELIMITER + 'lrcorner': '\u231f', # ⌟ BOTTOM RIGHT CORNER + 'rangle': '\u27e9', # ⟩ MATHEMATICAL RIGHT ANGLE BRACKET + 'rbag': '\u27c6', # ⟆ RIGHT S-SHAPED BAG DELIMITER + 'rbrace': '}', # } RIGHT CURLY BRACKET + 'rbrack': ']', # ] RIGHT SQUARE BRACKET + 'rceil': '\u2309', # ⌉ RIGHT CEILING + 'rfloor': '\u230b', # ⌋ RIGHT FLOOR + 'rgroup': '\u27ef', # ⟯ MATHEMATICAL RIGHT FLATTENED PARENTHESIS + 'rrbracket': '\u27e7', # ⟧ MATHEMATICAL RIGHT WHITE SQUARE BRACKET + 'rrparenthesis': '\u2988', # ⦈ Z NOTATION RIGHT IMAGE BRACKET + 'urcorner': '\u231d', # ⌝ TOP RIGHT CORNER + '}': '}', # } RIGHT CURLY BRACKET } mathfence = { - 'Vert': u'\u2016', # ‖ DOUBLE VERTICAL LINE - 'vert': u'|', # | VERTICAL LINE - '|': u'\u2016', # ‖ DOUBLE VERTICAL LINE + 'Vert': '\u2016', # ‖ DOUBLE VERTICAL LINE + 'vert': '|', # | VERTICAL LINE + '|': '\u2016', # ‖ DOUBLE VERTICAL LINE } mathop = { - 'bigcap': u'\u22c2', # ⋂ N-ARY INTERSECTION - 'bigcup': u'\u22c3', # ⋃ N-ARY UNION - 'biginterleave': u'\u2afc', # ⫼ LARGE TRIPLE VERTICAL BAR OPERATOR - 'bigodot': u'\u2a00', # ⨀ N-ARY CIRCLED DOT OPERATOR - 'bigoplus': u'\u2a01', # ⨁ N-ARY CIRCLED PLUS OPERATOR - 'bigotimes': u'\u2a02', # ⨂ N-ARY CIRCLED TIMES OPERATOR - 'bigsqcap': u'\u2a05', # ⨅ N-ARY SQUARE INTERSECTION OPERATOR - 'bigsqcup': u'\u2a06', # ⨆ N-ARY SQUARE UNION OPERATOR - 'biguplus': u'\u2a04', # ⨄ N-ARY UNION OPERATOR WITH PLUS - 'bigvee': u'\u22c1', # ⋁ N-ARY LOGICAL OR - 'bigwedge': u'\u22c0', # ⋀ N-ARY LOGICAL AND - 'coprod': u'\u2210', # ∐ N-ARY COPRODUCT - 'fatsemi': u'\u2a1f', # ⨟ Z NOTATION SCHEMA COMPOSITION - 'fint': u'\u2a0f', # ⨏ INTEGRAL AVERAGE WITH SLASH - 'iiiint': u'\u2a0c', # ⨌ QUADRUPLE INTEGRAL OPERATOR - 'iiint': u'\u222d', # ∭ TRIPLE INTEGRAL - 'iint': u'\u222c', # ∬ DOUBLE INTEGRAL - 'int': u'\u222b', # ∫ INTEGRAL - 'intop': u'\u222b', # ∫ INTEGRAL - 'oiiint': u'\u2230', # ∰ VOLUME INTEGRAL - 'oiint': u'\u222f', # ∯ SURFACE INTEGRAL - 'oint': u'\u222e', # ∮ CONTOUR INTEGRAL - 'ointctrclockwise': u'\u2233', # ∳ ANTICLOCKWISE CONTOUR INTEGRAL - 'ointop': u'\u222e', # ∮ CONTOUR INTEGRAL - 'prod': u'\u220f', # ∏ N-ARY PRODUCT - 'sqint': u'\u2a16', # ⨖ QUATERNION INTEGRAL OPERATOR - 'sum': u'\u2211', # ∑ N-ARY SUMMATION - 'varointclockwise': u'\u2232', # ∲ CLOCKWISE CONTOUR INTEGRAL - 'varprod': u'\u2a09', # ⨉ N-ARY TIMES OPERATOR + 'bigcap': '\u22c2', # ⋂ N-ARY INTERSECTION + 'bigcup': '\u22c3', # ⋃ N-ARY UNION + 'biginterleave': '\u2afc', # ⫼ LARGE TRIPLE VERTICAL BAR OPERATOR + 'bigodot': '\u2a00', # ⨀ N-ARY CIRCLED DOT OPERATOR + 'bigoplus': '\u2a01', # ⨁ N-ARY CIRCLED PLUS OPERATOR + 'bigotimes': '\u2a02', # ⨂ N-ARY CIRCLED TIMES OPERATOR + 'bigsqcap': '\u2a05', # ⨅ N-ARY SQUARE INTERSECTION OPERATOR + 'bigsqcup': '\u2a06', # ⨆ N-ARY SQUARE UNION OPERATOR + 'biguplus': '\u2a04', # ⨄ N-ARY UNION OPERATOR WITH PLUS + 'bigvee': '\u22c1', # ⋁ N-ARY LOGICAL OR + 'bigwedge': '\u22c0', # ⋀ N-ARY LOGICAL AND + 'coprod': '\u2210', # ∐ N-ARY COPRODUCT + 'fatsemi': '\u2a1f', # ⨟ Z NOTATION SCHEMA COMPOSITION + 'fint': '\u2a0f', # ⨏ INTEGRAL AVERAGE WITH SLASH + 'iiiint': '\u2a0c', # ⨌ QUADRUPLE INTEGRAL OPERATOR + 'iiint': '\u222d', # ∭ TRIPLE INTEGRAL + 'iint': '\u222c', # ∬ DOUBLE INTEGRAL + 'int': '\u222b', # ∫ INTEGRAL + 'intop': '\u222b', # ∫ INTEGRAL + 'oiiint': '\u2230', # ∰ VOLUME INTEGRAL + 'oiint': '\u222f', # ∯ SURFACE INTEGRAL + 'oint': '\u222e', # ∮ CONTOUR INTEGRAL + 'ointctrclockwise': '\u2233', # ∳ ANTICLOCKWISE CONTOUR INTEGRAL + 'ointop': '\u222e', # ∮ CONTOUR INTEGRAL + 'prod': '\u220f', # ∏ N-ARY PRODUCT + 'sqint': '\u2a16', # ⨖ QUATERNION INTEGRAL OPERATOR + 'sum': '\u2211', # ∑ N-ARY SUMMATION + 'varointclockwise': '\u2232', # ∲ CLOCKWISE CONTOUR INTEGRAL + 'varprod': '\u2a09', # ⨉ N-ARY TIMES OPERATOR } mathopen = { - 'Lbag': u'\u27c5', # ⟅ LEFT S-SHAPED BAG DELIMITER - 'langle': u'\u27e8', # ⟨ MATHEMATICAL LEFT ANGLE BRACKET - 'lbag': u'\u27c5', # ⟅ LEFT S-SHAPED BAG DELIMITER - 'lbrace': u'{', # { LEFT CURLY BRACKET - 'lbrack': u'[', # [ LEFT SQUARE BRACKET - 'lceil': u'\u2308', # ⌈ LEFT CEILING - 'lfloor': u'\u230a', # ⌊ LEFT FLOOR - 'lgroup': u'\u27ee', # ⟮ MATHEMATICAL LEFT FLATTENED PARENTHESIS - 'llbracket': u'\u27e6', # ⟦ MATHEMATICAL LEFT WHITE SQUARE BRACKET - 'llcorner': u'\u231e', # ⌞ BOTTOM LEFT CORNER - 'llparenthesis': u'\u2987', # ⦇ Z NOTATION LEFT IMAGE BRACKET - 'ulcorner': u'\u231c', # ⌜ TOP LEFT CORNER - '{': u'{', # { LEFT CURLY BRACKET + 'Lbag': '\u27c5', # ⟅ LEFT S-SHAPED BAG DELIMITER + 'langle': '\u27e8', # ⟨ MATHEMATICAL LEFT ANGLE BRACKET + 'lbag': '\u27c5', # ⟅ LEFT S-SHAPED BAG DELIMITER + 'lbrace': '{', # { LEFT CURLY BRACKET + 'lbrack': '[', # [ LEFT SQUARE BRACKET + 'lceil': '\u2308', # ⌈ LEFT CEILING + 'lfloor': '\u230a', # ⌊ LEFT FLOOR + 'lgroup': '\u27ee', # ⟮ MATHEMATICAL LEFT FLATTENED PARENTHESIS + 'llbracket': '\u27e6', # ⟦ MATHEMATICAL LEFT WHITE SQUARE BRACKET + 'llcorner': '\u231e', # ⌞ BOTTOM LEFT CORNER + 'llparenthesis': '\u2987', # ⦇ Z NOTATION LEFT IMAGE BRACKET + 'ulcorner': '\u231c', # ⌜ TOP LEFT CORNER + '{': '{', # { LEFT CURLY BRACKET } mathord = { - '#': u'#', # # NUMBER SIGN - '$': u'$', # $ DOLLAR SIGN - '%': u'%', # % PERCENT SIGN - '&': u'&', # & AMPERSAND - 'AC': u'\u223f', # ∿ SINE WAVE - 'APLcomment': u'\u235d', # ⍝ APL FUNCTIONAL SYMBOL UP SHOE JOT - 'APLdownarrowbox': u'\u2357', # ⍗ APL FUNCTIONAL SYMBOL QUAD DOWNWARDS ARROW - 'APLinput': u'\u235e', # ⍞ APL FUNCTIONAL SYMBOL QUOTE QUAD - 'APLinv': u'\u2339', # ⌹ APL FUNCTIONAL SYMBOL QUAD DIVIDE - 'APLleftarrowbox': u'\u2347', # ⍇ APL FUNCTIONAL SYMBOL QUAD LEFTWARDS ARROW - 'APLlog': u'\u235f', # ⍟ APL FUNCTIONAL SYMBOL CIRCLE STAR - 'APLrightarrowbox': u'\u2348', # ⍈ APL FUNCTIONAL SYMBOL QUAD RIGHTWARDS ARROW - 'APLuparrowbox': u'\u2350', # ⍐ APL FUNCTIONAL SYMBOL QUAD UPWARDS ARROW - 'Aries': u'\u2648', # ♈ ARIES - 'Box': u'\u2b1c', # ⬜ WHITE LARGE SQUARE - 'CIRCLE': u'\u25cf', # ● BLACK CIRCLE - 'CheckedBox': u'\u2611', # ☑ BALLOT BOX WITH CHECK - 'Diamond': u'\u25c7', # ◇ WHITE DIAMOND - 'Diamondblack': u'\u25c6', # ◆ BLACK DIAMOND - 'Diamonddot': u'\u27d0', # ⟐ WHITE DIAMOND WITH CENTRED DOT - 'Finv': u'\u2132', # Ⅎ TURNED CAPITAL F - 'Game': u'\u2141', # ⅁ TURNED SANS-SERIF CAPITAL G - 'Gemini': u'\u264a', # ♊ GEMINI - 'Jupiter': u'\u2643', # ♃ JUPITER - 'LEFTCIRCLE': u'\u25d6', # ◖ LEFT HALF BLACK CIRCLE - 'LEFTcircle': u'\u25d0', # ◐ CIRCLE WITH LEFT HALF BLACK - 'Leo': u'\u264c', # ♌ LEO - 'Libra': u'\u264e', # ♎ LIBRA - 'Mars': u'\u2642', # ♂ MALE SIGN - 'Mercury': u'\u263f', # ☿ MERCURY - 'Neptune': u'\u2646', # ♆ NEPTUNE - 'P': u'\xb6', # ¶ PILCROW SIGN - 'Pluto': u'\u2647', # ♇ PLUTO - 'RIGHTCIRCLE': u'\u25d7', # ◗ RIGHT HALF BLACK CIRCLE - 'RIGHTcircle': u'\u25d1', # ◑ CIRCLE WITH RIGHT HALF BLACK - 'S': u'\xa7', # § SECTION SIGN - 'Saturn': u'\u2644', # ♄ SATURN - 'Scorpio': u'\u264f', # ♏ SCORPIUS - 'Square': u'\u2610', # ☐ BALLOT BOX - 'Sun': u'\u2609', # ☉ SUN - 'Taurus': u'\u2649', # ♉ TAURUS - 'Uranus': u'\u2645', # ♅ URANUS - 'Venus': u'\u2640', # ♀ FEMALE SIGN - 'XBox': u'\u2612', # ☒ BALLOT BOX WITH X - 'Yup': u'\u2144', # ⅄ TURNED SANS-SERIF CAPITAL Y - '_': u'_', # _ LOW LINE - 'angle': u'\u2220', # ∠ ANGLE - 'aquarius': u'\u2652', # ♒ AQUARIUS - 'aries': u'\u2648', # ♈ ARIES - 'arrowvert': u'\u23d0', # ⏐ VERTICAL LINE EXTENSION - 'backprime': u'\u2035', # ‵ REVERSED PRIME - 'backslash': u'\\', # \ REVERSE SOLIDUS - 'bigstar': u'\u2605', # ★ BLACK STAR - 'blacksmiley': u'\u263b', # ☻ BLACK SMILING FACE - 'blacksquare': u'\u25fc', # ◼ BLACK MEDIUM SQUARE - 'blacktriangle': u'\u25b4', # ▴ BLACK UP-POINTING SMALL TRIANGLE - 'blacktriangledown': u'\u25be', # ▾ BLACK DOWN-POINTING SMALL TRIANGLE - 'blacktriangleup': u'\u25b4', # ▴ BLACK UP-POINTING SMALL TRIANGLE - 'bot': u'\u22a5', # ⊥ UP TACK - 'boy': u'\u2642', # ♂ MALE SIGN - 'bracevert': u'\u23aa', # ⎪ CURLY BRACKET EXTENSION - 'cancer': u'\u264b', # ♋ CANCER - 'capricornus': u'\u2651', # ♑ CAPRICORN - 'cdots': u'\u22ef', # ⋯ MIDLINE HORIZONTAL ELLIPSIS - 'cent': u'\xa2', # ¢ CENT SIGN - 'checkmark': u'\u2713', # ✓ CHECK MARK - 'circledR': u'\u24c7', # Ⓡ CIRCLED LATIN CAPITAL LETTER R - 'circledS': u'\u24c8', # Ⓢ CIRCLED LATIN CAPITAL LETTER S - 'clubsuit': u'\u2663', # ♣ BLACK CLUB SUIT - 'complement': u'\u2201', # ∁ COMPLEMENT - 'diagdown': u'\u27cd', # ⟍ MATHEMATICAL FALLING DIAGONAL - 'diagup': u'\u27cb', # ⟋ MATHEMATICAL RISING DIAGONAL - 'diameter': u'\u2300', # ⌀ DIAMETER SIGN - 'diamondsuit': u'\u2662', # ♢ WHITE DIAMOND SUIT - 'earth': u'\u2641', # ♁ EARTH - 'emptyset': u'\u2205', # ∅ EMPTY SET - 'exists': u'\u2203', # ∃ THERE EXISTS - 'female': u'\u2640', # ♀ FEMALE SIGN - 'flat': u'\u266d', # ♭ MUSIC FLAT SIGN - 'forall': u'\u2200', # ∀ FOR ALL - 'fourth': u'\u2057', # ⁗ QUADRUPLE PRIME - 'frownie': u'\u2639', # ☹ WHITE FROWNING FACE - 'gemini': u'\u264a', # ♊ GEMINI - 'girl': u'\u2640', # ♀ FEMALE SIGN - 'heartsuit': u'\u2661', # ♡ WHITE HEART SUIT - 'infty': u'\u221e', # ∞ INFINITY - 'invdiameter': u'\u2349', # ⍉ APL FUNCTIONAL SYMBOL CIRCLE BACKSLASH - 'invneg': u'\u2310', # ⌐ REVERSED NOT SIGN - 'jupiter': u'\u2643', # ♃ JUPITER - 'ldots': u'\u2026', # … HORIZONTAL ELLIPSIS - 'leftmoon': u'\u263e', # ☾ LAST QUARTER MOON - 'leo': u'\u264c', # ♌ LEO - 'libra': u'\u264e', # ♎ LIBRA - 'lmoustache': u'\u23b0', # ⎰ UPPER LEFT OR LOWER RIGHT CURLY BRACKET SECTION - 'lnot': u'\xac', # ¬ NOT SIGN - 'lozenge': u'\u25ca', # ◊ LOZENGE - 'male': u'\u2642', # ♂ MALE SIGN - 'maltese': u'\u2720', # ✠ MALTESE CROSS - 'mathcent': u'\xa2', # ¢ CENT SIGN - 'mathdollar': u'$', # $ DOLLAR SIGN - 'mathsterling': u'\xa3', # £ POUND SIGN - 'measuredangle': u'\u2221', # ∡ MEASURED ANGLE - 'medbullet': u'\u26ab', # ⚫ MEDIUM BLACK CIRCLE - 'medcirc': u'\u26aa', # ⚪ MEDIUM WHITE CIRCLE - 'mercury': u'\u263f', # ☿ MERCURY - 'mho': u'\u2127', # ℧ INVERTED OHM SIGN - 'nabla': u'\u2207', # ∇ NABLA - 'natural': u'\u266e', # ♮ MUSIC NATURAL SIGN - 'neg': u'\xac', # ¬ NOT SIGN - 'neptune': u'\u2646', # ♆ NEPTUNE - 'nexists': u'\u2204', # ∄ THERE DOES NOT EXIST - 'notbackslash': u'\u2340', # ⍀ APL FUNCTIONAL SYMBOL BACKSLASH BAR - 'partial': u'\u2202', # ∂ PARTIAL DIFFERENTIAL - 'pisces': u'\u2653', # ♓ PISCES - 'pluto': u'\u2647', # ♇ PLUTO - 'pounds': u'\xa3', # £ POUND SIGN - 'prime': u'\u2032', # ′ PRIME - 'quarternote': u'\u2669', # ♩ QUARTER NOTE - 'rightmoon': u'\u263d', # ☽ FIRST QUARTER MOON - 'rmoustache': u'\u23b1', # ⎱ UPPER RIGHT OR LOWER LEFT CURLY BRACKET SECTION - 'sagittarius': u'\u2650', # ♐ SAGITTARIUS - 'saturn': u'\u2644', # ♄ SATURN - 'scorpio': u'\u264f', # ♏ SCORPIUS - 'second': u'\u2033', # ″ DOUBLE PRIME - 'sharp': u'\u266f', # ♯ MUSIC SHARP SIGN - 'smiley': u'\u263a', # ☺ WHITE SMILING FACE - 'spadesuit': u'\u2660', # ♠ BLACK SPADE SUIT - 'spddot': u'\xa8', # ¨ DIAERESIS - 'sphat': u'^', # ^ CIRCUMFLEX ACCENT - 'sphericalangle': u'\u2222', # ∢ SPHERICAL ANGLE - 'sptilde': u'~', # ~ TILDE - 'square': u'\u25fb', # ◻ WHITE MEDIUM SQUARE - 'sun': u'\u263c', # ☼ WHITE SUN WITH RAYS - 'surd': u'\u221a', # √ SQUARE ROOT - 'taurus': u'\u2649', # ♉ TAURUS - 'third': u'\u2034', # ‴ TRIPLE PRIME - 'top': u'\u22a4', # ⊤ DOWN TACK - 'twonotes': u'\u266b', # ♫ BEAMED EIGHTH NOTES - 'uranus': u'\u2645', # ♅ URANUS - 'varEarth': u'\u2641', # ♁ EARTH - 'varclubsuit': u'\u2667', # ♧ WHITE CLUB SUIT - 'vardiamondsuit': u'\u2666', # ♦ BLACK DIAMOND SUIT - 'varheartsuit': u'\u2665', # ♥ BLACK HEART SUIT - 'varspadesuit': u'\u2664', # ♤ WHITE SPADE SUIT - 'virgo': u'\u264d', # ♍ VIRGO - 'wasylozenge': u'\u2311', # ⌑ SQUARE LOZENGE - 'yen': u'\xa5', # ¥ YEN SIGN + '#': '#', # # NUMBER SIGN + '$': '$', # $ DOLLAR SIGN + '%': '%', # % PERCENT SIGN + '&': '&', # & AMPERSAND + 'AC': '\u223f', # ∿ SINE WAVE + 'APLcomment': '\u235d', # ⍝ APL FUNCTIONAL SYMBOL UP SHOE JOT + 'APLdownarrowbox': '\u2357', # ⍗ APL FUNCTIONAL SYMBOL QUAD DOWNWARDS ARROW + 'APLinput': '\u235e', # ⍞ APL FUNCTIONAL SYMBOL QUOTE QUAD + 'APLinv': '\u2339', # ⌹ APL FUNCTIONAL SYMBOL QUAD DIVIDE + 'APLleftarrowbox': '\u2347', # ⍇ APL FUNCTIONAL SYMBOL QUAD LEFTWARDS ARROW + 'APLlog': '\u235f', # ⍟ APL FUNCTIONAL SYMBOL CIRCLE STAR + 'APLrightarrowbox': '\u2348', # ⍈ APL FUNCTIONAL SYMBOL QUAD RIGHTWARDS ARROW + 'APLuparrowbox': '\u2350', # ⍐ APL FUNCTIONAL SYMBOL QUAD UPWARDS ARROW + 'Aries': '\u2648', # ♈ ARIES + 'Box': '\u2b1c', # ⬜ WHITE LARGE SQUARE + 'CIRCLE': '\u25cf', # ● BLACK CIRCLE + 'CheckedBox': '\u2611', # ☑ BALLOT BOX WITH CHECK + 'Diamond': '\u25c7', # ◇ WHITE DIAMOND + 'Diamondblack': '\u25c6', # ◆ BLACK DIAMOND + 'Diamonddot': '\u27d0', # ⟐ WHITE DIAMOND WITH CENTRED DOT + 'Finv': '\u2132', # Ⅎ TURNED CAPITAL F + 'Game': '\u2141', # ⅁ TURNED SANS-SERIF CAPITAL G + 'Gemini': '\u264a', # ♊ GEMINI + 'Jupiter': '\u2643', # ♃ JUPITER + 'LEFTCIRCLE': '\u25d6', # ◖ LEFT HALF BLACK CIRCLE + 'LEFTcircle': '\u25d0', # ◐ CIRCLE WITH LEFT HALF BLACK + 'Leo': '\u264c', # ♌ LEO + 'Libra': '\u264e', # ♎ LIBRA + 'Mars': '\u2642', # ♂ MALE SIGN + 'Mercury': '\u263f', # ☿ MERCURY + 'Neptune': '\u2646', # ♆ NEPTUNE + 'P': '\xb6', # ¶ PILCROW SIGN + 'Pluto': '\u2647', # ♇ PLUTO + 'RIGHTCIRCLE': '\u25d7', # ◗ RIGHT HALF BLACK CIRCLE + 'RIGHTcircle': '\u25d1', # ◑ CIRCLE WITH RIGHT HALF BLACK + 'S': '\xa7', # § SECTION SIGN + 'Saturn': '\u2644', # ♄ SATURN + 'Scorpio': '\u264f', # ♏ SCORPIUS + 'Square': '\u2610', # ☐ BALLOT BOX + 'Sun': '\u2609', # ☉ SUN + 'Taurus': '\u2649', # ♉ TAURUS + 'Uranus': '\u2645', # ♅ URANUS + 'Venus': '\u2640', # ♀ FEMALE SIGN + 'XBox': '\u2612', # ☒ BALLOT BOX WITH X + 'Yup': '\u2144', # ⅄ TURNED SANS-SERIF CAPITAL Y + '_': '_', # _ LOW LINE + 'angle': '\u2220', # ∠ ANGLE + 'aquarius': '\u2652', # ♒ AQUARIUS + 'aries': '\u2648', # ♈ ARIES + 'arrowvert': '\u23d0', # ⏐ VERTICAL LINE EXTENSION + 'backprime': '\u2035', # ‵ REVERSED PRIME + 'backslash': '\\', # \ REVERSE SOLIDUS + 'bigstar': '\u2605', # ★ BLACK STAR + 'blacksmiley': '\u263b', # ☻ BLACK SMILING FACE + 'blacksquare': '\u25fc', # ◼ BLACK MEDIUM SQUARE + 'blacktriangle': '\u25b4', # ▴ BLACK UP-POINTING SMALL TRIANGLE + 'blacktriangledown': '\u25be', # ▾ BLACK DOWN-POINTING SMALL TRIANGLE + 'blacktriangleup': '\u25b4', # ▴ BLACK UP-POINTING SMALL TRIANGLE + 'bot': '\u22a5', # ⊥ UP TACK + 'boy': '\u2642', # ♂ MALE SIGN + 'bracevert': '\u23aa', # ⎪ CURLY BRACKET EXTENSION + 'cancer': '\u264b', # ♋ CANCER + 'capricornus': '\u2651', # ♑ CAPRICORN + 'cdots': '\u22ef', # ⋯ MIDLINE HORIZONTAL ELLIPSIS + 'cent': '\xa2', # ¢ CENT SIGN + 'checkmark': '\u2713', # ✓ CHECK MARK + 'circledR': '\u24c7', # Ⓡ CIRCLED LATIN CAPITAL LETTER R + 'circledS': '\u24c8', # Ⓢ CIRCLED LATIN CAPITAL LETTER S + 'clubsuit': '\u2663', # ♣ BLACK CLUB SUIT + 'complement': '\u2201', # ∁ COMPLEMENT + 'diagdown': '\u27cd', # ⟍ MATHEMATICAL FALLING DIAGONAL + 'diagup': '\u27cb', # ⟋ MATHEMATICAL RISING DIAGONAL + 'diameter': '\u2300', # ⌀ DIAMETER SIGN + 'diamondsuit': '\u2662', # ♢ WHITE DIAMOND SUIT + 'earth': '\u2641', # ♁ EARTH + 'emptyset': '\u2205', # ∅ EMPTY SET + 'exists': '\u2203', # ∃ THERE EXISTS + 'female': '\u2640', # ♀ FEMALE SIGN + 'flat': '\u266d', # ♭ MUSIC FLAT SIGN + 'forall': '\u2200', # ∀ FOR ALL + 'fourth': '\u2057', # ⁗ QUADRUPLE PRIME + 'frownie': '\u2639', # ☹ WHITE FROWNING FACE + 'gemini': '\u264a', # ♊ GEMINI + 'girl': '\u2640', # ♀ FEMALE SIGN + 'heartsuit': '\u2661', # ♡ WHITE HEART SUIT + 'infty': '\u221e', # ∞ INFINITY + 'invdiameter': '\u2349', # ⍉ APL FUNCTIONAL SYMBOL CIRCLE BACKSLASH + 'invneg': '\u2310', # ⌐ REVERSED NOT SIGN + 'jupiter': '\u2643', # ♃ JUPITER + 'ldots': '\u2026', # … HORIZONTAL ELLIPSIS + 'leftmoon': '\u263e', # ☾ LAST QUARTER MOON + 'leo': '\u264c', # ♌ LEO + 'libra': '\u264e', # ♎ LIBRA + 'lmoustache': '\u23b0', # ⎰ UPPER LEFT OR LOWER RIGHT CURLY BRACKET SECTION + 'lnot': '\xac', # ¬ NOT SIGN + 'lozenge': '\u25ca', # ◊ LOZENGE + 'male': '\u2642', # ♂ MALE SIGN + 'maltese': '\u2720', # ✠ MALTESE CROSS + 'mathcent': '\xa2', # ¢ CENT SIGN + 'mathdollar': '$', # $ DOLLAR SIGN + 'mathsterling': '\xa3', # £ POUND SIGN + 'measuredangle': '\u2221', # ∡ MEASURED ANGLE + 'medbullet': '\u26ab', # ⚫ MEDIUM BLACK CIRCLE + 'medcirc': '\u26aa', # ⚪ MEDIUM WHITE CIRCLE + 'mercury': '\u263f', # ☿ MERCURY + 'mho': '\u2127', # ℧ INVERTED OHM SIGN + 'nabla': '\u2207', # ∇ NABLA + 'natural': '\u266e', # ♮ MUSIC NATURAL SIGN + 'neg': '\xac', # ¬ NOT SIGN + 'neptune': '\u2646', # ♆ NEPTUNE + 'nexists': '\u2204', # ∄ THERE DOES NOT EXIST + 'notbackslash': '\u2340', # ⍀ APL FUNCTIONAL SYMBOL BACKSLASH BAR + 'partial': '\u2202', # ∂ PARTIAL DIFFERENTIAL + 'pisces': '\u2653', # ♓ PISCES + 'pluto': '\u2647', # ♇ PLUTO + 'pounds': '\xa3', # £ POUND SIGN + 'prime': '\u2032', # ′ PRIME + 'quarternote': '\u2669', # ♩ QUARTER NOTE + 'rightmoon': '\u263d', # ☽ FIRST QUARTER MOON + 'rmoustache': '\u23b1', # ⎱ UPPER RIGHT OR LOWER LEFT CURLY BRACKET SECTION + 'sagittarius': '\u2650', # ♐ SAGITTARIUS + 'saturn': '\u2644', # ♄ SATURN + 'scorpio': '\u264f', # ♏ SCORPIUS + 'second': '\u2033', # ″ DOUBLE PRIME + 'sharp': '\u266f', # ♯ MUSIC SHARP SIGN + 'smiley': '\u263a', # ☺ WHITE SMILING FACE + 'spadesuit': '\u2660', # ♠ BLACK SPADE SUIT + 'spddot': '\xa8', # ¨ DIAERESIS + 'sphat': '^', # ^ CIRCUMFLEX ACCENT + 'sphericalangle': '\u2222', # ∢ SPHERICAL ANGLE + 'sptilde': '~', # ~ TILDE + 'square': '\u25fb', # ◻ WHITE MEDIUM SQUARE + 'sun': '\u263c', # ☼ WHITE SUN WITH RAYS + 'surd': '\u221a', # √ SQUARE ROOT + 'taurus': '\u2649', # ♉ TAURUS + 'third': '\u2034', # ‴ TRIPLE PRIME + 'top': '\u22a4', # ⊤ DOWN TACK + 'twonotes': '\u266b', # ♫ BEAMED EIGHTH NOTES + 'uranus': '\u2645', # ♅ URANUS + 'varEarth': '\u2641', # ♁ EARTH + 'varclubsuit': '\u2667', # ♧ WHITE CLUB SUIT + 'vardiamondsuit': '\u2666', # ♦ BLACK DIAMOND SUIT + 'varheartsuit': '\u2665', # ♥ BLACK HEART SUIT + 'varspadesuit': '\u2664', # ♤ WHITE SPADE SUIT + 'virgo': '\u264d', # ♍ VIRGO + 'wasylozenge': '\u2311', # ⌑ SQUARE LOZENGE + 'yen': '\xa5', # ¥ YEN SIGN } mathover = { - 'overbrace': u'\u23de', # ⏞ TOP CURLY BRACKET - 'wideparen': u'\u23dc', # ⏜ TOP PARENTHESIS + 'overbrace': '\u23de', # ⏞ TOP CURLY BRACKET + 'wideparen': '\u23dc', # ⏜ TOP PARENTHESIS } mathpunct = { - 'ddots': u'\u22f1', # ⋱ DOWN RIGHT DIAGONAL ELLIPSIS - 'vdots': u'\u22ee', # ⋮ VERTICAL ELLIPSIS + 'ddots': '\u22f1', # ⋱ DOWN RIGHT DIAGONAL ELLIPSIS + 'vdots': '\u22ee', # ⋮ VERTICAL ELLIPSIS } mathradical = { - 'sqrt[3]': u'\u221b', # ∛ CUBE ROOT - 'sqrt[4]': u'\u221c', # ∜ FOURTH ROOT + 'sqrt[3]': '\u221b', # ∛ CUBE ROOT + 'sqrt[4]': '\u221c', # ∜ FOURTH ROOT } mathrel = { - 'Bot': u'\u2aeb', # ⫫ DOUBLE UP TACK - 'Bumpeq': u'\u224e', # ≎ GEOMETRICALLY EQUIVALENT TO - 'Coloneqq': u'\u2a74', # ⩴ DOUBLE COLON EQUAL - 'Doteq': u'\u2251', # ≑ GEOMETRICALLY EQUAL TO - 'Downarrow': u'\u21d3', # ⇓ DOWNWARDS DOUBLE ARROW - 'Leftarrow': u'\u21d0', # ⇐ LEFTWARDS DOUBLE ARROW - 'Leftrightarrow': u'\u21d4', # ⇔ LEFT RIGHT DOUBLE ARROW - 'Lleftarrow': u'\u21da', # ⇚ LEFTWARDS TRIPLE ARROW - 'Longleftarrow': u'\u27f8', # ⟸ LONG LEFTWARDS DOUBLE ARROW - 'Longleftrightarrow': u'\u27fa', # ⟺ LONG LEFT RIGHT DOUBLE ARROW - 'Longmapsfrom': u'\u27fd', # ⟽ LONG LEFTWARDS DOUBLE ARROW FROM BAR - 'Longmapsto': u'\u27fe', # ⟾ LONG RIGHTWARDS DOUBLE ARROW FROM BAR - 'Longrightarrow': u'\u27f9', # ⟹ LONG RIGHTWARDS DOUBLE ARROW - 'Lsh': u'\u21b0', # ↰ UPWARDS ARROW WITH TIP LEFTWARDS - 'Mapsfrom': u'\u2906', # ⤆ LEFTWARDS DOUBLE ARROW FROM BAR - 'Mapsto': u'\u2907', # ⤇ RIGHTWARDS DOUBLE ARROW FROM BAR - 'Nearrow': u'\u21d7', # ⇗ NORTH EAST DOUBLE ARROW - 'Nwarrow': u'\u21d6', # ⇖ NORTH WEST DOUBLE ARROW - 'Perp': u'\u2aeb', # ⫫ DOUBLE UP TACK - 'Rightarrow': u'\u21d2', # ⇒ RIGHTWARDS DOUBLE ARROW - 'Rrightarrow': u'\u21db', # ⇛ RIGHTWARDS TRIPLE ARROW - 'Rsh': u'\u21b1', # ↱ UPWARDS ARROW WITH TIP RIGHTWARDS - 'Searrow': u'\u21d8', # ⇘ SOUTH EAST DOUBLE ARROW - 'Subset': u'\u22d0', # ⋐ DOUBLE SUBSET - 'Supset': u'\u22d1', # ⋑ DOUBLE SUPERSET - 'Swarrow': u'\u21d9', # ⇙ SOUTH WEST DOUBLE ARROW - 'Top': u'\u2aea', # ⫪ DOUBLE DOWN TACK - 'Uparrow': u'\u21d1', # ⇑ UPWARDS DOUBLE ARROW - 'Updownarrow': u'\u21d5', # ⇕ UP DOWN DOUBLE ARROW - 'VDash': u'\u22ab', # ⊫ DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE - 'Vdash': u'\u22a9', # ⊩ FORCES - 'Vvdash': u'\u22aa', # ⊪ TRIPLE VERTICAL BAR RIGHT TURNSTILE - 'apprge': u'\u2273', # ≳ GREATER-THAN OR EQUIVALENT TO - 'apprle': u'\u2272', # ≲ LESS-THAN OR EQUIVALENT TO - 'approx': u'\u2248', # ≈ ALMOST EQUAL TO - 'approxeq': u'\u224a', # ≊ ALMOST EQUAL OR EQUAL TO - 'asymp': u'\u224d', # ≍ EQUIVALENT TO - 'backepsilon': u'\u220d', # ∍ SMALL CONTAINS AS MEMBER - 'backsim': u'\u223d', # ∽ REVERSED TILDE - 'backsimeq': u'\u22cd', # ⋍ REVERSED TILDE EQUALS - 'barin': u'\u22f6', # ⋶ ELEMENT OF WITH OVERBAR - 'barleftharpoon': u'\u296b', # ⥫ LEFTWARDS HARPOON WITH BARB DOWN BELOW LONG DASH - 'barrightharpoon': u'\u296d', # ⥭ RIGHTWARDS HARPOON WITH BARB DOWN BELOW LONG DASH - 'because': u'\u2235', # ∵ BECAUSE - 'between': u'\u226c', # ≬ BETWEEN - 'blacktriangleleft': u'\u25c2', # ◂ BLACK LEFT-POINTING SMALL TRIANGLE - 'blacktriangleright': u'\u25b8', # ▸ BLACK RIGHT-POINTING SMALL TRIANGLE - 'bowtie': u'\u22c8', # ⋈ BOWTIE - 'bumpeq': u'\u224f', # ≏ DIFFERENCE BETWEEN - 'circeq': u'\u2257', # ≗ RING EQUAL TO - 'circlearrowleft': u'\u21ba', # ↺ ANTICLOCKWISE OPEN CIRCLE ARROW - 'circlearrowright': u'\u21bb', # ↻ CLOCKWISE OPEN CIRCLE ARROW - 'coloneq': u'\u2254', # ≔ COLON EQUALS - 'coloneqq': u'\u2254', # ≔ COLON EQUALS - 'cong': u'\u2245', # ≅ APPROXIMATELY EQUAL TO - 'corresponds': u'\u2259', # ≙ ESTIMATES - 'curlyeqprec': u'\u22de', # ⋞ EQUAL TO OR PRECEDES - 'curlyeqsucc': u'\u22df', # ⋟ EQUAL TO OR SUCCEEDS - 'curvearrowleft': u'\u21b6', # ↶ ANTICLOCKWISE TOP SEMICIRCLE ARROW - 'curvearrowright': u'\u21b7', # ↷ CLOCKWISE TOP SEMICIRCLE ARROW - 'dasharrow': u'\u21e2', # ⇢ RIGHTWARDS DASHED ARROW - 'dashleftarrow': u'\u21e0', # ⇠ LEFTWARDS DASHED ARROW - 'dashrightarrow': u'\u21e2', # ⇢ RIGHTWARDS DASHED ARROW - 'dashv': u'\u22a3', # ⊣ LEFT TACK - 'dlsh': u'\u21b2', # ↲ DOWNWARDS ARROW WITH TIP LEFTWARDS - 'doteq': u'\u2250', # ≐ APPROACHES THE LIMIT - 'doteqdot': u'\u2251', # ≑ GEOMETRICALLY EQUAL TO - 'downarrow': u'\u2193', # ↓ DOWNWARDS ARROW - 'downdownarrows': u'\u21ca', # ⇊ DOWNWARDS PAIRED ARROWS - 'downdownharpoons': u'\u2965', # ⥥ DOWNWARDS HARPOON WITH BARB LEFT BESIDE DOWNWARDS HARPOON WITH BARB RIGHT - 'downharpoonleft': u'\u21c3', # ⇃ DOWNWARDS HARPOON WITH BARB LEFTWARDS - 'downharpoonright': u'\u21c2', # ⇂ DOWNWARDS HARPOON WITH BARB RIGHTWARDS - 'downuparrows': u'\u21f5', # ⇵ DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW - 'downupharpoons': u'\u296f', # ⥯ DOWNWARDS HARPOON WITH BARB LEFT BESIDE UPWARDS HARPOON WITH BARB RIGHT - 'drsh': u'\u21b3', # ↳ DOWNWARDS ARROW WITH TIP RIGHTWARDS - 'eqcirc': u'\u2256', # ≖ RING IN EQUAL TO - 'eqcolon': u'\u2255', # ≕ EQUALS COLON - 'eqqcolon': u'\u2255', # ≕ EQUALS COLON - 'eqsim': u'\u2242', # ≂ MINUS TILDE - 'eqslantgtr': u'\u2a96', # ⪖ SLANTED EQUAL TO OR GREATER-THAN - 'eqslantless': u'\u2a95', # ⪕ SLANTED EQUAL TO OR LESS-THAN - 'equiv': u'\u2261', # ≡ IDENTICAL TO - 'fallingdotseq': u'\u2252', # ≒ APPROXIMATELY EQUAL TO OR THE IMAGE OF - 'frown': u'\u2322', # ⌢ FROWN - 'ge': u'\u2265', # ≥ GREATER-THAN OR EQUAL TO - 'geq': u'\u2265', # ≥ GREATER-THAN OR EQUAL TO - 'geqq': u'\u2267', # ≧ GREATER-THAN OVER EQUAL TO - 'geqslant': u'\u2a7e', # ⩾ GREATER-THAN OR SLANTED EQUAL TO - 'gets': u'\u2190', # ← LEFTWARDS ARROW - 'gg': u'\u226b', # ≫ MUCH GREATER-THAN - 'ggcurly': u'\u2abc', # ⪼ DOUBLE SUCCEEDS - 'ggg': u'\u22d9', # ⋙ VERY MUCH GREATER-THAN - 'gggtr': u'\u22d9', # ⋙ VERY MUCH GREATER-THAN - 'gnapprox': u'\u2a8a', # ⪊ GREATER-THAN AND NOT APPROXIMATE - 'gneq': u'\u2a88', # ⪈ GREATER-THAN AND SINGLE-LINE NOT EQUAL TO - 'gneqq': u'\u2269', # ≩ GREATER-THAN BUT NOT EQUAL TO - 'gnsim': u'\u22e7', # ⋧ GREATER-THAN BUT NOT EQUIVALENT TO - 'gtrapprox': u'\u2a86', # ⪆ GREATER-THAN OR APPROXIMATE - 'gtreqless': u'\u22db', # ⋛ GREATER-THAN EQUAL TO OR LESS-THAN - 'gtreqqless': u'\u2a8c', # ⪌ GREATER-THAN ABOVE DOUBLE-LINE EQUAL ABOVE LESS-THAN - 'gtrless': u'\u2277', # ≷ GREATER-THAN OR LESS-THAN - 'gtrsim': u'\u2273', # ≳ GREATER-THAN OR EQUIVALENT TO - 'hash': u'\u22d5', # ⋕ EQUAL AND PARALLEL TO - 'hookleftarrow': u'\u21a9', # ↩ LEFTWARDS ARROW WITH HOOK - 'hookrightarrow': u'\u21aa', # ↪ RIGHTWARDS ARROW WITH HOOK - 'iddots': u'\u22f0', # ⋰ UP RIGHT DIAGONAL ELLIPSIS - 'impliedby': u'\u27f8', # ⟸ LONG LEFTWARDS DOUBLE ARROW - 'implies': u'\u27f9', # ⟹ LONG RIGHTWARDS DOUBLE ARROW - 'in': u'\u2208', # ∈ ELEMENT OF - 'le': u'\u2264', # ≤ LESS-THAN OR EQUAL TO - 'leadsto': u'\u2933', # ⤳ WAVE ARROW POINTING DIRECTLY RIGHT - 'leftarrow': u'\u2190', # ← LEFTWARDS ARROW - 'leftarrowtail': u'\u21a2', # ↢ LEFTWARDS ARROW WITH TAIL - 'leftarrowtriangle': u'\u21fd', # ⇽ LEFTWARDS OPEN-HEADED ARROW - 'leftbarharpoon': u'\u296a', # ⥪ LEFTWARDS HARPOON WITH BARB UP ABOVE LONG DASH - 'leftharpoondown': u'\u21bd', # ↽ LEFTWARDS HARPOON WITH BARB DOWNWARDS - 'leftharpoonup': u'\u21bc', # ↼ LEFTWARDS HARPOON WITH BARB UPWARDS - 'leftleftarrows': u'\u21c7', # ⇇ LEFTWARDS PAIRED ARROWS - 'leftleftharpoons': u'\u2962', # ⥢ LEFTWARDS HARPOON WITH BARB UP ABOVE LEFTWARDS HARPOON WITH BARB DOWN - 'leftrightarrow': u'\u2194', # ↔ LEFT RIGHT ARROW - 'leftrightarrows': u'\u21c6', # ⇆ LEFTWARDS ARROW OVER RIGHTWARDS ARROW - 'leftrightarrowtriangle': u'\u21ff', # ⇿ LEFT RIGHT OPEN-HEADED ARROW - 'leftrightharpoon': u'\u294a', # ⥊ LEFT BARB UP RIGHT BARB DOWN HARPOON - 'leftrightharpoons': u'\u21cb', # ⇋ LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON - 'leftrightsquigarrow': u'\u21ad', # ↭ LEFT RIGHT WAVE ARROW - 'leftslice': u'\u2aa6', # ⪦ LESS-THAN CLOSED BY CURVE - 'leftsquigarrow': u'\u21dc', # ⇜ LEFTWARDS SQUIGGLE ARROW - 'leftturn': u'\u21ba', # ↺ ANTICLOCKWISE OPEN CIRCLE ARROW - 'leq': u'\u2264', # ≤ LESS-THAN OR EQUAL TO - 'leqq': u'\u2266', # ≦ LESS-THAN OVER EQUAL TO - 'leqslant': u'\u2a7d', # ⩽ LESS-THAN OR SLANTED EQUAL TO - 'lessapprox': u'\u2a85', # ⪅ LESS-THAN OR APPROXIMATE - 'lesseqgtr': u'\u22da', # ⋚ LESS-THAN EQUAL TO OR GREATER-THAN - 'lesseqqgtr': u'\u2a8b', # ⪋ LESS-THAN ABOVE DOUBLE-LINE EQUAL ABOVE GREATER-THAN - 'lessgtr': u'\u2276', # ≶ LESS-THAN OR GREATER-THAN - 'lesssim': u'\u2272', # ≲ LESS-THAN OR EQUIVALENT TO - 'lhd': u'\u22b2', # ⊲ NORMAL SUBGROUP OF - 'lightning': u'\u21af', # ↯ DOWNWARDS ZIGZAG ARROW - 'll': u'\u226a', # ≪ MUCH LESS-THAN - 'llcurly': u'\u2abb', # ⪻ DOUBLE PRECEDES - 'lll': u'\u22d8', # ⋘ VERY MUCH LESS-THAN - 'llless': u'\u22d8', # ⋘ VERY MUCH LESS-THAN - 'lnapprox': u'\u2a89', # ⪉ LESS-THAN AND NOT APPROXIMATE - 'lneq': u'\u2a87', # ⪇ LESS-THAN AND SINGLE-LINE NOT EQUAL TO - 'lneqq': u'\u2268', # ≨ LESS-THAN BUT NOT EQUAL TO - 'lnsim': u'\u22e6', # ⋦ LESS-THAN BUT NOT EQUIVALENT TO - 'longleftarrow': u'\u27f5', # ⟵ LONG LEFTWARDS ARROW - 'longleftrightarrow': u'\u27f7', # ⟷ LONG LEFT RIGHT ARROW - 'longmapsfrom': u'\u27fb', # ⟻ LONG LEFTWARDS ARROW FROM BAR - 'longmapsto': u'\u27fc', # ⟼ LONG RIGHTWARDS ARROW FROM BAR - 'longrightarrow': u'\u27f6', # ⟶ LONG RIGHTWARDS ARROW - 'looparrowleft': u'\u21ab', # ↫ LEFTWARDS ARROW WITH LOOP - 'looparrowright': u'\u21ac', # ↬ RIGHTWARDS ARROW WITH LOOP - 'lrtimes': u'\u22c8', # ⋈ BOWTIE - 'mapsfrom': u'\u21a4', # ↤ LEFTWARDS ARROW FROM BAR - 'mapsto': u'\u21a6', # ↦ RIGHTWARDS ARROW FROM BAR - 'mid': u'\u2223', # ∣ DIVIDES - 'models': u'\u22a7', # ⊧ MODELS - 'multimap': u'\u22b8', # ⊸ MULTIMAP - 'multimapboth': u'\u29df', # ⧟ DOUBLE-ENDED MULTIMAP - 'multimapdotbothA': u'\u22b6', # ⊶ ORIGINAL OF - 'multimapdotbothB': u'\u22b7', # ⊷ IMAGE OF - 'multimapinv': u'\u27dc', # ⟜ LEFT MULTIMAP - 'nLeftarrow': u'\u21cd', # ⇍ LEFTWARDS DOUBLE ARROW WITH STROKE - 'nLeftrightarrow': u'\u21ce', # ⇎ LEFT RIGHT DOUBLE ARROW WITH STROKE - 'nRightarrow': u'\u21cf', # ⇏ RIGHTWARDS DOUBLE ARROW WITH STROKE - 'nVDash': u'\u22af', # ⊯ NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE - 'nVdash': u'\u22ae', # ⊮ DOES NOT FORCE - 'ncong': u'\u2247', # ≇ NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO - 'ne': u'\u2260', # ≠ NOT EQUAL TO - 'nearrow': u'\u2197', # ↗ NORTH EAST ARROW - 'neq': u'\u2260', # ≠ NOT EQUAL TO - 'ngeq': u'\u2271', # ≱ NEITHER GREATER-THAN NOR EQUAL TO - 'ngtr': u'\u226f', # ≯ NOT GREATER-THAN - 'ngtrless': u'\u2279', # ≹ NEITHER GREATER-THAN NOR LESS-THAN - 'ni': u'\u220b', # ∋ CONTAINS AS MEMBER - 'nleftarrow': u'\u219a', # ↚ LEFTWARDS ARROW WITH STROKE - 'nleftrightarrow': u'\u21ae', # ↮ LEFT RIGHT ARROW WITH STROKE - 'nleq': u'\u2270', # ≰ NEITHER LESS-THAN NOR EQUAL TO - 'nless': u'\u226e', # ≮ NOT LESS-THAN - 'nlessgtr': u'\u2278', # ≸ NEITHER LESS-THAN NOR GREATER-THAN - 'nmid': u'\u2224', # ∤ DOES NOT DIVIDE - 'notasymp': u'\u226d', # ≭ NOT EQUIVALENT TO - 'notin': u'\u2209', # ∉ NOT AN ELEMENT OF - 'notni': u'\u220c', # ∌ DOES NOT CONTAIN AS MEMBER - 'notowner': u'\u220c', # ∌ DOES NOT CONTAIN AS MEMBER - 'notslash': u'\u233f', # ⌿ APL FUNCTIONAL SYMBOL SLASH BAR - 'nparallel': u'\u2226', # ∦ NOT PARALLEL TO - 'nprec': u'\u2280', # ⊀ DOES NOT PRECEDE - 'npreceq': u'\u22e0', # ⋠ DOES NOT PRECEDE OR EQUAL - 'nrightarrow': u'\u219b', # ↛ RIGHTWARDS ARROW WITH STROKE - 'nsim': u'\u2241', # ≁ NOT TILDE - 'nsimeq': u'\u2244', # ≄ NOT ASYMPTOTICALLY EQUAL TO - 'nsubseteq': u'\u2288', # ⊈ NEITHER A SUBSET OF NOR EQUAL TO - 'nsucc': u'\u2281', # ⊁ DOES NOT SUCCEED - 'nsucceq': u'\u22e1', # ⋡ DOES NOT SUCCEED OR EQUAL - 'nsupseteq': u'\u2289', # ⊉ NEITHER A SUPERSET OF NOR EQUAL TO - 'ntriangleleft': u'\u22ea', # ⋪ NOT NORMAL SUBGROUP OF - 'ntrianglelefteq': u'\u22ec', # ⋬ NOT NORMAL SUBGROUP OF OR EQUAL TO - 'ntriangleright': u'\u22eb', # ⋫ DOES NOT CONTAIN AS NORMAL SUBGROUP - 'ntrianglerighteq': u'\u22ed', # ⋭ DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL - 'nvDash': u'\u22ad', # ⊭ NOT TRUE - 'nvdash': u'\u22ac', # ⊬ DOES NOT PROVE - 'nwarrow': u'\u2196', # ↖ NORTH WEST ARROW - 'owns': u'\u220b', # ∋ CONTAINS AS MEMBER - 'parallel': u'\u2225', # ∥ PARALLEL TO - 'perp': u'\u27c2', # ⟂ PERPENDICULAR - 'pitchfork': u'\u22d4', # ⋔ PITCHFORK - 'prec': u'\u227a', # ≺ PRECEDES - 'precapprox': u'\u2ab7', # ⪷ PRECEDES ABOVE ALMOST EQUAL TO - 'preccurlyeq': u'\u227c', # ≼ PRECEDES OR EQUAL TO - 'preceq': u'\u2aaf', # ⪯ PRECEDES ABOVE SINGLE-LINE EQUALS SIGN - 'preceqq': u'\u2ab3', # ⪳ PRECEDES ABOVE EQUALS SIGN - 'precnapprox': u'\u2ab9', # ⪹ PRECEDES ABOVE NOT ALMOST EQUAL TO - 'precneqq': u'\u2ab5', # ⪵ PRECEDES ABOVE NOT EQUAL TO - 'precnsim': u'\u22e8', # ⋨ PRECEDES BUT NOT EQUIVALENT TO - 'precsim': u'\u227e', # ≾ PRECEDES OR EQUIVALENT TO - 'propto': u'\u221d', # ∝ PROPORTIONAL TO - 'restriction': u'\u21be', # ↾ UPWARDS HARPOON WITH BARB RIGHTWARDS - 'rhd': u'\u22b3', # ⊳ CONTAINS AS NORMAL SUBGROUP - 'rightarrow': u'\u2192', # → RIGHTWARDS ARROW - 'rightarrowtail': u'\u21a3', # ↣ RIGHTWARDS ARROW WITH TAIL - 'rightarrowtriangle': u'\u21fe', # ⇾ RIGHTWARDS OPEN-HEADED ARROW - 'rightbarharpoon': u'\u296c', # ⥬ RIGHTWARDS HARPOON WITH BARB UP ABOVE LONG DASH - 'rightharpoondown': u'\u21c1', # ⇁ RIGHTWARDS HARPOON WITH BARB DOWNWARDS - 'rightharpoonup': u'\u21c0', # ⇀ RIGHTWARDS HARPOON WITH BARB UPWARDS - 'rightleftarrows': u'\u21c4', # ⇄ RIGHTWARDS ARROW OVER LEFTWARDS ARROW - 'rightleftharpoon': u'\u294b', # ⥋ LEFT BARB DOWN RIGHT BARB UP HARPOON - 'rightleftharpoons': u'\u21cc', # ⇌ RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON - 'rightrightarrows': u'\u21c9', # ⇉ RIGHTWARDS PAIRED ARROWS - 'rightrightharpoons': u'\u2964', # ⥤ RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN - 'rightslice': u'\u2aa7', # ⪧ GREATER-THAN CLOSED BY CURVE - 'rightsquigarrow': u'\u21dd', # ⇝ RIGHTWARDS SQUIGGLE ARROW - 'rightturn': u'\u21bb', # ↻ CLOCKWISE OPEN CIRCLE ARROW - 'risingdotseq': u'\u2253', # ≓ IMAGE OF OR APPROXIMATELY EQUAL TO - 'searrow': u'\u2198', # ↘ SOUTH EAST ARROW - 'sim': u'\u223c', # ∼ TILDE OPERATOR - 'simeq': u'\u2243', # ≃ ASYMPTOTICALLY EQUAL TO - 'smile': u'\u2323', # ⌣ SMILE - 'sqsubset': u'\u228f', # ⊏ SQUARE IMAGE OF - 'sqsubseteq': u'\u2291', # ⊑ SQUARE IMAGE OF OR EQUAL TO - 'sqsupset': u'\u2290', # ⊐ SQUARE ORIGINAL OF - 'sqsupseteq': u'\u2292', # ⊒ SQUARE ORIGINAL OF OR EQUAL TO - 'strictfi': u'\u297c', # ⥼ LEFT FISH TAIL - 'strictif': u'\u297d', # ⥽ RIGHT FISH TAIL - 'subset': u'\u2282', # ⊂ SUBSET OF - 'subseteq': u'\u2286', # ⊆ SUBSET OF OR EQUAL TO - 'subseteqq': u'\u2ac5', # ⫅ SUBSET OF ABOVE EQUALS SIGN - 'subsetneq': u'\u228a', # ⊊ SUBSET OF WITH NOT EQUAL TO - 'subsetneqq': u'\u2acb', # ⫋ SUBSET OF ABOVE NOT EQUAL TO - 'succ': u'\u227b', # ≻ SUCCEEDS - 'succapprox': u'\u2ab8', # ⪸ SUCCEEDS ABOVE ALMOST EQUAL TO - 'succcurlyeq': u'\u227d', # ≽ SUCCEEDS OR EQUAL TO - 'succeq': u'\u2ab0', # ⪰ SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN - 'succeqq': u'\u2ab4', # ⪴ SUCCEEDS ABOVE EQUALS SIGN - 'succnapprox': u'\u2aba', # ⪺ SUCCEEDS ABOVE NOT ALMOST EQUAL TO - 'succneqq': u'\u2ab6', # ⪶ SUCCEEDS ABOVE NOT EQUAL TO - 'succnsim': u'\u22e9', # ⋩ SUCCEEDS BUT NOT EQUIVALENT TO - 'succsim': u'\u227f', # ≿ SUCCEEDS OR EQUIVALENT TO - 'supset': u'\u2283', # ⊃ SUPERSET OF - 'supseteq': u'\u2287', # ⊇ SUPERSET OF OR EQUAL TO - 'supseteqq': u'\u2ac6', # ⫆ SUPERSET OF ABOVE EQUALS SIGN - 'supsetneq': u'\u228b', # ⊋ SUPERSET OF WITH NOT EQUAL TO - 'supsetneqq': u'\u2acc', # ⫌ SUPERSET OF ABOVE NOT EQUAL TO - 'swarrow': u'\u2199', # ↙ SOUTH WEST ARROW - 'therefore': u'\u2234', # ∴ THEREFORE - 'to': u'\u2192', # → RIGHTWARDS ARROW - 'trianglelefteq': u'\u22b4', # ⊴ NORMAL SUBGROUP OF OR EQUAL TO - 'triangleq': u'\u225c', # ≜ DELTA EQUAL TO - 'trianglerighteq': u'\u22b5', # ⊵ CONTAINS AS NORMAL SUBGROUP OR EQUAL TO - 'twoheadleftarrow': u'\u219e', # ↞ LEFTWARDS TWO HEADED ARROW - 'twoheadrightarrow': u'\u21a0', # ↠ RIGHTWARDS TWO HEADED ARROW - 'uparrow': u'\u2191', # ↑ UPWARDS ARROW - 'updownarrow': u'\u2195', # ↕ UP DOWN ARROW - 'updownarrows': u'\u21c5', # ⇅ UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW - 'updownharpoons': u'\u296e', # ⥮ UPWARDS HARPOON WITH BARB LEFT BESIDE DOWNWARDS HARPOON WITH BARB RIGHT - 'upharpoonleft': u'\u21bf', # ↿ UPWARDS HARPOON WITH BARB LEFTWARDS - 'upharpoonright': u'\u21be', # ↾ UPWARDS HARPOON WITH BARB RIGHTWARDS - 'upuparrows': u'\u21c8', # ⇈ UPWARDS PAIRED ARROWS - 'upupharpoons': u'\u2963', # ⥣ UPWARDS HARPOON WITH BARB LEFT BESIDE UPWARDS HARPOON WITH BARB RIGHT - 'vDash': u'\u22a8', # ⊨ TRUE - 'vartriangle': u'\u25b5', # ▵ WHITE UP-POINTING SMALL TRIANGLE - 'vartriangleleft': u'\u22b2', # ⊲ NORMAL SUBGROUP OF - 'vartriangleright': u'\u22b3', # ⊳ CONTAINS AS NORMAL SUBGROUP - 'vdash': u'\u22a2', # ⊢ RIGHT TACK - 'wasytherefore': u'\u2234', # ∴ THEREFORE + 'Bot': '\u2aeb', # ⫫ DOUBLE UP TACK + 'Bumpeq': '\u224e', # ≎ GEOMETRICALLY EQUIVALENT TO + 'Coloneqq': '\u2a74', # ⩴ DOUBLE COLON EQUAL + 'Doteq': '\u2251', # ≑ GEOMETRICALLY EQUAL TO + 'Downarrow': '\u21d3', # ⇓ DOWNWARDS DOUBLE ARROW + 'Leftarrow': '\u21d0', # ⇐ LEFTWARDS DOUBLE ARROW + 'Leftrightarrow': '\u21d4', # ⇔ LEFT RIGHT DOUBLE ARROW + 'Lleftarrow': '\u21da', # ⇚ LEFTWARDS TRIPLE ARROW + 'Longleftarrow': '\u27f8', # ⟸ LONG LEFTWARDS DOUBLE ARROW + 'Longleftrightarrow': '\u27fa', # ⟺ LONG LEFT RIGHT DOUBLE ARROW + 'Longmapsfrom': '\u27fd', # ⟽ LONG LEFTWARDS DOUBLE ARROW FROM BAR + 'Longmapsto': '\u27fe', # ⟾ LONG RIGHTWARDS DOUBLE ARROW FROM BAR + 'Longrightarrow': '\u27f9', # ⟹ LONG RIGHTWARDS DOUBLE ARROW + 'Lsh': '\u21b0', # ↰ UPWARDS ARROW WITH TIP LEFTWARDS + 'Mapsfrom': '\u2906', # ⤆ LEFTWARDS DOUBLE ARROW FROM BAR + 'Mapsto': '\u2907', # ⤇ RIGHTWARDS DOUBLE ARROW FROM BAR + 'Nearrow': '\u21d7', # ⇗ NORTH EAST DOUBLE ARROW + 'Nwarrow': '\u21d6', # ⇖ NORTH WEST DOUBLE ARROW + 'Perp': '\u2aeb', # ⫫ DOUBLE UP TACK + 'Rightarrow': '\u21d2', # ⇒ RIGHTWARDS DOUBLE ARROW + 'Rrightarrow': '\u21db', # ⇛ RIGHTWARDS TRIPLE ARROW + 'Rsh': '\u21b1', # ↱ UPWARDS ARROW WITH TIP RIGHTWARDS + 'Searrow': '\u21d8', # ⇘ SOUTH EAST DOUBLE ARROW + 'Subset': '\u22d0', # ⋐ DOUBLE SUBSET + 'Supset': '\u22d1', # ⋑ DOUBLE SUPERSET + 'Swarrow': '\u21d9', # ⇙ SOUTH WEST DOUBLE ARROW + 'Top': '\u2aea', # ⫪ DOUBLE DOWN TACK + 'Uparrow': '\u21d1', # ⇑ UPWARDS DOUBLE ARROW + 'Updownarrow': '\u21d5', # ⇕ UP DOWN DOUBLE ARROW + 'VDash': '\u22ab', # ⊫ DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE + 'Vdash': '\u22a9', # ⊩ FORCES + 'Vvdash': '\u22aa', # ⊪ TRIPLE VERTICAL BAR RIGHT TURNSTILE + 'apprge': '\u2273', # ≳ GREATER-THAN OR EQUIVALENT TO + 'apprle': '\u2272', # ≲ LESS-THAN OR EQUIVALENT TO + 'approx': '\u2248', # ≈ ALMOST EQUAL TO + 'approxeq': '\u224a', # ≊ ALMOST EQUAL OR EQUAL TO + 'asymp': '\u224d', # ≍ EQUIVALENT TO + 'backepsilon': '\u220d', # ∍ SMALL CONTAINS AS MEMBER + 'backsim': '\u223d', # ∽ REVERSED TILDE + 'backsimeq': '\u22cd', # ⋍ REVERSED TILDE EQUALS + 'barin': '\u22f6', # ⋶ ELEMENT OF WITH OVERBAR + 'barleftharpoon': '\u296b', # ⥫ LEFTWARDS HARPOON WITH BARB DOWN BELOW LONG DASH + 'barrightharpoon': '\u296d', # ⥭ RIGHTWARDS HARPOON WITH BARB DOWN BELOW LONG DASH + 'because': '\u2235', # ∵ BECAUSE + 'between': '\u226c', # ≬ BETWEEN + 'blacktriangleleft': '\u25c2', # ◂ BLACK LEFT-POINTING SMALL TRIANGLE + 'blacktriangleright': '\u25b8', # ▸ BLACK RIGHT-POINTING SMALL TRIANGLE + 'bowtie': '\u22c8', # ⋈ BOWTIE + 'bumpeq': '\u224f', # ≏ DIFFERENCE BETWEEN + 'circeq': '\u2257', # ≗ RING EQUAL TO + 'circlearrowleft': '\u21ba', # ↺ ANTICLOCKWISE OPEN CIRCLE ARROW + 'circlearrowright': '\u21bb', # ↻ CLOCKWISE OPEN CIRCLE ARROW + 'coloneq': '\u2254', # ≔ COLON EQUALS + 'coloneqq': '\u2254', # ≔ COLON EQUALS + 'cong': '\u2245', # ≅ APPROXIMATELY EQUAL TO + 'corresponds': '\u2259', # ≙ ESTIMATES + 'curlyeqprec': '\u22de', # ⋞ EQUAL TO OR PRECEDES + 'curlyeqsucc': '\u22df', # ⋟ EQUAL TO OR SUCCEEDS + 'curvearrowleft': '\u21b6', # ↶ ANTICLOCKWISE TOP SEMICIRCLE ARROW + 'curvearrowright': '\u21b7', # ↷ CLOCKWISE TOP SEMICIRCLE ARROW + 'dasharrow': '\u21e2', # ⇢ RIGHTWARDS DASHED ARROW + 'dashleftarrow': '\u21e0', # ⇠ LEFTWARDS DASHED ARROW + 'dashrightarrow': '\u21e2', # ⇢ RIGHTWARDS DASHED ARROW + 'dashv': '\u22a3', # ⊣ LEFT TACK + 'dlsh': '\u21b2', # ↲ DOWNWARDS ARROW WITH TIP LEFTWARDS + 'doteq': '\u2250', # ≐ APPROACHES THE LIMIT + 'doteqdot': '\u2251', # ≑ GEOMETRICALLY EQUAL TO + 'downarrow': '\u2193', # ↓ DOWNWARDS ARROW + 'downdownarrows': '\u21ca', # ⇊ DOWNWARDS PAIRED ARROWS + 'downdownharpoons': '\u2965', # ⥥ DOWNWARDS HARPOON WITH BARB LEFT BESIDE DOWNWARDS HARPOON WITH BARB RIGHT + 'downharpoonleft': '\u21c3', # ⇃ DOWNWARDS HARPOON WITH BARB LEFTWARDS + 'downharpoonright': '\u21c2', # ⇂ DOWNWARDS HARPOON WITH BARB RIGHTWARDS + 'downuparrows': '\u21f5', # ⇵ DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW + 'downupharpoons': '\u296f', # ⥯ DOWNWARDS HARPOON WITH BARB LEFT BESIDE UPWARDS HARPOON WITH BARB RIGHT + 'drsh': '\u21b3', # ↳ DOWNWARDS ARROW WITH TIP RIGHTWARDS + 'eqcirc': '\u2256', # ≖ RING IN EQUAL TO + 'eqcolon': '\u2255', # ≕ EQUALS COLON + 'eqqcolon': '\u2255', # ≕ EQUALS COLON + 'eqsim': '\u2242', # ≂ MINUS TILDE + 'eqslantgtr': '\u2a96', # ⪖ SLANTED EQUAL TO OR GREATER-THAN + 'eqslantless': '\u2a95', # ⪕ SLANTED EQUAL TO OR LESS-THAN + 'equiv': '\u2261', # ≡ IDENTICAL TO + 'fallingdotseq': '\u2252', # ≒ APPROXIMATELY EQUAL TO OR THE IMAGE OF + 'frown': '\u2322', # ⌢ FROWN + 'ge': '\u2265', # ≥ GREATER-THAN OR EQUAL TO + 'geq': '\u2265', # ≥ GREATER-THAN OR EQUAL TO + 'geqq': '\u2267', # ≧ GREATER-THAN OVER EQUAL TO + 'geqslant': '\u2a7e', # ⩾ GREATER-THAN OR SLANTED EQUAL TO + 'gets': '\u2190', # ← LEFTWARDS ARROW + 'gg': '\u226b', # ≫ MUCH GREATER-THAN + 'ggcurly': '\u2abc', # ⪼ DOUBLE SUCCEEDS + 'ggg': '\u22d9', # ⋙ VERY MUCH GREATER-THAN + 'gggtr': '\u22d9', # ⋙ VERY MUCH GREATER-THAN + 'gnapprox': '\u2a8a', # ⪊ GREATER-THAN AND NOT APPROXIMATE + 'gneq': '\u2a88', # ⪈ GREATER-THAN AND SINGLE-LINE NOT EQUAL TO + 'gneqq': '\u2269', # ≩ GREATER-THAN BUT NOT EQUAL TO + 'gnsim': '\u22e7', # ⋧ GREATER-THAN BUT NOT EQUIVALENT TO + 'gtrapprox': '\u2a86', # ⪆ GREATER-THAN OR APPROXIMATE + 'gtreqless': '\u22db', # ⋛ GREATER-THAN EQUAL TO OR LESS-THAN + 'gtreqqless': '\u2a8c', # ⪌ GREATER-THAN ABOVE DOUBLE-LINE EQUAL ABOVE LESS-THAN + 'gtrless': '\u2277', # ≷ GREATER-THAN OR LESS-THAN + 'gtrsim': '\u2273', # ≳ GREATER-THAN OR EQUIVALENT TO + 'hash': '\u22d5', # ⋕ EQUAL AND PARALLEL TO + 'hookleftarrow': '\u21a9', # ↩ LEFTWARDS ARROW WITH HOOK + 'hookrightarrow': '\u21aa', # ↪ RIGHTWARDS ARROW WITH HOOK + 'iddots': '\u22f0', # ⋰ UP RIGHT DIAGONAL ELLIPSIS + 'impliedby': '\u27f8', # ⟸ LONG LEFTWARDS DOUBLE ARROW + 'implies': '\u27f9', # ⟹ LONG RIGHTWARDS DOUBLE ARROW + 'in': '\u2208', # ∈ ELEMENT OF + 'le': '\u2264', # ≤ LESS-THAN OR EQUAL TO + 'leadsto': '\u2933', # ⤳ WAVE ARROW POINTING DIRECTLY RIGHT + 'leftarrow': '\u2190', # ← LEFTWARDS ARROW + 'leftarrowtail': '\u21a2', # ↢ LEFTWARDS ARROW WITH TAIL + 'leftarrowtriangle': '\u21fd', # ⇽ LEFTWARDS OPEN-HEADED ARROW + 'leftbarharpoon': '\u296a', # ⥪ LEFTWARDS HARPOON WITH BARB UP ABOVE LONG DASH + 'leftharpoondown': '\u21bd', # ↽ LEFTWARDS HARPOON WITH BARB DOWNWARDS + 'leftharpoonup': '\u21bc', # ↼ LEFTWARDS HARPOON WITH BARB UPWARDS + 'leftleftarrows': '\u21c7', # ⇇ LEFTWARDS PAIRED ARROWS + 'leftleftharpoons': '\u2962', # ⥢ LEFTWARDS HARPOON WITH BARB UP ABOVE LEFTWARDS HARPOON WITH BARB DOWN + 'leftrightarrow': '\u2194', # ↔ LEFT RIGHT ARROW + 'leftrightarrows': '\u21c6', # ⇆ LEFTWARDS ARROW OVER RIGHTWARDS ARROW + 'leftrightarrowtriangle': '\u21ff', # ⇿ LEFT RIGHT OPEN-HEADED ARROW + 'leftrightharpoon': '\u294a', # ⥊ LEFT BARB UP RIGHT BARB DOWN HARPOON + 'leftrightharpoons': '\u21cb', # ⇋ LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON + 'leftrightsquigarrow': '\u21ad', # ↭ LEFT RIGHT WAVE ARROW + 'leftslice': '\u2aa6', # ⪦ LESS-THAN CLOSED BY CURVE + 'leftsquigarrow': '\u21dc', # ⇜ LEFTWARDS SQUIGGLE ARROW + 'leftturn': '\u21ba', # ↺ ANTICLOCKWISE OPEN CIRCLE ARROW + 'leq': '\u2264', # ≤ LESS-THAN OR EQUAL TO + 'leqq': '\u2266', # ≦ LESS-THAN OVER EQUAL TO + 'leqslant': '\u2a7d', # ⩽ LESS-THAN OR SLANTED EQUAL TO + 'lessapprox': '\u2a85', # ⪅ LESS-THAN OR APPROXIMATE + 'lesseqgtr': '\u22da', # ⋚ LESS-THAN EQUAL TO OR GREATER-THAN + 'lesseqqgtr': '\u2a8b', # ⪋ LESS-THAN ABOVE DOUBLE-LINE EQUAL ABOVE GREATER-THAN + 'lessgtr': '\u2276', # ≶ LESS-THAN OR GREATER-THAN + 'lesssim': '\u2272', # ≲ LESS-THAN OR EQUIVALENT TO + 'lhd': '\u22b2', # ⊲ NORMAL SUBGROUP OF + 'lightning': '\u21af', # ↯ DOWNWARDS ZIGZAG ARROW + 'll': '\u226a', # ≪ MUCH LESS-THAN + 'llcurly': '\u2abb', # ⪻ DOUBLE PRECEDES + 'lll': '\u22d8', # ⋘ VERY MUCH LESS-THAN + 'llless': '\u22d8', # ⋘ VERY MUCH LESS-THAN + 'lnapprox': '\u2a89', # ⪉ LESS-THAN AND NOT APPROXIMATE + 'lneq': '\u2a87', # ⪇ LESS-THAN AND SINGLE-LINE NOT EQUAL TO + 'lneqq': '\u2268', # ≨ LESS-THAN BUT NOT EQUAL TO + 'lnsim': '\u22e6', # ⋦ LESS-THAN BUT NOT EQUIVALENT TO + 'longleftarrow': '\u27f5', # ⟵ LONG LEFTWARDS ARROW + 'longleftrightarrow': '\u27f7', # ⟷ LONG LEFT RIGHT ARROW + 'longmapsfrom': '\u27fb', # ⟻ LONG LEFTWARDS ARROW FROM BAR + 'longmapsto': '\u27fc', # ⟼ LONG RIGHTWARDS ARROW FROM BAR + 'longrightarrow': '\u27f6', # ⟶ LONG RIGHTWARDS ARROW + 'looparrowleft': '\u21ab', # ↫ LEFTWARDS ARROW WITH LOOP + 'looparrowright': '\u21ac', # ↬ RIGHTWARDS ARROW WITH LOOP + 'lrtimes': '\u22c8', # ⋈ BOWTIE + 'mapsfrom': '\u21a4', # ↤ LEFTWARDS ARROW FROM BAR + 'mapsto': '\u21a6', # ↦ RIGHTWARDS ARROW FROM BAR + 'mid': '\u2223', # ∣ DIVIDES + 'models': '\u22a7', # ⊧ MODELS + 'multimap': '\u22b8', # ⊸ MULTIMAP + 'multimapboth': '\u29df', # ⧟ DOUBLE-ENDED MULTIMAP + 'multimapdotbothA': '\u22b6', # ⊶ ORIGINAL OF + 'multimapdotbothB': '\u22b7', # ⊷ IMAGE OF + 'multimapinv': '\u27dc', # ⟜ LEFT MULTIMAP + 'nLeftarrow': '\u21cd', # ⇍ LEFTWARDS DOUBLE ARROW WITH STROKE + 'nLeftrightarrow': '\u21ce', # ⇎ LEFT RIGHT DOUBLE ARROW WITH STROKE + 'nRightarrow': '\u21cf', # ⇏ RIGHTWARDS DOUBLE ARROW WITH STROKE + 'nVDash': '\u22af', # ⊯ NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE + 'nVdash': '\u22ae', # ⊮ DOES NOT FORCE + 'ncong': '\u2247', # ≇ NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO + 'ne': '\u2260', # ≠ NOT EQUAL TO + 'nearrow': '\u2197', # ↗ NORTH EAST ARROW + 'neq': '\u2260', # ≠ NOT EQUAL TO + 'ngeq': '\u2271', # ≱ NEITHER GREATER-THAN NOR EQUAL TO + 'ngtr': '\u226f', # ≯ NOT GREATER-THAN + 'ngtrless': '\u2279', # ≹ NEITHER GREATER-THAN NOR LESS-THAN + 'ni': '\u220b', # ∋ CONTAINS AS MEMBER + 'nleftarrow': '\u219a', # ↚ LEFTWARDS ARROW WITH STROKE + 'nleftrightarrow': '\u21ae', # ↮ LEFT RIGHT ARROW WITH STROKE + 'nleq': '\u2270', # ≰ NEITHER LESS-THAN NOR EQUAL TO + 'nless': '\u226e', # ≮ NOT LESS-THAN + 'nlessgtr': '\u2278', # ≸ NEITHER LESS-THAN NOR GREATER-THAN + 'nmid': '\u2224', # ∤ DOES NOT DIVIDE + 'notasymp': '\u226d', # ≭ NOT EQUIVALENT TO + 'notin': '\u2209', # ∉ NOT AN ELEMENT OF + 'notni': '\u220c', # ∌ DOES NOT CONTAIN AS MEMBER + 'notowner': '\u220c', # ∌ DOES NOT CONTAIN AS MEMBER + 'notslash': '\u233f', # ⌿ APL FUNCTIONAL SYMBOL SLASH BAR + 'nparallel': '\u2226', # ∦ NOT PARALLEL TO + 'nprec': '\u2280', # ⊀ DOES NOT PRECEDE + 'npreceq': '\u22e0', # ⋠ DOES NOT PRECEDE OR EQUAL + 'nrightarrow': '\u219b', # ↛ RIGHTWARDS ARROW WITH STROKE + 'nsim': '\u2241', # ≁ NOT TILDE + 'nsimeq': '\u2244', # ≄ NOT ASYMPTOTICALLY EQUAL TO + 'nsubseteq': '\u2288', # ⊈ NEITHER A SUBSET OF NOR EQUAL TO + 'nsucc': '\u2281', # ⊁ DOES NOT SUCCEED + 'nsucceq': '\u22e1', # ⋡ DOES NOT SUCCEED OR EQUAL + 'nsupseteq': '\u2289', # ⊉ NEITHER A SUPERSET OF NOR EQUAL TO + 'ntriangleleft': '\u22ea', # ⋪ NOT NORMAL SUBGROUP OF + 'ntrianglelefteq': '\u22ec', # ⋬ NOT NORMAL SUBGROUP OF OR EQUAL TO + 'ntriangleright': '\u22eb', # ⋫ DOES NOT CONTAIN AS NORMAL SUBGROUP + 'ntrianglerighteq': '\u22ed', # ⋭ DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL + 'nvDash': '\u22ad', # ⊭ NOT TRUE + 'nvdash': '\u22ac', # ⊬ DOES NOT PROVE + 'nwarrow': '\u2196', # ↖ NORTH WEST ARROW + 'owns': '\u220b', # ∋ CONTAINS AS MEMBER + 'parallel': '\u2225', # ∥ PARALLEL TO + 'perp': '\u27c2', # ⟂ PERPENDICULAR + 'pitchfork': '\u22d4', # ⋔ PITCHFORK + 'prec': '\u227a', # ≺ PRECEDES + 'precapprox': '\u2ab7', # ⪷ PRECEDES ABOVE ALMOST EQUAL TO + 'preccurlyeq': '\u227c', # ≼ PRECEDES OR EQUAL TO + 'preceq': '\u2aaf', # ⪯ PRECEDES ABOVE SINGLE-LINE EQUALS SIGN + 'preceqq': '\u2ab3', # ⪳ PRECEDES ABOVE EQUALS SIGN + 'precnapprox': '\u2ab9', # ⪹ PRECEDES ABOVE NOT ALMOST EQUAL TO + 'precneqq': '\u2ab5', # ⪵ PRECEDES ABOVE NOT EQUAL TO + 'precnsim': '\u22e8', # ⋨ PRECEDES BUT NOT EQUIVALENT TO + 'precsim': '\u227e', # ≾ PRECEDES OR EQUIVALENT TO + 'propto': '\u221d', # ∝ PROPORTIONAL TO + 'restriction': '\u21be', # ↾ UPWARDS HARPOON WITH BARB RIGHTWARDS + 'rhd': '\u22b3', # ⊳ CONTAINS AS NORMAL SUBGROUP + 'rightarrow': '\u2192', # → RIGHTWARDS ARROW + 'rightarrowtail': '\u21a3', # ↣ RIGHTWARDS ARROW WITH TAIL + 'rightarrowtriangle': '\u21fe', # ⇾ RIGHTWARDS OPEN-HEADED ARROW + 'rightbarharpoon': '\u296c', # ⥬ RIGHTWARDS HARPOON WITH BARB UP ABOVE LONG DASH + 'rightharpoondown': '\u21c1', # ⇁ RIGHTWARDS HARPOON WITH BARB DOWNWARDS + 'rightharpoonup': '\u21c0', # ⇀ RIGHTWARDS HARPOON WITH BARB UPWARDS + 'rightleftarrows': '\u21c4', # ⇄ RIGHTWARDS ARROW OVER LEFTWARDS ARROW + 'rightleftharpoon': '\u294b', # ⥋ LEFT BARB DOWN RIGHT BARB UP HARPOON + 'rightleftharpoons': '\u21cc', # ⇌ RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON + 'rightrightarrows': '\u21c9', # ⇉ RIGHTWARDS PAIRED ARROWS + 'rightrightharpoons': '\u2964', # ⥤ RIGHTWARDS HARPOON WITH BARB UP ABOVE RIGHTWARDS HARPOON WITH BARB DOWN + 'rightslice': '\u2aa7', # ⪧ GREATER-THAN CLOSED BY CURVE + 'rightsquigarrow': '\u21dd', # ⇝ RIGHTWARDS SQUIGGLE ARROW + 'rightturn': '\u21bb', # ↻ CLOCKWISE OPEN CIRCLE ARROW + 'risingdotseq': '\u2253', # ≓ IMAGE OF OR APPROXIMATELY EQUAL TO + 'searrow': '\u2198', # ↘ SOUTH EAST ARROW + 'sim': '\u223c', # ∼ TILDE OPERATOR + 'simeq': '\u2243', # ≃ ASYMPTOTICALLY EQUAL TO + 'smile': '\u2323', # ⌣ SMILE + 'sqsubset': '\u228f', # ⊏ SQUARE IMAGE OF + 'sqsubseteq': '\u2291', # ⊑ SQUARE IMAGE OF OR EQUAL TO + 'sqsupset': '\u2290', # ⊐ SQUARE ORIGINAL OF + 'sqsupseteq': '\u2292', # ⊒ SQUARE ORIGINAL OF OR EQUAL TO + 'strictfi': '\u297c', # ⥼ LEFT FISH TAIL + 'strictif': '\u297d', # ⥽ RIGHT FISH TAIL + 'subset': '\u2282', # ⊂ SUBSET OF + 'subseteq': '\u2286', # ⊆ SUBSET OF OR EQUAL TO + 'subseteqq': '\u2ac5', # ⫅ SUBSET OF ABOVE EQUALS SIGN + 'subsetneq': '\u228a', # ⊊ SUBSET OF WITH NOT EQUAL TO + 'subsetneqq': '\u2acb', # ⫋ SUBSET OF ABOVE NOT EQUAL TO + 'succ': '\u227b', # ≻ SUCCEEDS + 'succapprox': '\u2ab8', # ⪸ SUCCEEDS ABOVE ALMOST EQUAL TO + 'succcurlyeq': '\u227d', # ≽ SUCCEEDS OR EQUAL TO + 'succeq': '\u2ab0', # ⪰ SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN + 'succeqq': '\u2ab4', # ⪴ SUCCEEDS ABOVE EQUALS SIGN + 'succnapprox': '\u2aba', # ⪺ SUCCEEDS ABOVE NOT ALMOST EQUAL TO + 'succneqq': '\u2ab6', # ⪶ SUCCEEDS ABOVE NOT EQUAL TO + 'succnsim': '\u22e9', # ⋩ SUCCEEDS BUT NOT EQUIVALENT TO + 'succsim': '\u227f', # ≿ SUCCEEDS OR EQUIVALENT TO + 'supset': '\u2283', # ⊃ SUPERSET OF + 'supseteq': '\u2287', # ⊇ SUPERSET OF OR EQUAL TO + 'supseteqq': '\u2ac6', # ⫆ SUPERSET OF ABOVE EQUALS SIGN + 'supsetneq': '\u228b', # ⊋ SUPERSET OF WITH NOT EQUAL TO + 'supsetneqq': '\u2acc', # ⫌ SUPERSET OF ABOVE NOT EQUAL TO + 'swarrow': '\u2199', # ↙ SOUTH WEST ARROW + 'therefore': '\u2234', # ∴ THEREFORE + 'to': '\u2192', # → RIGHTWARDS ARROW + 'trianglelefteq': '\u22b4', # ⊴ NORMAL SUBGROUP OF OR EQUAL TO + 'triangleq': '\u225c', # ≜ DELTA EQUAL TO + 'trianglerighteq': '\u22b5', # ⊵ CONTAINS AS NORMAL SUBGROUP OR EQUAL TO + 'twoheadleftarrow': '\u219e', # ↞ LEFTWARDS TWO HEADED ARROW + 'twoheadrightarrow': '\u21a0', # ↠ RIGHTWARDS TWO HEADED ARROW + 'uparrow': '\u2191', # ↑ UPWARDS ARROW + 'updownarrow': '\u2195', # ↕ UP DOWN ARROW + 'updownarrows': '\u21c5', # ⇅ UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW + 'updownharpoons': '\u296e', # ⥮ UPWARDS HARPOON WITH BARB LEFT BESIDE DOWNWARDS HARPOON WITH BARB RIGHT + 'upharpoonleft': '\u21bf', # ↿ UPWARDS HARPOON WITH BARB LEFTWARDS + 'upharpoonright': '\u21be', # ↾ UPWARDS HARPOON WITH BARB RIGHTWARDS + 'upuparrows': '\u21c8', # ⇈ UPWARDS PAIRED ARROWS + 'upupharpoons': '\u2963', # ⥣ UPWARDS HARPOON WITH BARB LEFT BESIDE UPWARDS HARPOON WITH BARB RIGHT + 'vDash': '\u22a8', # ⊨ TRUE + 'vartriangle': '\u25b5', # ▵ WHITE UP-POINTING SMALL TRIANGLE + 'vartriangleleft': '\u22b2', # ⊲ NORMAL SUBGROUP OF + 'vartriangleright': '\u22b3', # ⊳ CONTAINS AS NORMAL SUBGROUP + 'vdash': '\u22a2', # ⊢ RIGHT TACK + 'wasytherefore': '\u2234', # ∴ THEREFORE } mathunder = { - 'underbrace': u'\u23df', # ⏟ BOTTOM CURLY BRACKET + 'underbrace': '\u23df', # ⏟ BOTTOM CURLY BRACKET } space = { - ' ': u' ', # SPACE - ',': u'\u2006', #   SIX-PER-EM SPACE - ':': u'\u205f', #   MEDIUM MATHEMATICAL SPACE - 'medspace': u'\u205f', #   MEDIUM MATHEMATICAL SPACE - 'quad': u'\u2001', #   EM QUAD - 'thinspace': u'\u2006', #   SIX-PER-EM SPACE + ' ': ' ', # SPACE + ',': '\u2006', #   SIX-PER-EM SPACE + ':': '\u205f', #   MEDIUM MATHEMATICAL SPACE + 'medspace': '\u205f', #   MEDIUM MATHEMATICAL SPACE + 'quad': '\u2001', #   EM QUAD + 'thinspace': '\u2006', #   SIX-PER-EM SPACE } diff --git a/docutils/docutils/utils/math/unichar2tex.py b/docutils/docutils/utils/math/unichar2tex.py index cf077f6a2..da1f828af 100644 --- a/docutils/docutils/utils/math/unichar2tex.py +++ b/docutils/docutils/utils/math/unichar2tex.py @@ -6,803 +6,803 @@ # Includes commands from: standard LaTeX, amssymb, amsmath uni2tex_table = { -0xa0: u'~', -0xa3: u'\\pounds ', -0xa5: u'\\yen ', -0xa7: u'\\S ', -0xac: u'\\neg ', -0xb1: u'\\pm ', -0xb6: u'\\P ', -0xd7: u'\\times ', -0xf0: u'\\eth ', -0xf7: u'\\div ', -0x131: u'\\imath ', -0x237: u'\\jmath ', -0x393: u'\\Gamma ', -0x394: u'\\Delta ', -0x398: u'\\Theta ', -0x39b: u'\\Lambda ', -0x39e: u'\\Xi ', -0x3a0: u'\\Pi ', -0x3a3: u'\\Sigma ', -0x3a5: u'\\Upsilon ', -0x3a6: u'\\Phi ', -0x3a8: u'\\Psi ', -0x3a9: u'\\Omega ', -0x3b1: u'\\alpha ', -0x3b2: u'\\beta ', -0x3b3: u'\\gamma ', -0x3b4: u'\\delta ', -0x3b5: u'\\varepsilon ', -0x3b6: u'\\zeta ', -0x3b7: u'\\eta ', -0x3b8: u'\\theta ', -0x3b9: u'\\iota ', -0x3ba: u'\\kappa ', -0x3bb: u'\\lambda ', -0x3bc: u'\\mu ', -0x3bd: u'\\nu ', -0x3be: u'\\xi ', -0x3c0: u'\\pi ', -0x3c1: u'\\rho ', -0x3c2: u'\\varsigma ', -0x3c3: u'\\sigma ', -0x3c4: u'\\tau ', -0x3c5: u'\\upsilon ', -0x3c6: u'\\varphi ', -0x3c7: u'\\chi ', -0x3c8: u'\\psi ', -0x3c9: u'\\omega ', -0x3d1: u'\\vartheta ', -0x3d5: u'\\phi ', -0x3d6: u'\\varpi ', -0x3dd: u'\\digamma ', -0x3f0: u'\\varkappa ', -0x3f1: u'\\varrho ', -0x3f5: u'\\epsilon ', -0x3f6: u'\\backepsilon ', -0x2001: u'\\quad ', -0x2003: u'\\quad ', -0x2006: u'\\, ', -0x2016: u'\\| ', -0x2020: u'\\dagger ', -0x2021: u'\\ddagger ', -0x2022: u'\\bullet ', -0x2026: u'\\ldots ', -0x2032: u'\\prime ', -0x2035: u'\\backprime ', -0x205f: u'\\: ', -0x2102: u'\\mathbb{C}', -0x210b: u'\\mathcal{H}', -0x210c: u'\\mathfrak{H}', -0x210d: u'\\mathbb{H}', -0x210f: u'\\hslash ', -0x2110: u'\\mathcal{I}', -0x2111: u'\\Im ', -0x2112: u'\\mathcal{L}', -0x2113: u'\\ell ', -0x2115: u'\\mathbb{N}', -0x2118: u'\\wp ', -0x2119: u'\\mathbb{P}', -0x211a: u'\\mathbb{Q}', -0x211b: u'\\mathcal{R}', -0x211c: u'\\Re ', -0x211d: u'\\mathbb{R}', -0x2124: u'\\mathbb{Z}', -0x2127: u'\\mho ', -0x2128: u'\\mathfrak{Z}', -0x212c: u'\\mathcal{B}', -0x212d: u'\\mathfrak{C}', -0x2130: u'\\mathcal{E}', -0x2131: u'\\mathcal{F}', -0x2132: u'\\Finv ', -0x2133: u'\\mathcal{M}', -0x2135: u'\\aleph ', -0x2136: u'\\beth ', -0x2137: u'\\gimel ', -0x2138: u'\\daleth ', -0x2190: u'\\leftarrow ', -0x2191: u'\\uparrow ', -0x2192: u'\\rightarrow ', -0x2193: u'\\downarrow ', -0x2194: u'\\leftrightarrow ', -0x2195: u'\\updownarrow ', -0x2196: u'\\nwarrow ', -0x2197: u'\\nearrow ', -0x2198: u'\\searrow ', -0x2199: u'\\swarrow ', -0x219a: u'\\nleftarrow ', -0x219b: u'\\nrightarrow ', -0x219e: u'\\twoheadleftarrow ', -0x21a0: u'\\twoheadrightarrow ', -0x21a2: u'\\leftarrowtail ', -0x21a3: u'\\rightarrowtail ', -0x21a6: u'\\mapsto ', -0x21a9: u'\\hookleftarrow ', -0x21aa: u'\\hookrightarrow ', -0x21ab: u'\\looparrowleft ', -0x21ac: u'\\looparrowright ', -0x21ad: u'\\leftrightsquigarrow ', -0x21ae: u'\\nleftrightarrow ', -0x21b0: u'\\Lsh ', -0x21b1: u'\\Rsh ', -0x21b6: u'\\curvearrowleft ', -0x21b7: u'\\curvearrowright ', -0x21ba: u'\\circlearrowleft ', -0x21bb: u'\\circlearrowright ', -0x21bc: u'\\leftharpoonup ', -0x21bd: u'\\leftharpoondown ', -0x21be: u'\\upharpoonright ', -0x21bf: u'\\upharpoonleft ', -0x21c0: u'\\rightharpoonup ', -0x21c1: u'\\rightharpoondown ', -0x21c2: u'\\downharpoonright ', -0x21c3: u'\\downharpoonleft ', -0x21c4: u'\\rightleftarrows ', -0x21c6: u'\\leftrightarrows ', -0x21c7: u'\\leftleftarrows ', -0x21c8: u'\\upuparrows ', -0x21c9: u'\\rightrightarrows ', -0x21ca: u'\\downdownarrows ', -0x21cb: u'\\leftrightharpoons ', -0x21cc: u'\\rightleftharpoons ', -0x21cd: u'\\nLeftarrow ', -0x21ce: u'\\nLeftrightarrow ', -0x21cf: u'\\nRightarrow ', -0x21d0: u'\\Leftarrow ', -0x21d1: u'\\Uparrow ', -0x21d2: u'\\Rightarrow ', -0x21d3: u'\\Downarrow ', -0x21d4: u'\\Leftrightarrow ', -0x21d5: u'\\Updownarrow ', -0x21da: u'\\Lleftarrow ', -0x21db: u'\\Rrightarrow ', -0x21dd: u'\\rightsquigarrow ', -0x21e0: u'\\dashleftarrow ', -0x21e2: u'\\dashrightarrow ', -0x2200: u'\\forall ', -0x2201: u'\\complement ', -0x2202: u'\\partial ', -0x2203: u'\\exists ', -0x2204: u'\\nexists ', -0x2205: u'\\emptyset ', -0x2207: u'\\nabla ', -0x2208: u'\\in ', -0x2209: u'\\notin ', -0x220b: u'\\ni ', -0x220f: u'\\prod ', -0x2210: u'\\coprod ', -0x2211: u'\\sum ', -0x2212: u'-', -0x2213: u'\\mp ', -0x2214: u'\\dotplus ', -0x2215: u'\\slash ', -0x2216: u'\\smallsetminus ', -0x2217: u'\\ast ', -0x2218: u'\\circ ', -0x2219: u'\\bullet ', -0x221a: u'\\surd ', -0x221b: u'\\sqrt[3] ', -0x221c: u'\\sqrt[4] ', -0x221d: u'\\propto ', -0x221e: u'\\infty ', -0x2220: u'\\angle ', -0x2221: u'\\measuredangle ', -0x2222: u'\\sphericalangle ', -0x2223: u'\\mid ', -0x2224: u'\\nmid ', -0x2225: u'\\parallel ', -0x2226: u'\\nparallel ', -0x2227: u'\\wedge ', -0x2228: u'\\vee ', -0x2229: u'\\cap ', -0x222a: u'\\cup ', -0x222b: u'\\int ', -0x222c: u'\\iint ', -0x222d: u'\\iiint ', -0x222e: u'\\oint ', -0x2234: u'\\therefore ', -0x2235: u'\\because ', -0x2236: u':', -0x223c: u'\\sim ', -0x223d: u'\\backsim ', -0x2240: u'\\wr ', -0x2241: u'\\nsim ', -0x2242: u'\\eqsim ', -0x2243: u'\\simeq ', -0x2245: u'\\cong ', -0x2247: u'\\ncong ', -0x2248: u'\\approx ', -0x224a: u'\\approxeq ', -0x224d: u'\\asymp ', -0x224e: u'\\Bumpeq ', -0x224f: u'\\bumpeq ', -0x2250: u'\\doteq ', -0x2251: u'\\Doteq ', -0x2252: u'\\fallingdotseq ', -0x2253: u'\\risingdotseq ', -0x2256: u'\\eqcirc ', -0x2257: u'\\circeq ', -0x225c: u'\\triangleq ', -0x2260: u'\\neq ', -0x2261: u'\\equiv ', -0x2264: u'\\leq ', -0x2265: u'\\geq ', -0x2266: u'\\leqq ', -0x2267: u'\\geqq ', -0x2268: u'\\lneqq ', -0x2269: u'\\gneqq ', -0x226a: u'\\ll ', -0x226b: u'\\gg ', -0x226c: u'\\between ', -0x226e: u'\\nless ', -0x226f: u'\\ngtr ', -0x2270: u'\\nleq ', -0x2271: u'\\ngeq ', -0x2272: u'\\lesssim ', -0x2273: u'\\gtrsim ', -0x2276: u'\\lessgtr ', -0x2277: u'\\gtrless ', -0x227a: u'\\prec ', -0x227b: u'\\succ ', -0x227c: u'\\preccurlyeq ', -0x227d: u'\\succcurlyeq ', -0x227e: u'\\precsim ', -0x227f: u'\\succsim ', -0x2280: u'\\nprec ', -0x2281: u'\\nsucc ', -0x2282: u'\\subset ', -0x2283: u'\\supset ', -0x2286: u'\\subseteq ', -0x2287: u'\\supseteq ', -0x2288: u'\\nsubseteq ', -0x2289: u'\\nsupseteq ', -0x228a: u'\\subsetneq ', -0x228b: u'\\supsetneq ', -0x228e: u'\\uplus ', -0x228f: u'\\sqsubset ', -0x2290: u'\\sqsupset ', -0x2291: u'\\sqsubseteq ', -0x2292: u'\\sqsupseteq ', -0x2293: u'\\sqcap ', -0x2294: u'\\sqcup ', -0x2295: u'\\oplus ', -0x2296: u'\\ominus ', -0x2297: u'\\otimes ', -0x2298: u'\\oslash ', -0x2299: u'\\odot ', -0x229a: u'\\circledcirc ', -0x229b: u'\\circledast ', -0x229d: u'\\circleddash ', -0x229e: u'\\boxplus ', -0x229f: u'\\boxminus ', -0x22a0: u'\\boxtimes ', -0x22a1: u'\\boxdot ', -0x22a2: u'\\vdash ', -0x22a3: u'\\dashv ', -0x22a4: u'\\top ', -0x22a5: u'\\bot ', -0x22a7: u'\\models ', -0x22a8: u'\\vDash ', -0x22a9: u'\\Vdash ', -0x22aa: u'\\Vvdash ', -0x22ac: u'\\nvdash ', -0x22ad: u'\\nvDash ', -0x22ae: u'\\nVdash ', -0x22af: u'\\nVDash ', -0x22b2: u'\\vartriangleleft ', -0x22b3: u'\\vartriangleright ', -0x22b4: u'\\trianglelefteq ', -0x22b5: u'\\trianglerighteq ', -0x22b8: u'\\multimap ', -0x22ba: u'\\intercal ', -0x22bb: u'\\veebar ', -0x22bc: u'\\barwedge ', -0x22c0: u'\\bigwedge ', -0x22c1: u'\\bigvee ', -0x22c2: u'\\bigcap ', -0x22c3: u'\\bigcup ', -0x22c4: u'\\diamond ', -0x22c5: u'\\cdot ', -0x22c6: u'\\star ', -0x22c7: u'\\divideontimes ', -0x22c8: u'\\bowtie ', -0x22c9: u'\\ltimes ', -0x22ca: u'\\rtimes ', -0x22cb: u'\\leftthreetimes ', -0x22cc: u'\\rightthreetimes ', -0x22cd: u'\\backsimeq ', -0x22ce: u'\\curlyvee ', -0x22cf: u'\\curlywedge ', -0x22d0: u'\\Subset ', -0x22d1: u'\\Supset ', -0x22d2: u'\\Cap ', -0x22d3: u'\\Cup ', -0x22d4: u'\\pitchfork ', -0x22d6: u'\\lessdot ', -0x22d7: u'\\gtrdot ', -0x22d8: u'\\lll ', -0x22d9: u'\\ggg ', -0x22da: u'\\lesseqgtr ', -0x22db: u'\\gtreqless ', -0x22de: u'\\curlyeqprec ', -0x22df: u'\\curlyeqsucc ', -0x22e0: u'\\npreceq ', -0x22e1: u'\\nsucceq ', -0x22e6: u'\\lnsim ', -0x22e7: u'\\gnsim ', -0x22e8: u'\\precnsim ', -0x22e9: u'\\succnsim ', -0x22ea: u'\\ntriangleleft ', -0x22eb: u'\\ntriangleright ', -0x22ec: u'\\ntrianglelefteq ', -0x22ed: u'\\ntrianglerighteq ', -0x22ee: u'\\vdots ', -0x22ef: u'\\cdots ', -0x22f1: u'\\ddots ', -0x2308: u'\\lceil ', -0x2309: u'\\rceil ', -0x230a: u'\\lfloor ', -0x230b: u'\\rfloor ', -0x231c: u'\\ulcorner ', -0x231d: u'\\urcorner ', -0x231e: u'\\llcorner ', -0x231f: u'\\lrcorner ', -0x2322: u'\\frown ', -0x2323: u'\\smile ', -0x23aa: u'\\bracevert ', -0x23b0: u'\\lmoustache ', -0x23b1: u'\\rmoustache ', -0x23d0: u'\\arrowvert ', -0x23de: u'\\overbrace ', -0x23df: u'\\underbrace ', -0x24c7: u'\\circledR ', -0x24c8: u'\\circledS ', -0x25b2: u'\\blacktriangle ', -0x25b3: u'\\bigtriangleup ', -0x25b7: u'\\triangleright ', -0x25bc: u'\\blacktriangledown ', -0x25bd: u'\\bigtriangledown ', -0x25c1: u'\\triangleleft ', -0x25c7: u'\\Diamond ', -0x25ca: u'\\lozenge ', -0x25ef: u'\\bigcirc ', -0x25fb: u'\\square ', -0x25fc: u'\\blacksquare ', -0x2605: u'\\bigstar ', -0x2660: u'\\spadesuit ', -0x2661: u'\\heartsuit ', -0x2662: u'\\diamondsuit ', -0x2663: u'\\clubsuit ', -0x266d: u'\\flat ', -0x266e: u'\\natural ', -0x266f: u'\\sharp ', -0x2713: u'\\checkmark ', -0x2720: u'\\maltese ', -0x27c2: u'\\perp ', -0x27cb: u'\\diagup ', -0x27cd: u'\\diagdown ', -0x27e8: u'\\langle ', -0x27e9: u'\\rangle ', -0x27ee: u'\\lgroup ', -0x27ef: u'\\rgroup ', -0x27f5: u'\\longleftarrow ', -0x27f6: u'\\longrightarrow ', -0x27f7: u'\\longleftrightarrow ', -0x27f8: u'\\Longleftarrow ', -0x27f9: u'\\Longrightarrow ', -0x27fa: u'\\Longleftrightarrow ', -0x27fc: u'\\longmapsto ', -0x29eb: u'\\blacklozenge ', -0x29f5: u'\\setminus ', -0x2a00: u'\\bigodot ', -0x2a01: u'\\bigoplus ', -0x2a02: u'\\bigotimes ', -0x2a04: u'\\biguplus ', -0x2a06: u'\\bigsqcup ', -0x2a0c: u'\\iiiint ', -0x2a3f: u'\\amalg ', -0x2a5e: u'\\doublebarwedge ', -0x2a7d: u'\\leqslant ', -0x2a7e: u'\\geqslant ', -0x2a85: u'\\lessapprox ', -0x2a86: u'\\gtrapprox ', -0x2a87: u'\\lneq ', -0x2a88: u'\\gneq ', -0x2a89: u'\\lnapprox ', -0x2a8a: u'\\gnapprox ', -0x2a8b: u'\\lesseqqgtr ', -0x2a8c: u'\\gtreqqless ', -0x2a95: u'\\eqslantless ', -0x2a96: u'\\eqslantgtr ', -0x2aaf: u'\\preceq ', -0x2ab0: u'\\succeq ', -0x2ab5: u'\\precneqq ', -0x2ab6: u'\\succneqq ', -0x2ab7: u'\\precapprox ', -0x2ab8: u'\\succapprox ', -0x2ab9: u'\\precnapprox ', -0x2aba: u'\\succnapprox ', -0x2ac5: u'\\subseteqq ', -0x2ac6: u'\\supseteqq ', -0x2acb: u'\\subsetneqq ', -0x2acc: u'\\supsetneqq ', -0x2b1c: u'\\Box ', -0x1d400: u'\\mathbf{A}', -0x1d401: u'\\mathbf{B}', -0x1d402: u'\\mathbf{C}', -0x1d403: u'\\mathbf{D}', -0x1d404: u'\\mathbf{E}', -0x1d405: u'\\mathbf{F}', -0x1d406: u'\\mathbf{G}', -0x1d407: u'\\mathbf{H}', -0x1d408: u'\\mathbf{I}', -0x1d409: u'\\mathbf{J}', -0x1d40a: u'\\mathbf{K}', -0x1d40b: u'\\mathbf{L}', -0x1d40c: u'\\mathbf{M}', -0x1d40d: u'\\mathbf{N}', -0x1d40e: u'\\mathbf{O}', -0x1d40f: u'\\mathbf{P}', -0x1d410: u'\\mathbf{Q}', -0x1d411: u'\\mathbf{R}', -0x1d412: u'\\mathbf{S}', -0x1d413: u'\\mathbf{T}', -0x1d414: u'\\mathbf{U}', -0x1d415: u'\\mathbf{V}', -0x1d416: u'\\mathbf{W}', -0x1d417: u'\\mathbf{X}', -0x1d418: u'\\mathbf{Y}', -0x1d419: u'\\mathbf{Z}', -0x1d41a: u'\\mathbf{a}', -0x1d41b: u'\\mathbf{b}', -0x1d41c: u'\\mathbf{c}', -0x1d41d: u'\\mathbf{d}', -0x1d41e: u'\\mathbf{e}', -0x1d41f: u'\\mathbf{f}', -0x1d420: u'\\mathbf{g}', -0x1d421: u'\\mathbf{h}', -0x1d422: u'\\mathbf{i}', -0x1d423: u'\\mathbf{j}', -0x1d424: u'\\mathbf{k}', -0x1d425: u'\\mathbf{l}', -0x1d426: u'\\mathbf{m}', -0x1d427: u'\\mathbf{n}', -0x1d428: u'\\mathbf{o}', -0x1d429: u'\\mathbf{p}', -0x1d42a: u'\\mathbf{q}', -0x1d42b: u'\\mathbf{r}', -0x1d42c: u'\\mathbf{s}', -0x1d42d: u'\\mathbf{t}', -0x1d42e: u'\\mathbf{u}', -0x1d42f: u'\\mathbf{v}', -0x1d430: u'\\mathbf{w}', -0x1d431: u'\\mathbf{x}', -0x1d432: u'\\mathbf{y}', -0x1d433: u'\\mathbf{z}', -0x1d434: u'A', -0x1d435: u'B', -0x1d436: u'C', -0x1d437: u'D', -0x1d438: u'E', -0x1d439: u'F', -0x1d43a: u'G', -0x1d43b: u'H', -0x1d43c: u'I', -0x1d43d: u'J', -0x1d43e: u'K', -0x1d43f: u'L', -0x1d440: u'M', -0x1d441: u'N', -0x1d442: u'O', -0x1d443: u'P', -0x1d444: u'Q', -0x1d445: u'R', -0x1d446: u'S', -0x1d447: u'T', -0x1d448: u'U', -0x1d449: u'V', -0x1d44a: u'W', -0x1d44b: u'X', -0x1d44c: u'Y', -0x1d44d: u'Z', -0x1d44e: u'a', -0x1d44f: u'b', -0x1d450: u'c', -0x1d451: u'd', -0x1d452: u'e', -0x1d453: u'f', -0x1d454: u'g', -0x1d456: u'i', -0x1d457: u'j', -0x1d458: u'k', -0x1d459: u'l', -0x1d45a: u'm', -0x1d45b: u'n', -0x1d45c: u'o', -0x1d45d: u'p', -0x1d45e: u'q', -0x1d45f: u'r', -0x1d460: u's', -0x1d461: u't', -0x1d462: u'u', -0x1d463: u'v', -0x1d464: u'w', -0x1d465: u'x', -0x1d466: u'y', -0x1d467: u'z', -0x1d49c: u'\\mathcal{A}', -0x1d49e: u'\\mathcal{C}', -0x1d49f: u'\\mathcal{D}', -0x1d4a2: u'\\mathcal{G}', -0x1d4a5: u'\\mathcal{J}', -0x1d4a6: u'\\mathcal{K}', -0x1d4a9: u'\\mathcal{N}', -0x1d4aa: u'\\mathcal{O}', -0x1d4ab: u'\\mathcal{P}', -0x1d4ac: u'\\mathcal{Q}', -0x1d4ae: u'\\mathcal{S}', -0x1d4af: u'\\mathcal{T}', -0x1d4b0: u'\\mathcal{U}', -0x1d4b1: u'\\mathcal{V}', -0x1d4b2: u'\\mathcal{W}', -0x1d4b3: u'\\mathcal{X}', -0x1d4b4: u'\\mathcal{Y}', -0x1d4b5: u'\\mathcal{Z}', -0x1d504: u'\\mathfrak{A}', -0x1d505: u'\\mathfrak{B}', -0x1d507: u'\\mathfrak{D}', -0x1d508: u'\\mathfrak{E}', -0x1d509: u'\\mathfrak{F}', -0x1d50a: u'\\mathfrak{G}', -0x1d50d: u'\\mathfrak{J}', -0x1d50e: u'\\mathfrak{K}', -0x1d50f: u'\\mathfrak{L}', -0x1d510: u'\\mathfrak{M}', -0x1d511: u'\\mathfrak{N}', -0x1d512: u'\\mathfrak{O}', -0x1d513: u'\\mathfrak{P}', -0x1d514: u'\\mathfrak{Q}', -0x1d516: u'\\mathfrak{S}', -0x1d517: u'\\mathfrak{T}', -0x1d518: u'\\mathfrak{U}', -0x1d519: u'\\mathfrak{V}', -0x1d51a: u'\\mathfrak{W}', -0x1d51b: u'\\mathfrak{X}', -0x1d51c: u'\\mathfrak{Y}', -0x1d51e: u'\\mathfrak{a}', -0x1d51f: u'\\mathfrak{b}', -0x1d520: u'\\mathfrak{c}', -0x1d521: u'\\mathfrak{d}', -0x1d522: u'\\mathfrak{e}', -0x1d523: u'\\mathfrak{f}', -0x1d524: u'\\mathfrak{g}', -0x1d525: u'\\mathfrak{h}', -0x1d526: u'\\mathfrak{i}', -0x1d527: u'\\mathfrak{j}', -0x1d528: u'\\mathfrak{k}', -0x1d529: u'\\mathfrak{l}', -0x1d52a: u'\\mathfrak{m}', -0x1d52b: u'\\mathfrak{n}', -0x1d52c: u'\\mathfrak{o}', -0x1d52d: u'\\mathfrak{p}', -0x1d52e: u'\\mathfrak{q}', -0x1d52f: u'\\mathfrak{r}', -0x1d530: u'\\mathfrak{s}', -0x1d531: u'\\mathfrak{t}', -0x1d532: u'\\mathfrak{u}', -0x1d533: u'\\mathfrak{v}', -0x1d534: u'\\mathfrak{w}', -0x1d535: u'\\mathfrak{x}', -0x1d536: u'\\mathfrak{y}', -0x1d537: u'\\mathfrak{z}', -0x1d538: u'\\mathbb{A}', -0x1d539: u'\\mathbb{B}', -0x1d53b: u'\\mathbb{D}', -0x1d53c: u'\\mathbb{E}', -0x1d53d: u'\\mathbb{F}', -0x1d53e: u'\\mathbb{G}', -0x1d540: u'\\mathbb{I}', -0x1d541: u'\\mathbb{J}', -0x1d542: u'\\mathbb{K}', -0x1d543: u'\\mathbb{L}', -0x1d544: u'\\mathbb{M}', -0x1d546: u'\\mathbb{O}', -0x1d54a: u'\\mathbb{S}', -0x1d54b: u'\\mathbb{T}', -0x1d54c: u'\\mathbb{U}', -0x1d54d: u'\\mathbb{V}', -0x1d54e: u'\\mathbb{W}', -0x1d54f: u'\\mathbb{X}', -0x1d550: u'\\mathbb{Y}', -0x1d55c: u'\\Bbbk ', -0x1d5a0: u'\\mathsf{A}', -0x1d5a1: u'\\mathsf{B}', -0x1d5a2: u'\\mathsf{C}', -0x1d5a3: u'\\mathsf{D}', -0x1d5a4: u'\\mathsf{E}', -0x1d5a5: u'\\mathsf{F}', -0x1d5a6: u'\\mathsf{G}', -0x1d5a7: u'\\mathsf{H}', -0x1d5a8: u'\\mathsf{I}', -0x1d5a9: u'\\mathsf{J}', -0x1d5aa: u'\\mathsf{K}', -0x1d5ab: u'\\mathsf{L}', -0x1d5ac: u'\\mathsf{M}', -0x1d5ad: u'\\mathsf{N}', -0x1d5ae: u'\\mathsf{O}', -0x1d5af: u'\\mathsf{P}', -0x1d5b0: u'\\mathsf{Q}', -0x1d5b1: u'\\mathsf{R}', -0x1d5b2: u'\\mathsf{S}', -0x1d5b3: u'\\mathsf{T}', -0x1d5b4: u'\\mathsf{U}', -0x1d5b5: u'\\mathsf{V}', -0x1d5b6: u'\\mathsf{W}', -0x1d5b7: u'\\mathsf{X}', -0x1d5b8: u'\\mathsf{Y}', -0x1d5b9: u'\\mathsf{Z}', -0x1d5ba: u'\\mathsf{a}', -0x1d5bb: u'\\mathsf{b}', -0x1d5bc: u'\\mathsf{c}', -0x1d5bd: u'\\mathsf{d}', -0x1d5be: u'\\mathsf{e}', -0x1d5bf: u'\\mathsf{f}', -0x1d5c0: u'\\mathsf{g}', -0x1d5c1: u'\\mathsf{h}', -0x1d5c2: u'\\mathsf{i}', -0x1d5c3: u'\\mathsf{j}', -0x1d5c4: u'\\mathsf{k}', -0x1d5c5: u'\\mathsf{l}', -0x1d5c6: u'\\mathsf{m}', -0x1d5c7: u'\\mathsf{n}', -0x1d5c8: u'\\mathsf{o}', -0x1d5c9: u'\\mathsf{p}', -0x1d5ca: u'\\mathsf{q}', -0x1d5cb: u'\\mathsf{r}', -0x1d5cc: u'\\mathsf{s}', -0x1d5cd: u'\\mathsf{t}', -0x1d5ce: u'\\mathsf{u}', -0x1d5cf: u'\\mathsf{v}', -0x1d5d0: u'\\mathsf{w}', -0x1d5d1: u'\\mathsf{x}', -0x1d5d2: u'\\mathsf{y}', -0x1d5d3: u'\\mathsf{z}', -0x1d670: u'\\mathtt{A}', -0x1d671: u'\\mathtt{B}', -0x1d672: u'\\mathtt{C}', -0x1d673: u'\\mathtt{D}', -0x1d674: u'\\mathtt{E}', -0x1d675: u'\\mathtt{F}', -0x1d676: u'\\mathtt{G}', -0x1d677: u'\\mathtt{H}', -0x1d678: u'\\mathtt{I}', -0x1d679: u'\\mathtt{J}', -0x1d67a: u'\\mathtt{K}', -0x1d67b: u'\\mathtt{L}', -0x1d67c: u'\\mathtt{M}', -0x1d67d: u'\\mathtt{N}', -0x1d67e: u'\\mathtt{O}', -0x1d67f: u'\\mathtt{P}', -0x1d680: u'\\mathtt{Q}', -0x1d681: u'\\mathtt{R}', -0x1d682: u'\\mathtt{S}', -0x1d683: u'\\mathtt{T}', -0x1d684: u'\\mathtt{U}', -0x1d685: u'\\mathtt{V}', -0x1d686: u'\\mathtt{W}', -0x1d687: u'\\mathtt{X}', -0x1d688: u'\\mathtt{Y}', -0x1d689: u'\\mathtt{Z}', -0x1d68a: u'\\mathtt{a}', -0x1d68b: u'\\mathtt{b}', -0x1d68c: u'\\mathtt{c}', -0x1d68d: u'\\mathtt{d}', -0x1d68e: u'\\mathtt{e}', -0x1d68f: u'\\mathtt{f}', -0x1d690: u'\\mathtt{g}', -0x1d691: u'\\mathtt{h}', -0x1d692: u'\\mathtt{i}', -0x1d693: u'\\mathtt{j}', -0x1d694: u'\\mathtt{k}', -0x1d695: u'\\mathtt{l}', -0x1d696: u'\\mathtt{m}', -0x1d697: u'\\mathtt{n}', -0x1d698: u'\\mathtt{o}', -0x1d699: u'\\mathtt{p}', -0x1d69a: u'\\mathtt{q}', -0x1d69b: u'\\mathtt{r}', -0x1d69c: u'\\mathtt{s}', -0x1d69d: u'\\mathtt{t}', -0x1d69e: u'\\mathtt{u}', -0x1d69f: u'\\mathtt{v}', -0x1d6a0: u'\\mathtt{w}', -0x1d6a1: u'\\mathtt{x}', -0x1d6a2: u'\\mathtt{y}', -0x1d6a3: u'\\mathtt{z}', -0x1d6a4: u'\\imath ', -0x1d6a5: u'\\jmath ', -0x1d6aa: u'\\mathbf{\\Gamma}', -0x1d6ab: u'\\mathbf{\\Delta}', -0x1d6af: u'\\mathbf{\\Theta}', -0x1d6b2: u'\\mathbf{\\Lambda}', -0x1d6b5: u'\\mathbf{\\Xi}', -0x1d6b7: u'\\mathbf{\\Pi}', -0x1d6ba: u'\\mathbf{\\Sigma}', -0x1d6bc: u'\\mathbf{\\Upsilon}', -0x1d6bd: u'\\mathbf{\\Phi}', -0x1d6bf: u'\\mathbf{\\Psi}', -0x1d6c0: u'\\mathbf{\\Omega}', -0x1d6e4: u'\\mathit{\\Gamma}', -0x1d6e5: u'\\mathit{\\Delta}', -0x1d6e9: u'\\mathit{\\Theta}', -0x1d6ec: u'\\mathit{\\Lambda}', -0x1d6ef: u'\\mathit{\\Xi}', -0x1d6f1: u'\\mathit{\\Pi}', -0x1d6f4: u'\\mathit{\\Sigma}', -0x1d6f6: u'\\mathit{\\Upsilon}', -0x1d6f7: u'\\mathit{\\Phi}', -0x1d6f9: u'\\mathit{\\Psi}', -0x1d6fa: u'\\mathit{\\Omega}', -0x1d6fc: u'\\alpha ', -0x1d6fd: u'\\beta ', -0x1d6fe: u'\\gamma ', -0x1d6ff: u'\\delta ', -0x1d700: u'\\varepsilon ', -0x1d701: u'\\zeta ', -0x1d702: u'\\eta ', -0x1d703: u'\\theta ', -0x1d704: u'\\iota ', -0x1d705: u'\\kappa ', -0x1d706: u'\\lambda ', -0x1d707: u'\\mu ', -0x1d708: u'\\nu ', -0x1d709: u'\\xi ', -0x1d70b: u'\\pi ', -0x1d70c: u'\\rho ', -0x1d70d: u'\\varsigma ', -0x1d70e: u'\\sigma ', -0x1d70f: u'\\tau ', -0x1d710: u'\\upsilon ', -0x1d711: u'\\varphi ', -0x1d712: u'\\chi ', -0x1d713: u'\\psi ', -0x1d714: u'\\omega ', -0x1d715: u'\\partial ', -0x1d716: u'\\epsilon ', -0x1d717: u'\\vartheta ', -0x1d718: u'\\varkappa ', -0x1d719: u'\\phi ', -0x1d71a: u'\\varrho ', -0x1d71b: u'\\varpi ', -0x1d7ce: u'\\mathbf{0}', -0x1d7cf: u'\\mathbf{1}', -0x1d7d0: u'\\mathbf{2}', -0x1d7d1: u'\\mathbf{3}', -0x1d7d2: u'\\mathbf{4}', -0x1d7d3: u'\\mathbf{5}', -0x1d7d4: u'\\mathbf{6}', -0x1d7d5: u'\\mathbf{7}', -0x1d7d6: u'\\mathbf{8}', -0x1d7d7: u'\\mathbf{9}', -0x1d7e2: u'\\mathsf{0}', -0x1d7e3: u'\\mathsf{1}', -0x1d7e4: u'\\mathsf{2}', -0x1d7e5: u'\\mathsf{3}', -0x1d7e6: u'\\mathsf{4}', -0x1d7e7: u'\\mathsf{5}', -0x1d7e8: u'\\mathsf{6}', -0x1d7e9: u'\\mathsf{7}', -0x1d7ea: u'\\mathsf{8}', -0x1d7eb: u'\\mathsf{9}', -0x1d7f6: u'\\mathtt{0}', -0x1d7f7: u'\\mathtt{1}', -0x1d7f8: u'\\mathtt{2}', -0x1d7f9: u'\\mathtt{3}', -0x1d7fa: u'\\mathtt{4}', -0x1d7fb: u'\\mathtt{5}', -0x1d7fc: u'\\mathtt{6}', -0x1d7fd: u'\\mathtt{7}', -0x1d7fe: u'\\mathtt{8}', -0x1d7ff: u'\\mathtt{9}', +0xa0: '~', +0xa3: '\\pounds ', +0xa5: '\\yen ', +0xa7: '\\S ', +0xac: '\\neg ', +0xb1: '\\pm ', +0xb6: '\\P ', +0xd7: '\\times ', +0xf0: '\\eth ', +0xf7: '\\div ', +0x131: '\\imath ', +0x237: '\\jmath ', +0x393: '\\Gamma ', +0x394: '\\Delta ', +0x398: '\\Theta ', +0x39b: '\\Lambda ', +0x39e: '\\Xi ', +0x3a0: '\\Pi ', +0x3a3: '\\Sigma ', +0x3a5: '\\Upsilon ', +0x3a6: '\\Phi ', +0x3a8: '\\Psi ', +0x3a9: '\\Omega ', +0x3b1: '\\alpha ', +0x3b2: '\\beta ', +0x3b3: '\\gamma ', +0x3b4: '\\delta ', +0x3b5: '\\varepsilon ', +0x3b6: '\\zeta ', +0x3b7: '\\eta ', +0x3b8: '\\theta ', +0x3b9: '\\iota ', +0x3ba: '\\kappa ', +0x3bb: '\\lambda ', +0x3bc: '\\mu ', +0x3bd: '\\nu ', +0x3be: '\\xi ', +0x3c0: '\\pi ', +0x3c1: '\\rho ', +0x3c2: '\\varsigma ', +0x3c3: '\\sigma ', +0x3c4: '\\tau ', +0x3c5: '\\upsilon ', +0x3c6: '\\varphi ', +0x3c7: '\\chi ', +0x3c8: '\\psi ', +0x3c9: '\\omega ', +0x3d1: '\\vartheta ', +0x3d5: '\\phi ', +0x3d6: '\\varpi ', +0x3dd: '\\digamma ', +0x3f0: '\\varkappa ', +0x3f1: '\\varrho ', +0x3f5: '\\epsilon ', +0x3f6: '\\backepsilon ', +0x2001: '\\quad ', +0x2003: '\\quad ', +0x2006: '\\, ', +0x2016: '\\| ', +0x2020: '\\dagger ', +0x2021: '\\ddagger ', +0x2022: '\\bullet ', +0x2026: '\\ldots ', +0x2032: '\\prime ', +0x2035: '\\backprime ', +0x205f: '\\: ', +0x2102: '\\mathbb{C}', +0x210b: '\\mathcal{H}', +0x210c: '\\mathfrak{H}', +0x210d: '\\mathbb{H}', +0x210f: '\\hslash ', +0x2110: '\\mathcal{I}', +0x2111: '\\Im ', +0x2112: '\\mathcal{L}', +0x2113: '\\ell ', +0x2115: '\\mathbb{N}', +0x2118: '\\wp ', +0x2119: '\\mathbb{P}', +0x211a: '\\mathbb{Q}', +0x211b: '\\mathcal{R}', +0x211c: '\\Re ', +0x211d: '\\mathbb{R}', +0x2124: '\\mathbb{Z}', +0x2127: '\\mho ', +0x2128: '\\mathfrak{Z}', +0x212c: '\\mathcal{B}', +0x212d: '\\mathfrak{C}', +0x2130: '\\mathcal{E}', +0x2131: '\\mathcal{F}', +0x2132: '\\Finv ', +0x2133: '\\mathcal{M}', +0x2135: '\\aleph ', +0x2136: '\\beth ', +0x2137: '\\gimel ', +0x2138: '\\daleth ', +0x2190: '\\leftarrow ', +0x2191: '\\uparrow ', +0x2192: '\\rightarrow ', +0x2193: '\\downarrow ', +0x2194: '\\leftrightarrow ', +0x2195: '\\updownarrow ', +0x2196: '\\nwarrow ', +0x2197: '\\nearrow ', +0x2198: '\\searrow ', +0x2199: '\\swarrow ', +0x219a: '\\nleftarrow ', +0x219b: '\\nrightarrow ', +0x219e: '\\twoheadleftarrow ', +0x21a0: '\\twoheadrightarrow ', +0x21a2: '\\leftarrowtail ', +0x21a3: '\\rightarrowtail ', +0x21a6: '\\mapsto ', +0x21a9: '\\hookleftarrow ', +0x21aa: '\\hookrightarrow ', +0x21ab: '\\looparrowleft ', +0x21ac: '\\looparrowright ', +0x21ad: '\\leftrightsquigarrow ', +0x21ae: '\\nleftrightarrow ', +0x21b0: '\\Lsh ', +0x21b1: '\\Rsh ', +0x21b6: '\\curvearrowleft ', +0x21b7: '\\curvearrowright ', +0x21ba: '\\circlearrowleft ', +0x21bb: '\\circlearrowright ', +0x21bc: '\\leftharpoonup ', +0x21bd: '\\leftharpoondown ', +0x21be: '\\upharpoonright ', +0x21bf: '\\upharpoonleft ', +0x21c0: '\\rightharpoonup ', +0x21c1: '\\rightharpoondown ', +0x21c2: '\\downharpoonright ', +0x21c3: '\\downharpoonleft ', +0x21c4: '\\rightleftarrows ', +0x21c6: '\\leftrightarrows ', +0x21c7: '\\leftleftarrows ', +0x21c8: '\\upuparrows ', +0x21c9: '\\rightrightarrows ', +0x21ca: '\\downdownarrows ', +0x21cb: '\\leftrightharpoons ', +0x21cc: '\\rightleftharpoons ', +0x21cd: '\\nLeftarrow ', +0x21ce: '\\nLeftrightarrow ', +0x21cf: '\\nRightarrow ', +0x21d0: '\\Leftarrow ', +0x21d1: '\\Uparrow ', +0x21d2: '\\Rightarrow ', +0x21d3: '\\Downarrow ', +0x21d4: '\\Leftrightarrow ', +0x21d5: '\\Updownarrow ', +0x21da: '\\Lleftarrow ', +0x21db: '\\Rrightarrow ', +0x21dd: '\\rightsquigarrow ', +0x21e0: '\\dashleftarrow ', +0x21e2: '\\dashrightarrow ', +0x2200: '\\forall ', +0x2201: '\\complement ', +0x2202: '\\partial ', +0x2203: '\\exists ', +0x2204: '\\nexists ', +0x2205: '\\emptyset ', +0x2207: '\\nabla ', +0x2208: '\\in ', +0x2209: '\\notin ', +0x220b: '\\ni ', +0x220f: '\\prod ', +0x2210: '\\coprod ', +0x2211: '\\sum ', +0x2212: '-', +0x2213: '\\mp ', +0x2214: '\\dotplus ', +0x2215: '\\slash ', +0x2216: '\\smallsetminus ', +0x2217: '\\ast ', +0x2218: '\\circ ', +0x2219: '\\bullet ', +0x221a: '\\surd ', +0x221b: '\\sqrt[3] ', +0x221c: '\\sqrt[4] ', +0x221d: '\\propto ', +0x221e: '\\infty ', +0x2220: '\\angle ', +0x2221: '\\measuredangle ', +0x2222: '\\sphericalangle ', +0x2223: '\\mid ', +0x2224: '\\nmid ', +0x2225: '\\parallel ', +0x2226: '\\nparallel ', +0x2227: '\\wedge ', +0x2228: '\\vee ', +0x2229: '\\cap ', +0x222a: '\\cup ', +0x222b: '\\int ', +0x222c: '\\iint ', +0x222d: '\\iiint ', +0x222e: '\\oint ', +0x2234: '\\therefore ', +0x2235: '\\because ', +0x2236: ':', +0x223c: '\\sim ', +0x223d: '\\backsim ', +0x2240: '\\wr ', +0x2241: '\\nsim ', +0x2242: '\\eqsim ', +0x2243: '\\simeq ', +0x2245: '\\cong ', +0x2247: '\\ncong ', +0x2248: '\\approx ', +0x224a: '\\approxeq ', +0x224d: '\\asymp ', +0x224e: '\\Bumpeq ', +0x224f: '\\bumpeq ', +0x2250: '\\doteq ', +0x2251: '\\Doteq ', +0x2252: '\\fallingdotseq ', +0x2253: '\\risingdotseq ', +0x2256: '\\eqcirc ', +0x2257: '\\circeq ', +0x225c: '\\triangleq ', +0x2260: '\\neq ', +0x2261: '\\equiv ', +0x2264: '\\leq ', +0x2265: '\\geq ', +0x2266: '\\leqq ', +0x2267: '\\geqq ', +0x2268: '\\lneqq ', +0x2269: '\\gneqq ', +0x226a: '\\ll ', +0x226b: '\\gg ', +0x226c: '\\between ', +0x226e: '\\nless ', +0x226f: '\\ngtr ', +0x2270: '\\nleq ', +0x2271: '\\ngeq ', +0x2272: '\\lesssim ', +0x2273: '\\gtrsim ', +0x2276: '\\lessgtr ', +0x2277: '\\gtrless ', +0x227a: '\\prec ', +0x227b: '\\succ ', +0x227c: '\\preccurlyeq ', +0x227d: '\\succcurlyeq ', +0x227e: '\\precsim ', +0x227f: '\\succsim ', +0x2280: '\\nprec ', +0x2281: '\\nsucc ', +0x2282: '\\subset ', +0x2283: '\\supset ', +0x2286: '\\subseteq ', +0x2287: '\\supseteq ', +0x2288: '\\nsubseteq ', +0x2289: '\\nsupseteq ', +0x228a: '\\subsetneq ', +0x228b: '\\supsetneq ', +0x228e: '\\uplus ', +0x228f: '\\sqsubset ', +0x2290: '\\sqsupset ', +0x2291: '\\sqsubseteq ', +0x2292: '\\sqsupseteq ', +0x2293: '\\sqcap ', +0x2294: '\\sqcup ', +0x2295: '\\oplus ', +0x2296: '\\ominus ', +0x2297: '\\otimes ', +0x2298: '\\oslash ', +0x2299: '\\odot ', +0x229a: '\\circledcirc ', +0x229b: '\\circledast ', +0x229d: '\\circleddash ', +0x229e: '\\boxplus ', +0x229f: '\\boxminus ', +0x22a0: '\\boxtimes ', +0x22a1: '\\boxdot ', +0x22a2: '\\vdash ', +0x22a3: '\\dashv ', +0x22a4: '\\top ', +0x22a5: '\\bot ', +0x22a7: '\\models ', +0x22a8: '\\vDash ', +0x22a9: '\\Vdash ', +0x22aa: '\\Vvdash ', +0x22ac: '\\nvdash ', +0x22ad: '\\nvDash ', +0x22ae: '\\nVdash ', +0x22af: '\\nVDash ', +0x22b2: '\\vartriangleleft ', +0x22b3: '\\vartriangleright ', +0x22b4: '\\trianglelefteq ', +0x22b5: '\\trianglerighteq ', +0x22b8: '\\multimap ', +0x22ba: '\\intercal ', +0x22bb: '\\veebar ', +0x22bc: '\\barwedge ', +0x22c0: '\\bigwedge ', +0x22c1: '\\bigvee ', +0x22c2: '\\bigcap ', +0x22c3: '\\bigcup ', +0x22c4: '\\diamond ', +0x22c5: '\\cdot ', +0x22c6: '\\star ', +0x22c7: '\\divideontimes ', +0x22c8: '\\bowtie ', +0x22c9: '\\ltimes ', +0x22ca: '\\rtimes ', +0x22cb: '\\leftthreetimes ', +0x22cc: '\\rightthreetimes ', +0x22cd: '\\backsimeq ', +0x22ce: '\\curlyvee ', +0x22cf: '\\curlywedge ', +0x22d0: '\\Subset ', +0x22d1: '\\Supset ', +0x22d2: '\\Cap ', +0x22d3: '\\Cup ', +0x22d4: '\\pitchfork ', +0x22d6: '\\lessdot ', +0x22d7: '\\gtrdot ', +0x22d8: '\\lll ', +0x22d9: '\\ggg ', +0x22da: '\\lesseqgtr ', +0x22db: '\\gtreqless ', +0x22de: '\\curlyeqprec ', +0x22df: '\\curlyeqsucc ', +0x22e0: '\\npreceq ', +0x22e1: '\\nsucceq ', +0x22e6: '\\lnsim ', +0x22e7: '\\gnsim ', +0x22e8: '\\precnsim ', +0x22e9: '\\succnsim ', +0x22ea: '\\ntriangleleft ', +0x22eb: '\\ntriangleright ', +0x22ec: '\\ntrianglelefteq ', +0x22ed: '\\ntrianglerighteq ', +0x22ee: '\\vdots ', +0x22ef: '\\cdots ', +0x22f1: '\\ddots ', +0x2308: '\\lceil ', +0x2309: '\\rceil ', +0x230a: '\\lfloor ', +0x230b: '\\rfloor ', +0x231c: '\\ulcorner ', +0x231d: '\\urcorner ', +0x231e: '\\llcorner ', +0x231f: '\\lrcorner ', +0x2322: '\\frown ', +0x2323: '\\smile ', +0x23aa: '\\bracevert ', +0x23b0: '\\lmoustache ', +0x23b1: '\\rmoustache ', +0x23d0: '\\arrowvert ', +0x23de: '\\overbrace ', +0x23df: '\\underbrace ', +0x24c7: '\\circledR ', +0x24c8: '\\circledS ', +0x25b2: '\\blacktriangle ', +0x25b3: '\\bigtriangleup ', +0x25b7: '\\triangleright ', +0x25bc: '\\blacktriangledown ', +0x25bd: '\\bigtriangledown ', +0x25c1: '\\triangleleft ', +0x25c7: '\\Diamond ', +0x25ca: '\\lozenge ', +0x25ef: '\\bigcirc ', +0x25fb: '\\square ', +0x25fc: '\\blacksquare ', +0x2605: '\\bigstar ', +0x2660: '\\spadesuit ', +0x2661: '\\heartsuit ', +0x2662: '\\diamondsuit ', +0x2663: '\\clubsuit ', +0x266d: '\\flat ', +0x266e: '\\natural ', +0x266f: '\\sharp ', +0x2713: '\\checkmark ', +0x2720: '\\maltese ', +0x27c2: '\\perp ', +0x27cb: '\\diagup ', +0x27cd: '\\diagdown ', +0x27e8: '\\langle ', +0x27e9: '\\rangle ', +0x27ee: '\\lgroup ', +0x27ef: '\\rgroup ', +0x27f5: '\\longleftarrow ', +0x27f6: '\\longrightarrow ', +0x27f7: '\\longleftrightarrow ', +0x27f8: '\\Longleftarrow ', +0x27f9: '\\Longrightarrow ', +0x27fa: '\\Longleftrightarrow ', +0x27fc: '\\longmapsto ', +0x29eb: '\\blacklozenge ', +0x29f5: '\\setminus ', +0x2a00: '\\bigodot ', +0x2a01: '\\bigoplus ', +0x2a02: '\\bigotimes ', +0x2a04: '\\biguplus ', +0x2a06: '\\bigsqcup ', +0x2a0c: '\\iiiint ', +0x2a3f: '\\amalg ', +0x2a5e: '\\doublebarwedge ', +0x2a7d: '\\leqslant ', +0x2a7e: '\\geqslant ', +0x2a85: '\\lessapprox ', +0x2a86: '\\gtrapprox ', +0x2a87: '\\lneq ', +0x2a88: '\\gneq ', +0x2a89: '\\lnapprox ', +0x2a8a: '\\gnapprox ', +0x2a8b: '\\lesseqqgtr ', +0x2a8c: '\\gtreqqless ', +0x2a95: '\\eqslantless ', +0x2a96: '\\eqslantgtr ', +0x2aaf: '\\preceq ', +0x2ab0: '\\succeq ', +0x2ab5: '\\precneqq ', +0x2ab6: '\\succneqq ', +0x2ab7: '\\precapprox ', +0x2ab8: '\\succapprox ', +0x2ab9: '\\precnapprox ', +0x2aba: '\\succnapprox ', +0x2ac5: '\\subseteqq ', +0x2ac6: '\\supseteqq ', +0x2acb: '\\subsetneqq ', +0x2acc: '\\supsetneqq ', +0x2b1c: '\\Box ', +0x1d400: '\\mathbf{A}', +0x1d401: '\\mathbf{B}', +0x1d402: '\\mathbf{C}', +0x1d403: '\\mathbf{D}', +0x1d404: '\\mathbf{E}', +0x1d405: '\\mathbf{F}', +0x1d406: '\\mathbf{G}', +0x1d407: '\\mathbf{H}', +0x1d408: '\\mathbf{I}', +0x1d409: '\\mathbf{J}', +0x1d40a: '\\mathbf{K}', +0x1d40b: '\\mathbf{L}', +0x1d40c: '\\mathbf{M}', +0x1d40d: '\\mathbf{N}', +0x1d40e: '\\mathbf{O}', +0x1d40f: '\\mathbf{P}', +0x1d410: '\\mathbf{Q}', +0x1d411: '\\mathbf{R}', +0x1d412: '\\mathbf{S}', +0x1d413: '\\mathbf{T}', +0x1d414: '\\mathbf{U}', +0x1d415: '\\mathbf{V}', +0x1d416: '\\mathbf{W}', +0x1d417: '\\mathbf{X}', +0x1d418: '\\mathbf{Y}', +0x1d419: '\\mathbf{Z}', +0x1d41a: '\\mathbf{a}', +0x1d41b: '\\mathbf{b}', +0x1d41c: '\\mathbf{c}', +0x1d41d: '\\mathbf{d}', +0x1d41e: '\\mathbf{e}', +0x1d41f: '\\mathbf{f}', +0x1d420: '\\mathbf{g}', +0x1d421: '\\mathbf{h}', +0x1d422: '\\mathbf{i}', +0x1d423: '\\mathbf{j}', +0x1d424: '\\mathbf{k}', +0x1d425: '\\mathbf{l}', +0x1d426: '\\mathbf{m}', +0x1d427: '\\mathbf{n}', +0x1d428: '\\mathbf{o}', +0x1d429: '\\mathbf{p}', +0x1d42a: '\\mathbf{q}', +0x1d42b: '\\mathbf{r}', +0x1d42c: '\\mathbf{s}', +0x1d42d: '\\mathbf{t}', +0x1d42e: '\\mathbf{u}', +0x1d42f: '\\mathbf{v}', +0x1d430: '\\mathbf{w}', +0x1d431: '\\mathbf{x}', +0x1d432: '\\mathbf{y}', +0x1d433: '\\mathbf{z}', +0x1d434: 'A', +0x1d435: 'B', +0x1d436: 'C', +0x1d437: 'D', +0x1d438: 'E', +0x1d439: 'F', +0x1d43a: 'G', +0x1d43b: 'H', +0x1d43c: 'I', +0x1d43d: 'J', +0x1d43e: 'K', +0x1d43f: 'L', +0x1d440: 'M', +0x1d441: 'N', +0x1d442: 'O', +0x1d443: 'P', +0x1d444: 'Q', +0x1d445: 'R', +0x1d446: 'S', +0x1d447: 'T', +0x1d448: 'U', +0x1d449: 'V', +0x1d44a: 'W', +0x1d44b: 'X', +0x1d44c: 'Y', +0x1d44d: 'Z', +0x1d44e: 'a', +0x1d44f: 'b', +0x1d450: 'c', +0x1d451: 'd', +0x1d452: 'e', +0x1d453: 'f', +0x1d454: 'g', +0x1d456: 'i', +0x1d457: 'j', +0x1d458: 'k', +0x1d459: 'l', +0x1d45a: 'm', +0x1d45b: 'n', +0x1d45c: 'o', +0x1d45d: 'p', +0x1d45e: 'q', +0x1d45f: 'r', +0x1d460: 's', +0x1d461: 't', +0x1d462: 'u', +0x1d463: 'v', +0x1d464: 'w', +0x1d465: 'x', +0x1d466: 'y', +0x1d467: 'z', +0x1d49c: '\\mathcal{A}', +0x1d49e: '\\mathcal{C}', +0x1d49f: '\\mathcal{D}', +0x1d4a2: '\\mathcal{G}', +0x1d4a5: '\\mathcal{J}', +0x1d4a6: '\\mathcal{K}', +0x1d4a9: '\\mathcal{N}', +0x1d4aa: '\\mathcal{O}', +0x1d4ab: '\\mathcal{P}', +0x1d4ac: '\\mathcal{Q}', +0x1d4ae: '\\mathcal{S}', +0x1d4af: '\\mathcal{T}', +0x1d4b0: '\\mathcal{U}', +0x1d4b1: '\\mathcal{V}', +0x1d4b2: '\\mathcal{W}', +0x1d4b3: '\\mathcal{X}', +0x1d4b4: '\\mathcal{Y}', +0x1d4b5: '\\mathcal{Z}', +0x1d504: '\\mathfrak{A}', +0x1d505: '\\mathfrak{B}', +0x1d507: '\\mathfrak{D}', +0x1d508: '\\mathfrak{E}', +0x1d509: '\\mathfrak{F}', +0x1d50a: '\\mathfrak{G}', +0x1d50d: '\\mathfrak{J}', +0x1d50e: '\\mathfrak{K}', +0x1d50f: '\\mathfrak{L}', +0x1d510: '\\mathfrak{M}', +0x1d511: '\\mathfrak{N}', +0x1d512: '\\mathfrak{O}', +0x1d513: '\\mathfrak{P}', +0x1d514: '\\mathfrak{Q}', +0x1d516: '\\mathfrak{S}', +0x1d517: '\\mathfrak{T}', +0x1d518: '\\mathfrak{U}', +0x1d519: '\\mathfrak{V}', +0x1d51a: '\\mathfrak{W}', +0x1d51b: '\\mathfrak{X}', +0x1d51c: '\\mathfrak{Y}', +0x1d51e: '\\mathfrak{a}', +0x1d51f: '\\mathfrak{b}', +0x1d520: '\\mathfrak{c}', +0x1d521: '\\mathfrak{d}', +0x1d522: '\\mathfrak{e}', +0x1d523: '\\mathfrak{f}', +0x1d524: '\\mathfrak{g}', +0x1d525: '\\mathfrak{h}', +0x1d526: '\\mathfrak{i}', +0x1d527: '\\mathfrak{j}', +0x1d528: '\\mathfrak{k}', +0x1d529: '\\mathfrak{l}', +0x1d52a: '\\mathfrak{m}', +0x1d52b: '\\mathfrak{n}', +0x1d52c: '\\mathfrak{o}', +0x1d52d: '\\mathfrak{p}', +0x1d52e: '\\mathfrak{q}', +0x1d52f: '\\mathfrak{r}', +0x1d530: '\\mathfrak{s}', +0x1d531: '\\mathfrak{t}', +0x1d532: '\\mathfrak{u}', +0x1d533: '\\mathfrak{v}', +0x1d534: '\\mathfrak{w}', +0x1d535: '\\mathfrak{x}', +0x1d536: '\\mathfrak{y}', +0x1d537: '\\mathfrak{z}', +0x1d538: '\\mathbb{A}', +0x1d539: '\\mathbb{B}', +0x1d53b: '\\mathbb{D}', +0x1d53c: '\\mathbb{E}', +0x1d53d: '\\mathbb{F}', +0x1d53e: '\\mathbb{G}', +0x1d540: '\\mathbb{I}', +0x1d541: '\\mathbb{J}', +0x1d542: '\\mathbb{K}', +0x1d543: '\\mathbb{L}', +0x1d544: '\\mathbb{M}', +0x1d546: '\\mathbb{O}', +0x1d54a: '\\mathbb{S}', +0x1d54b: '\\mathbb{T}', +0x1d54c: '\\mathbb{U}', +0x1d54d: '\\mathbb{V}', +0x1d54e: '\\mathbb{W}', +0x1d54f: '\\mathbb{X}', +0x1d550: '\\mathbb{Y}', +0x1d55c: '\\Bbbk ', +0x1d5a0: '\\mathsf{A}', +0x1d5a1: '\\mathsf{B}', +0x1d5a2: '\\mathsf{C}', +0x1d5a3: '\\mathsf{D}', +0x1d5a4: '\\mathsf{E}', +0x1d5a5: '\\mathsf{F}', +0x1d5a6: '\\mathsf{G}', +0x1d5a7: '\\mathsf{H}', +0x1d5a8: '\\mathsf{I}', +0x1d5a9: '\\mathsf{J}', +0x1d5aa: '\\mathsf{K}', +0x1d5ab: '\\mathsf{L}', +0x1d5ac: '\\mathsf{M}', +0x1d5ad: '\\mathsf{N}', +0x1d5ae: '\\mathsf{O}', +0x1d5af: '\\mathsf{P}', +0x1d5b0: '\\mathsf{Q}', +0x1d5b1: '\\mathsf{R}', +0x1d5b2: '\\mathsf{S}', +0x1d5b3: '\\mathsf{T}', +0x1d5b4: '\\mathsf{U}', +0x1d5b5: '\\mathsf{V}', +0x1d5b6: '\\mathsf{W}', +0x1d5b7: '\\mathsf{X}', +0x1d5b8: '\\mathsf{Y}', +0x1d5b9: '\\mathsf{Z}', +0x1d5ba: '\\mathsf{a}', +0x1d5bb: '\\mathsf{b}', +0x1d5bc: '\\mathsf{c}', +0x1d5bd: '\\mathsf{d}', +0x1d5be: '\\mathsf{e}', +0x1d5bf: '\\mathsf{f}', +0x1d5c0: '\\mathsf{g}', +0x1d5c1: '\\mathsf{h}', +0x1d5c2: '\\mathsf{i}', +0x1d5c3: '\\mathsf{j}', +0x1d5c4: '\\mathsf{k}', +0x1d5c5: '\\mathsf{l}', +0x1d5c6: '\\mathsf{m}', +0x1d5c7: '\\mathsf{n}', +0x1d5c8: '\\mathsf{o}', +0x1d5c9: '\\mathsf{p}', +0x1d5ca: '\\mathsf{q}', +0x1d5cb: '\\mathsf{r}', +0x1d5cc: '\\mathsf{s}', +0x1d5cd: '\\mathsf{t}', +0x1d5ce: '\\mathsf{u}', +0x1d5cf: '\\mathsf{v}', +0x1d5d0: '\\mathsf{w}', +0x1d5d1: '\\mathsf{x}', +0x1d5d2: '\\mathsf{y}', +0x1d5d3: '\\mathsf{z}', +0x1d670: '\\mathtt{A}', +0x1d671: '\\mathtt{B}', +0x1d672: '\\mathtt{C}', +0x1d673: '\\mathtt{D}', +0x1d674: '\\mathtt{E}', +0x1d675: '\\mathtt{F}', +0x1d676: '\\mathtt{G}', +0x1d677: '\\mathtt{H}', +0x1d678: '\\mathtt{I}', +0x1d679: '\\mathtt{J}', +0x1d67a: '\\mathtt{K}', +0x1d67b: '\\mathtt{L}', +0x1d67c: '\\mathtt{M}', +0x1d67d: '\\mathtt{N}', +0x1d67e: '\\mathtt{O}', +0x1d67f: '\\mathtt{P}', +0x1d680: '\\mathtt{Q}', +0x1d681: '\\mathtt{R}', +0x1d682: '\\mathtt{S}', +0x1d683: '\\mathtt{T}', +0x1d684: '\\mathtt{U}', +0x1d685: '\\mathtt{V}', +0x1d686: '\\mathtt{W}', +0x1d687: '\\mathtt{X}', +0x1d688: '\\mathtt{Y}', +0x1d689: '\\mathtt{Z}', +0x1d68a: '\\mathtt{a}', +0x1d68b: '\\mathtt{b}', +0x1d68c: '\\mathtt{c}', +0x1d68d: '\\mathtt{d}', +0x1d68e: '\\mathtt{e}', +0x1d68f: '\\mathtt{f}', +0x1d690: '\\mathtt{g}', +0x1d691: '\\mathtt{h}', +0x1d692: '\\mathtt{i}', +0x1d693: '\\mathtt{j}', +0x1d694: '\\mathtt{k}', +0x1d695: '\\mathtt{l}', +0x1d696: '\\mathtt{m}', +0x1d697: '\\mathtt{n}', +0x1d698: '\\mathtt{o}', +0x1d699: '\\mathtt{p}', +0x1d69a: '\\mathtt{q}', +0x1d69b: '\\mathtt{r}', +0x1d69c: '\\mathtt{s}', +0x1d69d: '\\mathtt{t}', +0x1d69e: '\\mathtt{u}', +0x1d69f: '\\mathtt{v}', +0x1d6a0: '\\mathtt{w}', +0x1d6a1: '\\mathtt{x}', +0x1d6a2: '\\mathtt{y}', +0x1d6a3: '\\mathtt{z}', +0x1d6a4: '\\imath ', +0x1d6a5: '\\jmath ', +0x1d6aa: '\\mathbf{\\Gamma}', +0x1d6ab: '\\mathbf{\\Delta}', +0x1d6af: '\\mathbf{\\Theta}', +0x1d6b2: '\\mathbf{\\Lambda}', +0x1d6b5: '\\mathbf{\\Xi}', +0x1d6b7: '\\mathbf{\\Pi}', +0x1d6ba: '\\mathbf{\\Sigma}', +0x1d6bc: '\\mathbf{\\Upsilon}', +0x1d6bd: '\\mathbf{\\Phi}', +0x1d6bf: '\\mathbf{\\Psi}', +0x1d6c0: '\\mathbf{\\Omega}', +0x1d6e4: '\\mathit{\\Gamma}', +0x1d6e5: '\\mathit{\\Delta}', +0x1d6e9: '\\mathit{\\Theta}', +0x1d6ec: '\\mathit{\\Lambda}', +0x1d6ef: '\\mathit{\\Xi}', +0x1d6f1: '\\mathit{\\Pi}', +0x1d6f4: '\\mathit{\\Sigma}', +0x1d6f6: '\\mathit{\\Upsilon}', +0x1d6f7: '\\mathit{\\Phi}', +0x1d6f9: '\\mathit{\\Psi}', +0x1d6fa: '\\mathit{\\Omega}', +0x1d6fc: '\\alpha ', +0x1d6fd: '\\beta ', +0x1d6fe: '\\gamma ', +0x1d6ff: '\\delta ', +0x1d700: '\\varepsilon ', +0x1d701: '\\zeta ', +0x1d702: '\\eta ', +0x1d703: '\\theta ', +0x1d704: '\\iota ', +0x1d705: '\\kappa ', +0x1d706: '\\lambda ', +0x1d707: '\\mu ', +0x1d708: '\\nu ', +0x1d709: '\\xi ', +0x1d70b: '\\pi ', +0x1d70c: '\\rho ', +0x1d70d: '\\varsigma ', +0x1d70e: '\\sigma ', +0x1d70f: '\\tau ', +0x1d710: '\\upsilon ', +0x1d711: '\\varphi ', +0x1d712: '\\chi ', +0x1d713: '\\psi ', +0x1d714: '\\omega ', +0x1d715: '\\partial ', +0x1d716: '\\epsilon ', +0x1d717: '\\vartheta ', +0x1d718: '\\varkappa ', +0x1d719: '\\phi ', +0x1d71a: '\\varrho ', +0x1d71b: '\\varpi ', +0x1d7ce: '\\mathbf{0}', +0x1d7cf: '\\mathbf{1}', +0x1d7d0: '\\mathbf{2}', +0x1d7d1: '\\mathbf{3}', +0x1d7d2: '\\mathbf{4}', +0x1d7d3: '\\mathbf{5}', +0x1d7d4: '\\mathbf{6}', +0x1d7d5: '\\mathbf{7}', +0x1d7d6: '\\mathbf{8}', +0x1d7d7: '\\mathbf{9}', +0x1d7e2: '\\mathsf{0}', +0x1d7e3: '\\mathsf{1}', +0x1d7e4: '\\mathsf{2}', +0x1d7e5: '\\mathsf{3}', +0x1d7e6: '\\mathsf{4}', +0x1d7e7: '\\mathsf{5}', +0x1d7e8: '\\mathsf{6}', +0x1d7e9: '\\mathsf{7}', +0x1d7ea: '\\mathsf{8}', +0x1d7eb: '\\mathsf{9}', +0x1d7f6: '\\mathtt{0}', +0x1d7f7: '\\mathtt{1}', +0x1d7f8: '\\mathtt{2}', +0x1d7f9: '\\mathtt{3}', +0x1d7fa: '\\mathtt{4}', +0x1d7fb: '\\mathtt{5}', +0x1d7fc: '\\mathtt{6}', +0x1d7fd: '\\mathtt{7}', +0x1d7fe: '\\mathtt{8}', +0x1d7ff: '\\mathtt{9}', } diff --git a/docutils/docutils/utils/punctuation_chars.py b/docutils/docutils/utils/punctuation_chars.py index 593efc186..46aa85eda 100644 --- a/docutils/docutils/utils/punctuation_chars.py +++ b/docutils/docutils/utils/punctuation_chars.py @@ -42,66 +42,66 @@ https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#inline-markup-recognition-rules """ -openers = (u'"\'(<\\[{\u0f3a\u0f3c\u169b\u2045\u207d\u208d\u2329\u2768' - u'\u276a\u276c\u276e\u2770\u2772\u2774\u27c5\u27e6\u27e8\u27ea' - u'\u27ec\u27ee\u2983\u2985\u2987\u2989\u298b\u298d\u298f\u2991' - u'\u2993\u2995\u2997\u29d8\u29da\u29fc\u2e22\u2e24\u2e26\u2e28' - u'\u3008\u300a\u300c\u300e\u3010\u3014\u3016\u3018\u301a\u301d' - u'\u301d\ufd3e\ufe17\ufe35\ufe37\ufe39\ufe3b\ufe3d\ufe3f\ufe41' - u'\ufe43\ufe47\ufe59\ufe5b\ufe5d\uff08\uff3b\uff5b\uff5f\uff62' - u'\xab\u2018\u201c\u2039\u2e02\u2e04\u2e09\u2e0c\u2e1c\u2e20' - u'\u201a\u201e\xbb\u2019\u201d\u203a\u2e03\u2e05\u2e0a\u2e0d' - u'\u2e1d\u2e21\u201b\u201f') -closers = (u'"\')>\\]}\u0f3b\u0f3d\u169c\u2046\u207e\u208e\u232a\u2769' - u'\u276b\u276d\u276f\u2771\u2773\u2775\u27c6\u27e7\u27e9\u27eb' - u'\u27ed\u27ef\u2984\u2986\u2988\u298a\u298c\u298e\u2990\u2992' - u'\u2994\u2996\u2998\u29d9\u29db\u29fd\u2e23\u2e25\u2e27\u2e29' - u'\u3009\u300b\u300d\u300f\u3011\u3015\u3017\u3019\u301b\u301e' - u'\u301f\ufd3f\ufe18\ufe36\ufe38\ufe3a\ufe3c\ufe3e\ufe40\ufe42' - u'\ufe44\ufe48\ufe5a\ufe5c\ufe5e\uff09\uff3d\uff5d\uff60\uff63' - u'\xbb\u2019\u201d\u203a\u2e03\u2e05\u2e0a\u2e0d\u2e1d\u2e21' - u'\u201b\u201f\xab\u2018\u201c\u2039\u2e02\u2e04\u2e09\u2e0c' - u'\u2e1c\u2e20\u201a\u201e') -delimiters = (u'\\-/:\u058a\xa1\xb7\xbf\u037e\u0387\u055a-\u055f\u0589' - u'\u05be\u05c0\u05c3\u05c6\u05f3\u05f4\u0609\u060a\u060c' - u'\u060d\u061b\u061e\u061f\u066a-\u066d\u06d4\u0700-\u070d' - u'\u07f7-\u07f9\u0830-\u083e\u0964\u0965\u0970\u0df4\u0e4f' - u'\u0e5a\u0e5b\u0f04-\u0f12\u0f85\u0fd0-\u0fd4\u104a-\u104f' - u'\u10fb\u1361-\u1368\u1400\u166d\u166e\u16eb-\u16ed\u1735' - u'\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944\u1945' - u'\u19de\u19df\u1a1e\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-' - u'\u1b60\u1c3b-\u1c3f\u1c7e\u1c7f\u1cd3\u2010-\u2017\u2020-' - u'\u2027\u2030-\u2038\u203b-\u203e\u2041-\u2043\u2047-' - u'\u2051\u2053\u2055-\u205e\u2cf9-\u2cfc\u2cfe\u2cff\u2e00' - u'\u2e01\u2e06-\u2e08\u2e0b\u2e0e-\u2e1b\u2e1e\u2e1f\u2e2a-' - u'\u2e2e\u2e30\u2e31\u3001-\u3003\u301c\u3030\u303d\u30a0' - u'\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7' - u'\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f' - u'\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\uabeb' - u'\ufe10-\ufe16\ufe19\ufe30-\ufe32\ufe45\ufe46\ufe49-\ufe4c' - u'\ufe50-\ufe52\ufe54-\ufe58\ufe5f-\ufe61\ufe63\ufe68\ufe6a' - u'\ufe6b\uff01-\uff03\uff05-\uff07\uff0a\uff0c-\uff0f\uff1a' - u'\uff1b\uff1f\uff20\uff3c\uff61\uff64\uff65') +openers = ('"\'(<\\[{\u0f3a\u0f3c\u169b\u2045\u207d\u208d\u2329\u2768' + '\u276a\u276c\u276e\u2770\u2772\u2774\u27c5\u27e6\u27e8\u27ea' + '\u27ec\u27ee\u2983\u2985\u2987\u2989\u298b\u298d\u298f\u2991' + '\u2993\u2995\u2997\u29d8\u29da\u29fc\u2e22\u2e24\u2e26\u2e28' + '\u3008\u300a\u300c\u300e\u3010\u3014\u3016\u3018\u301a\u301d' + '\u301d\ufd3e\ufe17\ufe35\ufe37\ufe39\ufe3b\ufe3d\ufe3f\ufe41' + '\ufe43\ufe47\ufe59\ufe5b\ufe5d\uff08\uff3b\uff5b\uff5f\uff62' + '\xab\u2018\u201c\u2039\u2e02\u2e04\u2e09\u2e0c\u2e1c\u2e20' + '\u201a\u201e\xbb\u2019\u201d\u203a\u2e03\u2e05\u2e0a\u2e0d' + '\u2e1d\u2e21\u201b\u201f') +closers = ('"\')>\\]}\u0f3b\u0f3d\u169c\u2046\u207e\u208e\u232a\u2769' + '\u276b\u276d\u276f\u2771\u2773\u2775\u27c6\u27e7\u27e9\u27eb' + '\u27ed\u27ef\u2984\u2986\u2988\u298a\u298c\u298e\u2990\u2992' + '\u2994\u2996\u2998\u29d9\u29db\u29fd\u2e23\u2e25\u2e27\u2e29' + '\u3009\u300b\u300d\u300f\u3011\u3015\u3017\u3019\u301b\u301e' + '\u301f\ufd3f\ufe18\ufe36\ufe38\ufe3a\ufe3c\ufe3e\ufe40\ufe42' + '\ufe44\ufe48\ufe5a\ufe5c\ufe5e\uff09\uff3d\uff5d\uff60\uff63' + '\xbb\u2019\u201d\u203a\u2e03\u2e05\u2e0a\u2e0d\u2e1d\u2e21' + '\u201b\u201f\xab\u2018\u201c\u2039\u2e02\u2e04\u2e09\u2e0c' + '\u2e1c\u2e20\u201a\u201e') +delimiters = ('\\-/:\u058a\xa1\xb7\xbf\u037e\u0387\u055a-\u055f\u0589' + '\u05be\u05c0\u05c3\u05c6\u05f3\u05f4\u0609\u060a\u060c' + '\u060d\u061b\u061e\u061f\u066a-\u066d\u06d4\u0700-\u070d' + '\u07f7-\u07f9\u0830-\u083e\u0964\u0965\u0970\u0df4\u0e4f' + '\u0e5a\u0e5b\u0f04-\u0f12\u0f85\u0fd0-\u0fd4\u104a-\u104f' + '\u10fb\u1361-\u1368\u1400\u166d\u166e\u16eb-\u16ed\u1735' + '\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944\u1945' + '\u19de\u19df\u1a1e\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-' + '\u1b60\u1c3b-\u1c3f\u1c7e\u1c7f\u1cd3\u2010-\u2017\u2020-' + '\u2027\u2030-\u2038\u203b-\u203e\u2041-\u2043\u2047-' + '\u2051\u2053\u2055-\u205e\u2cf9-\u2cfc\u2cfe\u2cff\u2e00' + '\u2e01\u2e06-\u2e08\u2e0b\u2e0e-\u2e1b\u2e1e\u2e1f\u2e2a-' + '\u2e2e\u2e30\u2e31\u3001-\u3003\u301c\u3030\u303d\u30a0' + '\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7' + '\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f' + '\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\uabeb' + '\ufe10-\ufe16\ufe19\ufe30-\ufe32\ufe45\ufe46\ufe49-\ufe4c' + '\ufe50-\ufe52\ufe54-\ufe58\ufe5f-\ufe61\ufe63\ufe68\ufe6a' + '\ufe6b\uff01-\uff03\uff05-\uff07\uff0a\uff0c-\uff0f\uff1a' + '\uff1b\uff1f\uff20\uff3c\uff61\uff64\uff65') if sys.maxunicode >= 0x10FFFF: # "wide" build - delimiters += (u'\U00010100\U00010101\U0001039f\U000103d0\U00010857' - u'\U0001091f\U0001093f\U00010a50-\U00010a58\U00010a7f' - u'\U00010b39-\U00010b3f\U000110bb\U000110bc\U000110be-' - u'\U000110c1\U00012470-\U00012473') -closing_delimiters = u'\\\\.,;!?' + delimiters += ('\U00010100\U00010101\U0001039f\U000103d0\U00010857' + '\U0001091f\U0001093f\U00010a50-\U00010a58\U00010a7f' + '\U00010b39-\U00010b3f\U000110bb\U000110bc\U000110be-' + '\U000110c1\U00012470-\U00012473') +closing_delimiters = '\\\\.,;!?' # Matching open/close quotes # -------------------------- quote_pairs = {# open char: matching closing characters # usage example - u'\xbb': u'\xbb', # » » Swedish - u'\u2018': u'\u201a', # ‘ ‚ Albanian/Greek/Turkish - u'\u2019': u'\u2019', # ’ ’ Swedish - u'\u201a': u'\u2018\u2019', # ‚ ‘ German ‚ ’ Polish - u'\u201c': u'\u201e', # “ „ Albanian/Greek/Turkish - u'\u201e': u'\u201c\u201d', # „ “ German „ ” Polish - u'\u201d': u'\u201d', # ” ” Swedish - u'\u203a': u'\u203a', # › › Swedish + '\xbb': '\xbb', # » » Swedish + '\u2018': '\u201a', # ‘ ‚ Albanian/Greek/Turkish + '\u2019': '\u2019', # ’ ’ Swedish + '\u201a': '\u2018\u2019', # ‚ ‘ German ‚ ’ Polish + '\u201c': '\u201e', # “ „ Albanian/Greek/Turkish + '\u201e': '\u201c\u201d', # „ “ German „ ” Polish + '\u201d': '\u201d', # ” ” Swedish + '\u203a': '\u203a', # › › Swedish } """Additional open/close quote pairs.""" @@ -118,4 +118,4 @@ def match_chars(c1, c2): i = openers.index(c1) except ValueError: # c1 not in openers return False - return c2 == closers[i] or c2 in quote_pairs.get(c1, u'') + return c2 == closers[i] or c2 in quote_pairs.get(c1, '') diff --git a/docutils/docutils/utils/smartquotes.py b/docutils/docutils/utils/smartquotes.py index cd3a3136c..f2dadb2ee 100644 --- a/docutils/docutils/utils/smartquotes.py +++ b/docutils/docutils/utils/smartquotes.py @@ -385,10 +385,10 @@ class smartchars(object): """Smart quotes and dashes """ - endash = u'–' # "–" EN DASH - emdash = u'—' # "—" EM DASH - ellipsis = u'…' # "…" HORIZONTAL ELLIPSIS - apostrophe = u'’' # "’" RIGHT SINGLE QUOTATION MARK + endash = '–' # "–" EN DASH + emdash = '—' # "—" EM DASH + ellipsis = '…' # "…" HORIZONTAL ELLIPSIS + apostrophe = '’' # "’" RIGHT SINGLE QUOTATION MARK # quote characters (language-specific, set in __init__()) # [1] https://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks @@ -403,91 +403,91 @@ class smartchars(object): # [10] http://www.typografi.org/sitat/sitatart.html # # See also configuration option "smartquote-locales". - quotes = {'af': u'“”‘’', - 'af-x-altquot': u'„”‚’', - 'bg': u'„“‚‘', # Bulgarian, https://bg.wikipedia.org/wiki/Кавички - 'ca': u'«»“”', - 'ca-x-altquot': u'“”‘’', - 'cs': u'„“‚‘', - 'cs-x-altquot': u'»«›‹', - 'da': u'»«›‹', - 'da-x-altquot': u'„“‚‘', - # 'da-x-altquot2': u'””’’', - 'de': u'„“‚‘', - 'de-x-altquot': u'»«›‹', - 'de-ch': u'«»‹›', - 'el': u'«»“”', - 'en': u'“”‘’', - 'en-uk-x-altquot': u'‘’“”', # Attention: " → ‘ and ' → “ ! - 'eo': u'“”‘’', - 'es': u'«»“”', - 'es-x-altquot': u'“”‘’', - 'et': u'„“‚‘', # no secondary quote listed in - 'et-x-altquot': u'«»‹›', # the sources above (wikipedia.org) - 'eu': u'«»‹›', - 'fi': u'””’’', - 'fi-x-altquot': u'»»››', - 'fr': (u'« ', u' »', u'“', u'”'), # full no-break space - 'fr-x-altquot': (u'« ', u' »', u'“', u'”'), # narrow no-break space - 'fr-ch': u'«»‹›', - 'fr-ch-x-altquot': (u'« ', u' »', u'‹ ', u' ›'), # narrow no-break space, http://typoguide.ch/ - 'gl': u'«»“”', - 'he': u'”“»«', # Hebrew is RTL, test position: - 'he-x-altquot': u'„”‚’', # low quotation marks are opening. - # 'he-x-altquot': u'“„‘‚', # RTL: low quotation marks opening - 'hr': u'„”‘’', # http://hrvatska-tipografija.com/polunavodnici/ - 'hr-x-altquot': u'»«›‹', - 'hsb': u'„“‚‘', - 'hsb-x-altquot': u'»«›‹', - 'hu': u'„”«»', - 'is': u'„“‚‘', - 'it': u'«»“”', - 'it-ch': u'«»‹›', - 'it-x-altquot': u'“”‘’', - # 'it-x-altquot2': u'“„‘‚', # [7] in headlines - 'ja': u'「」『』', - 'ko': u'“”‘’', - 'lt': u'„“‚‘', - 'lv': u'„“‚‘', - 'mk': u'„“‚‘', # Macedonian, https://mk.wikipedia.org/wiki/Правопис_и_правоговор_на_македонскиот_јазик - 'nl': u'“”‘’', - 'nl-x-altquot': u'„”‚’', - # 'nl-x-altquot2': u'””’’', - 'nb': u'«»’’', # Norsk bokmål (canonical form 'no') - 'nn': u'«»’’', # Nynorsk [10] - 'nn-x-altquot': u'«»‘’', # [8], [10] - # 'nn-x-altquot2': u'«»«»', # [9], [10 - # 'nn-x-altquot3': u'„“‚‘', # [10] - 'no': u'«»’’', # Norsk bokmål [10] - 'no-x-altquot': u'«»‘’', # [8], [10] - # 'no-x-altquot2': u'«»«»', # [9], [10 - # 'no-x-altquot3': u'„“‚‘', # [10] - 'pl': u'„”«»', - 'pl-x-altquot': u'«»‚’', - # 'pl-x-altquot2': u'„”‚’', # https://pl.wikipedia.org/wiki/Cudzys%C5%82%C3%B3w - 'pt': u'«»“”', - 'pt-br': u'“”‘’', - 'ro': u'„”«»', - 'ru': u'«»„“', - 'sh': u'„”‚’', # Serbo-Croatian - 'sh-x-altquot': u'»«›‹', - 'sk': u'„“‚‘', # Slovak - 'sk-x-altquot': u'»«›‹', - 'sl': u'„“‚‘', # Slovenian - 'sl-x-altquot': u'»«›‹', - 'sq': u'«»‹›', # Albanian - 'sq-x-altquot': u'“„‘‚', - 'sr': u'„”’’', - 'sr-x-altquot': u'»«›‹', - 'sv': u'””’’', - 'sv-x-altquot': u'»»››', - 'tr': u'“”‘’', - 'tr-x-altquot': u'«»‹›', - # 'tr-x-altquot2': u'“„‘‚', # [7] antiquated? - 'uk': u'«»„“', - 'uk-x-altquot': u'„“‚‘', - 'zh-cn': u'“”‘’', - 'zh-tw': u'「」『』', + quotes = {'af': '“”‘’', + 'af-x-altquot': '„”‚’', + 'bg': '„“‚‘', # Bulgarian, https://bg.wikipedia.org/wiki/Кавички + 'ca': '«»“”', + 'ca-x-altquot': '“”‘’', + 'cs': '„“‚‘', + 'cs-x-altquot': '»«›‹', + 'da': '»«›‹', + 'da-x-altquot': '„“‚‘', + # 'da-x-altquot2': '””’’', + 'de': '„“‚‘', + 'de-x-altquot': '»«›‹', + 'de-ch': '«»‹›', + 'el': '«»“”', + 'en': '“”‘’', + 'en-uk-x-altquot': '‘’“”', # Attention: " → ‘ and ' → “ ! + 'eo': '“”‘’', + 'es': '«»“”', + 'es-x-altquot': '“”‘’', + 'et': '„“‚‘', # no secondary quote listed in + 'et-x-altquot': '«»‹›', # the sources above (wikipedia.org) + 'eu': '«»‹›', + 'fi': '””’’', + 'fi-x-altquot': '»»››', + 'fr': ('« ', ' »', '“', '”'), # full no-break space + 'fr-x-altquot': ('« ', ' »', '“', '”'), # narrow no-break space + 'fr-ch': '«»‹›', + 'fr-ch-x-altquot': ('« ', ' »', '‹ ', ' ›'), # narrow no-break space, http://typoguide.ch/ + 'gl': '«»“”', + 'he': '”“»«', # Hebrew is RTL, test position: + 'he-x-altquot': '„”‚’', # low quotation marks are opening. + # 'he-x-altquot': '“„‘‚', # RTL: low quotation marks opening + 'hr': '„”‘’', # http://hrvatska-tipografija.com/polunavodnici/ + 'hr-x-altquot': '»«›‹', + 'hsb': '„“‚‘', + 'hsb-x-altquot': '»«›‹', + 'hu': '„”«»', + 'is': '„“‚‘', + 'it': '«»“”', + 'it-ch': '«»‹›', + 'it-x-altquot': '“”‘’', + # 'it-x-altquot2': '“„‘‚', # [7] in headlines + 'ja': '「」『』', + 'ko': '“”‘’', + 'lt': '„“‚‘', + 'lv': '„“‚‘', + 'mk': '„“‚‘', # Macedonian, https://mk.wikipedia.org/wiki/Правопис_и_правоговор_на_македонскиот_јазик + 'nl': '“”‘’', + 'nl-x-altquot': '„”‚’', + # 'nl-x-altquot2': '””’’', + 'nb': '«»’’', # Norsk bokmål (canonical form 'no') + 'nn': '«»’’', # Nynorsk [10] + 'nn-x-altquot': '«»‘’', # [8], [10] + # 'nn-x-altquot2': '«»«»', # [9], [10 + # 'nn-x-altquot3': '„“‚‘', # [10] + 'no': '«»’’', # Norsk bokmål [10] + 'no-x-altquot': '«»‘’', # [8], [10] + # 'no-x-altquot2': '«»«»', # [9], [10 + # 'no-x-altquot3': '„“‚‘', # [10] + 'pl': '„”«»', + 'pl-x-altquot': '«»‚’', + # 'pl-x-altquot2': '„”‚’', # https://pl.wikipedia.org/wiki/Cudzys%C5%82%C3%B3w + 'pt': '«»“”', + 'pt-br': '“”‘’', + 'ro': '„”«»', + 'ru': '«»„“', + 'sh': '„”‚’', # Serbo-Croatian + 'sh-x-altquot': '»«›‹', + 'sk': '„“‚‘', # Slovak + 'sk-x-altquot': '»«›‹', + 'sl': '„“‚‘', # Slovenian + 'sl-x-altquot': '»«›‹', + 'sq': '«»‹›', # Albanian + 'sq-x-altquot': '“„‘‚', + 'sr': '„”’’', + 'sr-x-altquot': '»«›‹', + 'sv': '””’’', + 'sv-x-altquot': '»»››', + 'tr': '“”‘’', + 'tr-x-altquot': '«»‹›', + # 'tr-x-altquot2': '“„‘‚', # [7] antiquated? + 'uk': '«»„“', + 'uk-x-altquot': '„“‚‘', + 'zh-cn': '“”‘’', + 'zh-tw': '「」『』', } def __init__(self, language='en'): @@ -496,7 +496,7 @@ def __init__(self, language='en'): (self.opquote, self.cpquote, self.osquote, self.csquote) = self.quotes[language.lower()] except KeyError: - self.opquote, self.cpquote, self.osquote, self.csquote = u'""\'\'' + self.opquote, self.cpquote, self.osquote, self.csquote = '""\'\'' def smartyPants(text, attr=default_smartypants_attr, language='en'): @@ -633,12 +633,12 @@ def educateQuotes(text, language='en'): """ smart = smartchars(language) - ch_classes = {'open': u'[([{]', # opening braces + ch_classes = {'open': '[([{]', # opening braces 'close': r'[^\s]', # everything except whitespace 'punct': r"""[-!"#\$\%'()*+,.\/:;<=>?\@\[\\\]\^_`{|}~]""", - 'dash': u'[-–—]' # hyphen and em/en dashes + 'dash': '[-–—]' # hyphen and em/en dashes + r'|&[mn]dash;|&\#8211;|&\#8212;|&\#x201[34];', - 'sep': u'[\\s\u200B\u200C]| ', # Whitespace, ZWSP, ZWNJ + 'sep': '[\\s\u200B\u200C]| ', # Whitespace, ZWSP, ZWNJ } # Special case if the very first character is a quote @@ -986,7 +986,7 @@ def test_dates(self): self.assertEqual(smartyPants("'60s"), "’60s") def test_educated_quotes(self): - self.assertEqual(smartyPants('"Isn\'t this fun?"'), u'“Isn’t this fun?”') + self.assertEqual(smartyPants('"Isn\'t this fun?"'), '“Isn’t this fun?”') def test_html_tags(self): text = '<a src="foo">more</a>' diff --git a/docutils/docutils/writers/_html_base.py b/docutils/docutils/writers/_html_base.py index 38e08684d..fff6e5ec3 100644 --- a/docutils/docutils/writers/_html_base.py +++ b/docutils/docutils/writers/_html_base.py @@ -265,11 +265,11 @@ def depart_example(self, node): in_word_wrap_point = re.compile(r'.+\W\W.+|[-?].+', re.U) lang_attribute = 'lang' # name changes to 'xml:lang' in XHTML 1.1 - special_characters = {ord('&'): u'&', - ord('<'): u'<', - ord('"'): u'"', - ord('>'): u'>', - ord('@'): u'@', # may thwart address harvesters + special_characters = {ord('&'): '&', + ord('<'): '<', + ord('"'): '"', + ord('>'): '>', + ord('@'): '@', # may thwart address harvesters } """Character references for characters with a special meaning in HTML.""" @@ -527,7 +527,7 @@ def visit_admonition(self, node): def depart_admonition(self, node=None): self.body.append('</aside>\n') - attribution_formats = {'dash': (u'\u2014', ''), + attribution_formats = {'dash': ('\u2014', ''), 'parentheses': ('(', ')'), 'parens': ('(', ')'), 'none': ('', '')} @@ -965,7 +965,7 @@ def depart_footnote_reference(self, node): def visit_generated(self, node): if 'sectnum' in node['classes']: # get section number (strip trailing no-break-spaces) - sectnum = node.astext().rstrip(u' ') + sectnum = node.astext().rstrip(' ') self.body.append('<span class="sectnum">%s </span>' % self.encode(sectnum)) # Content already processed: @@ -1061,7 +1061,7 @@ def visit_image(self, node): # read/parse, apply arguments, # insert as <svg ....> ... </svg> # (about 1/3 less data) data64 = base64.b64encode(imagedata).decode() - uri = u'data:%s;base64,%s' % (mimetype, data64) + uri = 'data:%s;base64,%s' % (mimetype, data64) elif self.image_loading == 'lazy': atts['loading'] = 'lazy' if mimetype == 'application/x-shockwave-flash': @@ -1196,9 +1196,9 @@ def visit_math(self, node, math_env=''): clsarg = self.math_tags[self.math_output][2] # LaTeX container wrappers = {# math_mode: (inline, block) - 'mathml': ('$%s$', u'\\begin{%s}\n%s\n\\end{%s}'), - 'html': ('$%s$', u'\\begin{%s}\n%s\n\\end{%s}'), - 'mathjax': (r'\(%s\)', u'\\begin{%s}\n%s\n\\end{%s}'), + 'mathml': ('$%s$', '\\begin{%s}\n%s\n\\end{%s}'), + 'html': ('$%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 != ''] @@ -1263,7 +1263,7 @@ def visit_math(self, node, math_env=''): err_node = self.document.reporter.error(err, base_node=node) self.visit_system_message(err_node) self.body.append(self.starttag(node, 'p')) - self.body.append(u','.join(err.args)) + self.body.append(','.join(err.args)) self.body.append('</p>\n') self.body.append(self.starttag(node, 'pre', CLASS='literal-block')) diff --git a/docutils/docutils/writers/html4css1/__init__.py b/docutils/docutils/writers/html4css1/__init__.py index 9b9791923..2152f3cef 100644 --- a/docutils/docutils/writers/html4css1/__init__.py +++ b/docutils/docutils/writers/html4css1/__init__.py @@ -159,7 +159,7 @@ class HTMLTranslator(writers._html_base.HTMLTranslator): # encode also non-breaking space special_characters = dict(_html_base.HTMLTranslator.special_characters) - special_characters[0xa0] = u' ' + special_characters[0xa0] = ' ' # use character reference for dash (not valid in HTML5) attribution_formats = {'dash': ('—', ''), diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py index 00be00bc8..7ed7067b7 100644 --- a/docutils/docutils/writers/latex2e/__init__.py +++ b/docutils/docutils/writers/latex2e/__init__.py @@ -614,169 +614,169 @@ class CharMaps(object): # characters that need escaping even in `alltt` environments: alltt = { - ord('\\'): u'\\textbackslash{}', - ord('{'): u'\\{', - ord('}'): u'\\}', + ord('\\'): '\\textbackslash{}', + ord('{'): '\\{', + ord('}'): '\\}', } # characters that normally need escaping: special = { - ord('#'): u'\\#', - ord('$'): u'\\$', - ord('%'): u'\\%', - ord('&'): u'\\&', - ord('~'): u'\\textasciitilde{}', - ord('_'): u'\\_', - ord('^'): u'\\textasciicircum{}', + ord('#'): '\\#', + ord('$'): '\\$', + ord('%'): '\\%', + ord('&'): '\\&', + ord('~'): '\\textasciitilde{}', + ord('_'): '\\_', + ord('^'): '\\textasciicircum{}', # straight double quotes are 'active' in many languages - ord('"'): u'\\textquotedbl{}', + ord('"'): '\\textquotedbl{}', # Square brackets are ordinary chars and cannot be escaped with '\', # so we put them in a group '{[}'. (Alternative: ensure that all # macros with optional arguments are terminated with {} and text # inside any optional argument is put in a group ``[{text}]``). # Commands with optional args inside an optional arg must be put in a # group, e.g. ``\item[{\hyperref[label]{text}}]``. - ord('['): u'{[}', - ord(']'): u'{]}', + ord('['): '{[}', + ord(']'): '{]}', # the soft hyphen is unknown in 8-bit text # and not properly handled by XeTeX - 0x00AD: u'\\-', # SOFT HYPHEN + 0x00AD: '\\-', # SOFT HYPHEN } # Unicode chars that are not recognized by LaTeX's utf8 encoding unsupported_unicode = { # TODO: ensure white space also at the beginning of a line? - # 0x00A0: u'\\leavevmode\\nobreak\\vadjust{}~' - 0x2000: u'\\enskip', # EN QUAD - 0x2001: u'\\quad', # EM QUAD - 0x2002: u'\\enskip', # EN SPACE - 0x2003: u'\\quad', # EM SPACE - 0x2008: u'\\,', # PUNCTUATION SPACE    - 0x200b: u'\\hspace{0pt}', # ZERO WIDTH SPACE - 0x202F: u'\\,', # NARROW NO-BREAK SPACE - # 0x02d8: u'\\\u{ }', # BREVE - 0x2011: u'\\hbox{-}', # NON-BREAKING HYPHEN - 0x212b: u'\\AA', # ANGSTROM SIGN - 0x21d4: u'\\ensuremath{\\Leftrightarrow}', # LEFT RIGHT DOUBLE ARROW - 0x2260: u'\\ensuremath{\\neq}', # NOT EQUAL TO - 0x2261: u'\\ensuremath{\\equiv}', # IDENTICAL TO - 0x2264: u'\\ensuremath{\\le}', # LESS-THAN OR EQUAL TO - 0x2265: u'\\ensuremath{\\ge}', # GREATER-THAN OR EQUAL TO + # 0x00A0: '\\leavevmode\\nobreak\\vadjust{}~' + 0x2000: '\\enskip', # EN QUAD + 0x2001: '\\quad', # EM QUAD + 0x2002: '\\enskip', # EN SPACE + 0x2003: '\\quad', # EM SPACE + 0x2008: '\\,', # PUNCTUATION SPACE    + 0x200b: '\\hspace{0pt}', # ZERO WIDTH SPACE + 0x202F: '\\,', # NARROW NO-BREAK SPACE + # 0x02d8: '\\\u{ }', # BREVE + 0x2011: '\\hbox{-}', # NON-BREAKING HYPHEN + 0x212b: '\\AA', # ANGSTROM SIGN + 0x21d4: '\\ensuremath{\\Leftrightarrow}', # LEFT RIGHT DOUBLE ARROW + 0x2260: '\\ensuremath{\\neq}', # NOT EQUAL TO + 0x2261: '\\ensuremath{\\equiv}', # IDENTICAL TO + 0x2264: '\\ensuremath{\\le}', # LESS-THAN OR EQUAL TO + 0x2265: '\\ensuremath{\\ge}', # GREATER-THAN OR EQUAL TO # Docutils footnote symbols: - 0x2660: u'\\ensuremath{\\spadesuit}', - 0x2663: u'\\ensuremath{\\clubsuit}', - 0xfb00: u'ff', # LATIN SMALL LIGATURE FF - 0xfb01: u'fi', # LATIN SMALL LIGATURE FI - 0xfb02: u'fl', # LATIN SMALL LIGATURE FL - 0xfb03: u'ffi', # LATIN SMALL LIGATURE FFI - 0xfb04: u'ffl', # LATIN SMALL LIGATURE FFL + 0x2660: '\\ensuremath{\\spadesuit}', + 0x2663: '\\ensuremath{\\clubsuit}', + 0xfb00: 'ff', # LATIN SMALL LIGATURE FF + 0xfb01: 'fi', # LATIN SMALL LIGATURE FI + 0xfb02: 'fl', # LATIN SMALL LIGATURE FL + 0xfb03: 'ffi', # LATIN SMALL LIGATURE FFI + 0xfb04: 'ffl', # LATIN SMALL LIGATURE FFL } # Unicode chars that are recognized by LaTeX's utf8 encoding utf8_supported_unicode = { - 0x00A0: u'~', # NO-BREAK SPACE - 0x00AB: u'\\guillemotleft{}', # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK - 0x00bb: u'\\guillemotright{}', # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK - 0x200C: u'\\textcompwordmark{}', # ZERO WIDTH NON-JOINER - 0x2013: u'\\textendash{}', - 0x2014: u'\\textemdash{}', - 0x2018: u'\\textquoteleft{}', - 0x2019: u'\\textquoteright{}', - 0x201A: u'\\quotesinglbase{}', # SINGLE LOW-9 QUOTATION MARK - 0x201C: u'\\textquotedblleft{}', - 0x201D: u'\\textquotedblright{}', - 0x201E: u'\\quotedblbase{}', # DOUBLE LOW-9 QUOTATION MARK - 0x2030: u'\\textperthousand{}', # PER MILLE SIGN - 0x2031: u'\\textpertenthousand{}', # PER TEN THOUSAND SIGN - 0x2039: u'\\guilsinglleft{}', - 0x203A: u'\\guilsinglright{}', - 0x2423: u'\\textvisiblespace{}', # OPEN BOX - 0x2020: u'\\dag{}', - 0x2021: u'\\ddag{}', - 0x2026: u'\\dots{}', - 0x2122: u'\\texttrademark{}', + 0x00A0: '~', # NO-BREAK SPACE + 0x00AB: '\\guillemotleft{}', # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + 0x00bb: '\\guillemotright{}', # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + 0x200C: '\\textcompwordmark{}', # ZERO WIDTH NON-JOINER + 0x2013: '\\textendash{}', + 0x2014: '\\textemdash{}', + 0x2018: '\\textquoteleft{}', + 0x2019: '\\textquoteright{}', + 0x201A: '\\quotesinglbase{}', # SINGLE LOW-9 QUOTATION MARK + 0x201C: '\\textquotedblleft{}', + 0x201D: '\\textquotedblright{}', + 0x201E: '\\quotedblbase{}', # DOUBLE LOW-9 QUOTATION MARK + 0x2030: '\\textperthousand{}', # PER MILLE SIGN + 0x2031: '\\textpertenthousand{}', # PER TEN THOUSAND SIGN + 0x2039: '\\guilsinglleft{}', + 0x203A: '\\guilsinglright{}', + 0x2423: '\\textvisiblespace{}', # OPEN BOX + 0x2020: '\\dag{}', + 0x2021: '\\ddag{}', + 0x2026: '\\dots{}', + 0x2122: '\\texttrademark{}', } # recognized with 'utf8', if textcomp is loaded textcomp = { # Latin-1 Supplement - 0x00a2: u'\\textcent{}', # ¢ CENT SIGN - 0x00a4: u'\\textcurrency{}', # ¤ CURRENCY SYMBOL - 0x00a5: u'\\textyen{}', # ¥ YEN SIGN - 0x00a6: u'\\textbrokenbar{}', # ¦ BROKEN BAR - 0x00a7: u'\\textsection{}', # § SECTION SIGN - 0x00a8: u'\\textasciidieresis{}', # ¨ DIAERESIS - 0x00a9: u'\\textcopyright{}', # © COPYRIGHT SIGN - 0x00aa: u'\\textordfeminine{}', # ª FEMININE ORDINAL INDICATOR - 0x00ac: u'\\textlnot{}', # ¬ NOT SIGN - 0x00ae: u'\\textregistered{}', # ® REGISTERED SIGN - 0x00af: u'\\textasciimacron{}', # ¯ MACRON - 0x00b0: u'\\textdegree{}', # ° DEGREE SIGN - 0x00b1: u'\\textpm{}', # ± PLUS-MINUS SIGN - 0x00b2: u'\\texttwosuperior{}', # ² SUPERSCRIPT TWO - 0x00b3: u'\\textthreesuperior{}', # ³ SUPERSCRIPT THREE - 0x00b4: u'\\textasciiacute{}', # ´ ACUTE ACCENT - 0x00b5: u'\\textmu{}', # µ MICRO SIGN - 0x00b6: u'\\textparagraph{}', # ¶ PILCROW SIGN # != \textpilcrow - 0x00b9: u'\\textonesuperior{}', # ¹ SUPERSCRIPT ONE - 0x00ba: u'\\textordmasculine{}', # º MASCULINE ORDINAL INDICATOR - 0x00bc: u'\\textonequarter{}', # 1/4 FRACTION - 0x00bd: u'\\textonehalf{}', # 1/2 FRACTION - 0x00be: u'\\textthreequarters{}', # 3/4 FRACTION - 0x00d7: u'\\texttimes{}', # × MULTIPLICATION SIGN - 0x00f7: u'\\textdiv{}', # ÷ DIVISION SIGN + 0x00a2: '\\textcent{}', # ¢ CENT SIGN + 0x00a4: '\\textcurrency{}', # ¤ CURRENCY SYMBOL + 0x00a5: '\\textyen{}', # ¥ YEN SIGN + 0x00a6: '\\textbrokenbar{}', # ¦ BROKEN BAR + 0x00a7: '\\textsection{}', # § SECTION SIGN + 0x00a8: '\\textasciidieresis{}', # ¨ DIAERESIS + 0x00a9: '\\textcopyright{}', # © COPYRIGHT SIGN + 0x00aa: '\\textordfeminine{}', # ª FEMININE ORDINAL INDICATOR + 0x00ac: '\\textlnot{}', # ¬ NOT SIGN + 0x00ae: '\\textregistered{}', # ® REGISTERED SIGN + 0x00af: '\\textasciimacron{}', # ¯ MACRON + 0x00b0: '\\textdegree{}', # ° DEGREE SIGN + 0x00b1: '\\textpm{}', # ± PLUS-MINUS SIGN + 0x00b2: '\\texttwosuperior{}', # ² SUPERSCRIPT TWO + 0x00b3: '\\textthreesuperior{}', # ³ SUPERSCRIPT THREE + 0x00b4: '\\textasciiacute{}', # ´ ACUTE ACCENT + 0x00b5: '\\textmu{}', # µ MICRO SIGN + 0x00b6: '\\textparagraph{}', # ¶ PILCROW SIGN # != \textpilcrow + 0x00b9: '\\textonesuperior{}', # ¹ SUPERSCRIPT ONE + 0x00ba: '\\textordmasculine{}', # º MASCULINE ORDINAL INDICATOR + 0x00bc: '\\textonequarter{}', # 1/4 FRACTION + 0x00bd: '\\textonehalf{}', # 1/2 FRACTION + 0x00be: '\\textthreequarters{}', # 3/4 FRACTION + 0x00d7: '\\texttimes{}', # × MULTIPLICATION SIGN + 0x00f7: '\\textdiv{}', # ÷ DIVISION SIGN # others - 0x0192: u'\\textflorin{}', # LATIN SMALL LETTER F WITH HOOK - 0x02b9: u'\\textasciiacute{}', # MODIFIER LETTER PRIME - 0x02ba: u'\\textacutedbl{}', # MODIFIER LETTER DOUBLE PRIME - 0x2016: u'\\textbardbl{}', # DOUBLE VERTICAL LINE - 0x2022: u'\\textbullet{}', # BULLET - 0x2032: u'\\textasciiacute{}', # PRIME - 0x2033: u'\\textacutedbl{}', # DOUBLE PRIME - 0x2035: u'\\textasciigrave{}', # REVERSED PRIME - 0x2036: u'\\textgravedbl{}', # REVERSED DOUBLE PRIME - 0x203b: u'\\textreferencemark{}', # REFERENCE MARK - 0x203d: u'\\textinterrobang{}', # INTERROBANG - 0x2044: u'\\textfractionsolidus{}', # FRACTION SLASH - 0x2045: u'\\textlquill{}', # LEFT SQUARE BRACKET WITH QUILL - 0x2046: u'\\textrquill{}', # RIGHT SQUARE BRACKET WITH QUILL - 0x2052: u'\\textdiscount{}', # COMMERCIAL MINUS SIGN - 0x20a1: u'\\textcolonmonetary{}', # COLON SIGN - 0x20a3: u'\\textfrenchfranc{}', # FRENCH FRANC SIGN - 0x20a4: u'\\textlira{}', # LIRA SIGN - 0x20a6: u'\\textnaira{}', # NAIRA SIGN - 0x20a9: u'\\textwon{}', # WON SIGN - 0x20ab: u'\\textdong{}', # DONG SIGN - 0x20ac: u'\\texteuro{}', # EURO SIGN - 0x20b1: u'\\textpeso{}', # PESO SIGN - 0x20b2: u'\\textguarani{}', # GUARANI SIGN - 0x2103: u'\\textcelsius{}', # DEGREE CELSIUS - 0x2116: u'\\textnumero{}', # NUMERO SIGN - 0x2117: u'\\textcircledP{}', # SOUND RECORDING COPYRIGHT - 0x211e: u'\\textrecipe{}', # PRESCRIPTION TAKE - 0x2120: u'\\textservicemark{}', # SERVICE MARK - 0x2122: u'\\texttrademark{}', # TRADE MARK SIGN - 0x2126: u'\\textohm{}', # OHM SIGN - 0x2127: u'\\textmho{}', # INVERTED OHM SIGN - 0x212e: u'\\textestimated{}', # ESTIMATED SYMBOL - 0x2190: u'\\textleftarrow{}', # LEFTWARDS ARROW - 0x2191: u'\\textuparrow{}', # UPWARDS ARROW - 0x2192: u'\\textrightarrow{}', # RIGHTWARDS ARROW - 0x2193: u'\\textdownarrow{}', # DOWNWARDS ARROW - 0x2212: u'\\textminus{}', # MINUS SIGN - 0x2217: u'\\textasteriskcentered{}', # ASTERISK OPERATOR - 0x221a: u'\\textsurd{}', # SQUARE ROOT - 0x2422: u'\\textblank{}', # BLANK SYMBOL - 0x25e6: u'\\textopenbullet{}', # WHITE BULLET - 0x25ef: u'\\textbigcircle{}', # LARGE CIRCLE - 0x266a: u'\\textmusicalnote{}', # EIGHTH NOTE - 0x26ad: u'\\textmarried{}', # MARRIAGE SYMBOL - 0x26ae: u'\\textdivorced{}', # DIVORCE SYMBOL - 0x27e8: u'\\textlangle{}', # MATHEMATICAL LEFT ANGLE BRACKET - 0x27e9: u'\\textrangle{}', # MATHEMATICAL RIGHT ANGLE BRACKET + 0x0192: '\\textflorin{}', # LATIN SMALL LETTER F WITH HOOK + 0x02b9: '\\textasciiacute{}', # MODIFIER LETTER PRIME + 0x02ba: '\\textacutedbl{}', # MODIFIER LETTER DOUBLE PRIME + 0x2016: '\\textbardbl{}', # DOUBLE VERTICAL LINE + 0x2022: '\\textbullet{}', # BULLET + 0x2032: '\\textasciiacute{}', # PRIME + 0x2033: '\\textacutedbl{}', # DOUBLE PRIME + 0x2035: '\\textasciigrave{}', # REVERSED PRIME + 0x2036: '\\textgravedbl{}', # REVERSED DOUBLE PRIME + 0x203b: '\\textreferencemark{}', # REFERENCE MARK + 0x203d: '\\textinterrobang{}', # INTERROBANG + 0x2044: '\\textfractionsolidus{}', # FRACTION SLASH + 0x2045: '\\textlquill{}', # LEFT SQUARE BRACKET WITH QUILL + 0x2046: '\\textrquill{}', # RIGHT SQUARE BRACKET WITH QUILL + 0x2052: '\\textdiscount{}', # COMMERCIAL MINUS SIGN + 0x20a1: '\\textcolonmonetary{}', # COLON SIGN + 0x20a3: '\\textfrenchfranc{}', # FRENCH FRANC SIGN + 0x20a4: '\\textlira{}', # LIRA SIGN + 0x20a6: '\\textnaira{}', # NAIRA SIGN + 0x20a9: '\\textwon{}', # WON SIGN + 0x20ab: '\\textdong{}', # DONG SIGN + 0x20ac: '\\texteuro{}', # EURO SIGN + 0x20b1: '\\textpeso{}', # PESO SIGN + 0x20b2: '\\textguarani{}', # GUARANI SIGN + 0x2103: '\\textcelsius{}', # DEGREE CELSIUS + 0x2116: '\\textnumero{}', # NUMERO SIGN + 0x2117: '\\textcircledP{}', # SOUND RECORDING COPYRIGHT + 0x211e: '\\textrecipe{}', # PRESCRIPTION TAKE + 0x2120: '\\textservicemark{}', # SERVICE MARK + 0x2122: '\\texttrademark{}', # TRADE MARK SIGN + 0x2126: '\\textohm{}', # OHM SIGN + 0x2127: '\\textmho{}', # INVERTED OHM SIGN + 0x212e: '\\textestimated{}', # ESTIMATED SYMBOL + 0x2190: '\\textleftarrow{}', # LEFTWARDS ARROW + 0x2191: '\\textuparrow{}', # UPWARDS ARROW + 0x2192: '\\textrightarrow{}', # RIGHTWARDS ARROW + 0x2193: '\\textdownarrow{}', # DOWNWARDS ARROW + 0x2212: '\\textminus{}', # MINUS SIGN + 0x2217: '\\textasteriskcentered{}', # ASTERISK OPERATOR + 0x221a: '\\textsurd{}', # SQUARE ROOT + 0x2422: '\\textblank{}', # BLANK SYMBOL + 0x25e6: '\\textopenbullet{}', # WHITE BULLET + 0x25ef: '\\textbigcircle{}', # LARGE CIRCLE + 0x266a: '\\textmusicalnote{}', # EIGHTH NOTE + 0x26ad: '\\textmarried{}', # MARRIAGE SYMBOL + 0x26ae: '\\textdivorced{}', # DIVORCE SYMBOL + 0x27e8: '\\textlangle{}', # MATHEMATICAL LEFT ANGLE BRACKET + 0x27e9: '\\textrangle{}', # MATHEMATICAL RIGHT ANGLE BRACKET } # Unicode chars that require a feature/package to render pifont = { - 0x2665: u'\\ding{170}', # black heartsuit - 0x2666: u'\\ding{169}', # black diamondsuit - 0x2713: u'\\ding{51}', # check mark - 0x2717: u'\\ding{55}', # check mark + 0x2665: '\\ding{170}', # black heartsuit + 0x2666: '\\ding{169}', # black diamondsuit + 0x2713: '\\ding{51}', # check mark + 0x2717: '\\ding{55}', # check mark } # TODO: greek alphabet ... ? # see also LaTeX codec @@ -1430,7 +1430,7 @@ def to_latex_encoding(self, docutils_encoding): 'mac_cyrillic': 'maccyr', # cyrillic (on Mac) 'windows-1251': 'cp1251', # cyrillic (on Windows) 'koi8-r': 'koi8-r', # cyrillic (Russian) - 'koi8-u': 'koi8-u', # cyrillic (Ukrainian) + 'koi8-': 'koi8-', # cyrillic (Ukrainian) 'windows-1250': 'cp1250', # 'windows-1252': 'cp1252', # 'us-ascii': 'ascii', # ASCII (US) @@ -1482,22 +1482,22 @@ def encode(self, text): if self.literal: # replace underscore by underlined blank, # because this has correct width. - table[ord('_')] = u'\\underline{~}' + table[ord('_')] = '\\underline{~}' # the backslash doesn't work, so we use a mirrored slash. # \reflectbox is provided by graphicx: self.requirements['graphicx'] = self.graphicx_package - table[ord('\\')] = u'\\reflectbox{/}' + table[ord('\\')] = '\\reflectbox{/}' # * ``< | >`` come out as different chars (except for cmtt): else: - table[ord('|')] = u'\\textbar{}' - table[ord('<')] = u'\\textless{}' - table[ord('>')] = u'\\textgreater{}' + table[ord('|')] = '\\textbar{}' + table[ord('<')] = '\\textless{}' + table[ord('>')] = '\\textgreater{}' if self.insert_non_breaking_blanks: - table[ord(' ')] = u'~' + table[ord(' ')] = '~' # tab chars may occur in included files (literal or code) # quick-and-dirty replacement with spaces # (for better results use `--literal-block-env=lstlisting`) - table[ord('\t')] = u'~' * self.settings.tab_width + table[ord('\t')] = '~' * self.settings.tab_width # Unicode replacements for 8-bit tex engines (not required with XeTeX/LuaTeX): if not self.is_xetex: if not self.latex_encoding.startswith('utf8'): @@ -2791,9 +2791,9 @@ def has_unbalanced_braces(self, string): def visit_reference(self, node): # We need to escape #, \, and % if we use the URL in a command. - special_chars = {ord('#'): u'\\#', - ord('%'): u'\\%', - ord('\\'): u'\\\\', + special_chars = {ord('#'): '\\#', + ord('%'): '\\%', + ord('\\'): '\\\\', } # external reference (URL) if 'refuri' in node: @@ -2867,7 +2867,7 @@ def depart_sidebar(self, node): self.out.append('}\n') self.duclass_close(node) - attribution_formats = {'dash': (u'—', ''), # EM DASH + attribution_formats = {'dash': ('—', ''), # EM DASH 'parentheses': ('(', ')'), 'parens': ('(', ')'), 'none': ('', '')} diff --git a/docutils/docutils/writers/manpage.py b/docutils/docutils/writers/manpage.py index fd4310fe6..cb02ee9c3 100644 --- a/docutils/docutils/writers/manpage.py +++ b/docutils/docutils/writers/manpage.py @@ -274,19 +274,19 @@ def astext(self): return ''.join(self.head + self.body + self.foot) def deunicode(self, text): - text = text.replace(u'\xa0', '\\ ') - text = text.replace(u'\u2020', '\\(dg') + text = text.replace('\xa0', '\\ ') + text = text.replace('\u2020', '\\(dg') return text def visit_Text(self, node): text = node.astext() text = text.replace('\\', '\\e') replace_pairs = [ - (u'-', u'\\-'), - (u'\'', u'\\(aq'), - (u'´', "\\'"), - (u'`', u'\\(ga'), - (u'"', u'\\(dq'), # double quotes are a problem on macro lines + ('-', '\\-'), + ('\'', '\\(aq'), + ('´', "\\'"), + ('`', '\\(ga'), + ('"', '\\(dq'), # double quotes are a problem on macro lines ] for (in_char, out_markup) in replace_pairs: text = text.replace(in_char, out_markup) @@ -733,7 +733,7 @@ def depart_subscript(self, node): self.body.append('\\u\\s0') def visit_superscript(self, node): - self.body.append('\\s-2\\u') + self.body.append('\\s-2\\') def depart_superscript(self, node): self.body.append('\\d\\s0') diff --git a/docutils/docutils/writers/xetex/__init__.py b/docutils/docutils/writers/xetex/__init__.py index b95ce29da..34fed5d6b 100644 --- a/docutils/docutils/writers/xetex/__init__.py +++ b/docutils/docutils/writers/xetex/__init__.py @@ -121,7 +121,7 @@ def __init__(self, language_code, reporter): self.quotes = ('"', '"') # language dependent configuration: # double quotes are "active" in some languages (e.g. German). - self.literal_double_quote = u'"' # TODO: use \textquotedbl ? + self.literal_double_quote = '"' # TODO: use \textquotedbl ? def __call__(self): setup = [r'\usepackage{polyglossia}', diff --git a/docutils/test/test__init__.py b/docutils/test/test__init__.py index 43a452778..d5304ac99 100644 --- a/docutils/test/test__init__.py +++ b/docutils/test/test__init__.py @@ -20,11 +20,11 @@ class ApplicationErrorTests(unittest.TestCase): def test_message(self): err = docutils.ApplicationError('the message') - self.assertEqual(str(err), u'the message') + self.assertEqual(str(err), 'the message') def test_non_ASCII_message(self): - err = docutils.ApplicationError(u'\u0169') - self.assertEqual(str(err), u'\u0169') + err = docutils.ApplicationError('\u0169') + self.assertEqual(str(err), '\u0169') class VersionInfoTests(unittest.TestCase): diff --git a/docutils/test/test_command_line.py b/docutils/test/test_command_line.py index 9434860a6..296e4075e 100644 --- a/docutils/test/test_command_line.py +++ b/docutils/test/test_command_line.py @@ -34,11 +34,11 @@ def test_sys_argv_decoding(self): if argv_encoding == 'ascii': # cannot test return sys.argv.append('--source-url=test.txt') # pure ASCII argument - sys.argv.append(u'--title=Dornröschen') + sys.argv.append('--title=Dornröschen') publisher = docutils.core.Publisher() publisher.process_command_line() self.assertEqual(publisher.settings.source_url, 'test.txt') - self.assertEqual(publisher.settings.title, u'Dornröschen') + self.assertEqual(publisher.settings.title, 'Dornröschen') sys.argv.pop() # --title sys.argv.pop() # --source-url diff --git a/docutils/test/test_dependencies.py b/docutils/test/test_dependencies.py index 640b73d03..ff14ae167 100755 --- a/docutils/test/test_dependencies.py +++ b/docutils/test/test_dependencies.py @@ -19,11 +19,11 @@ # docutils.utils.DependencyList records POSIX paths, # i.e. "/" as a path separator even on Windows (not os.path.join). -paths = {'include': u'data/include.txt', # included rst file - 'raw': u'data/raw.txt', # included raw "HTML file" - 'scaled-image': u'../docs/user/rst/images/biohazard.png', - 'figure-image': u'../docs/user/rst/images/title.png', - 'stylesheet': u'data/stylesheet.txt', +paths = {'include': 'data/include.txt', # included rst 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', } # avoid latex writer future warnings: diff --git a/docutils/test/test_error_reporting.py b/docutils/test/test_error_reporting.py index 9dabc6334..7b73d49b2 100644 --- a/docutils/test/test_error_reporting.py +++ b/docutils/test/test_error_reporting.py @@ -41,7 +41,7 @@ class SafeStringTests(unittest.TestCase): # test data: bs = b'\xc3\xbc' # str(bs) returns repr(bs) - us = u'\xfc' # bytes(us) fails (requires encoding argument) + us = '\xfc' # bytes(us) fails (requires encoding argument) be = Exception(bs) ue = Exception(us) # bytes(ue) fails # wrapped test data: @@ -54,7 +54,7 @@ def test_7bit(self): # wrapping (not required with 7-bit chars) must not change the # result of conversions: bs7 = b'foo' - us7 = u'foo' + us7 = 'foo' be7 = Exception(bs7) ue7 = Exception(us7) self.assertEqual(str(bs7), str(SafeString(bs7))) @@ -83,7 +83,7 @@ def test_str(self): class ErrorStringTests(unittest.TestCase): bs = b'\xc3\xbc' # unicode(bs) fails, str(bs) in Python 3 return repr() - us = u'\xfc' # bytes(us) fails; str(us) fails in Python 2 + us = '\xfc' # bytes(us) fails; str(us) fails in Python 2 def test_str(self): self.assertEqual('Exception: spam', @@ -94,11 +94,11 @@ def test_str(self): str(ErrorString(ImportError(self.us)))) def test_unicode(self): - self.assertEqual(u'Exception: spam', - str(ErrorString(Exception(u'spam')))) - self.assertEqual(u'IndexError: '+self.us, + self.assertEqual('Exception: spam', + str(ErrorString(Exception('spam')))) + self.assertEqual('IndexError: '+self.us, str(ErrorString(IndexError(self.us)))) - self.assertEqual(u'ImportError: %s' % SafeString(self.bs), + self.assertEqual('ImportError: %s' % SafeString(self.bs), str(ErrorString(ImportError(self.bs)))) @@ -132,15 +132,15 @@ def test_bbuf(self): e.write(b'b\xfc') self.assertEqual(buf.getvalue(), b'b\xfc') # encode unicode data with backslashescape fallback replacement: - e.write(u' u\xfc') + e.write(' u\xfc') self.assertEqual(buf.getvalue(), b'b\xfc u\\xfc') # handle Exceptions with Unicode string args - # unicode(Exception(u'e\xfc')) # fails in Python < 2.6 - e.write(AttributeError(u' e\xfc')) + # unicode(Exception('e\xfc')) # fails in Python < 2.6 + e.write(AttributeError(' e\xfc')) self.assertEqual(buf.getvalue(), b'b\xfc u\\xfc e\\xfc') # encode with `encoding` attribute e.encoding = 'utf8' - e.write(u' u\xfc') + e.write(' u\xfc') self.assertEqual(buf.getvalue(), b'b\xfc u\\xfc e\\xfc u\xc3\xbc') def test_ubuf(self): @@ -148,16 +148,16 @@ def test_ubuf(self): # decode of binary strings e = ErrorOutput(buf, encoding='ascii') e.write(b'b\xfc') - self.assertEqual(buf.getvalue(), u'b\ufffd') # use REPLACEMENT CHARACTER + self.assertEqual(buf.getvalue(), 'b\ufffd') # use REPLACEMENT CHARACTER # write Unicode string and Exceptions with Unicode args - e.write(u' u\xfc') - self.assertEqual(buf.getvalue(), u'b\ufffd u\xfc') - e.write(AttributeError(u' e\xfc')) - self.assertEqual(buf.getvalue(), u'b\ufffd u\xfc e\xfc') + e.write(' u\xfc') + self.assertEqual(buf.getvalue(), 'b\ufffd u\xfc') + e.write(AttributeError(' e\xfc')) + self.assertEqual(buf.getvalue(), 'b\ufffd u\xfc e\xfc') # decode with `encoding` attribute e.encoding = 'latin1' e.write(b' b\xfc') - self.assertEqual(buf.getvalue(), u'b\ufffd u\xfc e\xfc b\xfc') + self.assertEqual(buf.getvalue(), 'b\ufffd u\xfc e\xfc b\xfc') class SafeStringTests_locale(unittest.TestCase): @@ -169,18 +169,18 @@ class SafeStringTests_locale(unittest.TestCase): """ # test data: bs = b'\xc3\xbc' - us = u'\xfc' + us = '\xfc' try: open(b'\xc3\xbc') except IOError as e: # in Python 3 the name for the exception instance bioe = e # is local to the except clause try: - open(u'\xfc') + open('\xfc') except IOError as e: uioe = e except UnicodeEncodeError: try: - open(u'\xfc'.encode(sys.getfilesystemencoding(), 'replace')) + open('\xfc'.encode(sys.getfilesystemencoding(), 'replace')) except IOError as e: uioe = e try: @@ -188,12 +188,12 @@ class SafeStringTests_locale(unittest.TestCase): except OSError as e: bose = e try: - os.chdir(u'\xfc') + os.chdir('\xfc') except OSError as e: uose = e except UnicodeEncodeError: try: - os.chdir(u'\xfc'.encode(sys.getfilesystemencoding(), 'replace')) + os.chdir('\xfc'.encode(sys.getfilesystemencoding(), 'replace')) except OSError as e: uose = e # wrapped test data: diff --git a/docutils/test/test_io.py b/docutils/test/test_io.py index 4b39d3b01..9fc49b849 100755 --- a/docutils/test/test_io.py +++ b/docutils/test/test_io.py @@ -86,11 +86,11 @@ def test_bom(self): input = io.StringInput(source=b'\xef\xbb\xbf foo \xef\xbb\xbf bar', encoding='utf8') # Assert BOMs are gone. - self.assertEqual(input.read(), u' foo bar') + self.assertEqual(input.read(), ' foo bar') # With unicode input: - input = io.StringInput(source=u'\ufeff foo \ufeff bar') + input = io.StringInput(source='\ufeff foo \ufeff bar') # Assert BOMs are still there. - self.assertEqual(input.read(), u'\ufeff foo \ufeff bar') + self.assertEqual(input.read(), '\ufeff foo \ufeff bar') def test_coding_slug(self): input = io.StringInput(source=b"""\ @@ -117,7 +117,7 @@ def test_coding_slug(self): self.assertNotEqual(input.successful_encoding, 'ascii') def test_bom_detection(self): - source = u'\ufeffdata\nblah\n' + source = '\ufeffdata\nblah\n' input = io.StringInput(source=source.encode('utf-16-be')) data = input.read() self.assertEqual(input.successful_encoding, 'utf-16-be') @@ -131,7 +131,7 @@ def test_bom_detection(self): def test_readlines(self): input = io.FileInput(source_path='data/include.txt') data = input.readlines() - self.assertEqual(data, [u'Some include text.\n']) + self.assertEqual(data, ['Some include text.\n']) def test_heuristics_no_utf8(self): # if no encoding is given and decoding with utf8 fails, @@ -148,13 +148,13 @@ def test_heuristics_no_utf8(self): "guessed encoding '%s' differs from probed encodings %r" % (input.successful_encoding, probed_encodings)) if input.successful_encoding == 'latin-1': - self.assertEqual(data, u'Gr\xfc\xdfe\n') + self.assertEqual(data, 'Gr\xfc\xdfe\n') def test_decode_unicode(self): # With the special value "unicode" or "Unicode": uniinput = io.Input(encoding='unicode') # keep unicode instances as-is - self.assertEqual(uniinput.decode(u'ja'), u'ja') + self.assertEqual(uniinput.decode('ja'), 'ja') # raise AssertionError if data is not an unicode string self.assertRaises(AssertionError, uniinput.decode, b'ja') @@ -162,7 +162,7 @@ def test_decode_unicode(self): class OutputTests(unittest.TestCase): bdata = b'\xfc' - udata = u'\xfc' + udata = '\xfc' def setUp(self): self.bdrain = BBuf() @@ -233,15 +233,15 @@ def test_bbuf(self): e.write(b'b\xfc') self.assertEqual(buf.getvalue(), b'b\xfc') # encode unicode data with backslashescape fallback replacement: - e.write(u' u\xfc') + e.write(' u\xfc') self.assertEqual(buf.getvalue(), b'b\xfc u\\xfc') # handle Exceptions with Unicode string args - # unicode(Exception(u'e\xfc')) # fails in Python < 2.6 - e.write(AttributeError(u' e\xfc')) + # unicode(Exception('e\xfc')) # fails in Python < 2.6 + e.write(AttributeError(' e\xfc')) self.assertEqual(buf.getvalue(), b'b\xfc u\\xfc e\\xfc') # encode with `encoding` attribute e.encoding = 'utf8' - e.write(u' u\xfc') + e.write(' u\xfc') self.assertEqual(buf.getvalue(), b'b\xfc u\\xfc e\\xfc u\xc3\xbc') def test_ubuf(self): @@ -249,16 +249,16 @@ def test_ubuf(self): # decode of binary strings e = io.ErrorOutput(buf, encoding='ascii') e.write(b'b\xfc') - self.assertEqual(buf.getvalue(), u'b\ufffd') # use REPLACEMENT CHARACTER + self.assertEqual(buf.getvalue(), 'b\ufffd') # use REPLACEMENT CHARACTER # write Unicode string and Exceptions with Unicode args - e.write(u' u\xfc') - self.assertEqual(buf.getvalue(), u'b\ufffd u\xfc') - e.write(AttributeError(u' e\xfc')) - self.assertEqual(buf.getvalue(), u'b\ufffd u\xfc e\xfc') + e.write(' u\xfc') + self.assertEqual(buf.getvalue(), 'b\ufffd u\xfc') + e.write(AttributeError(' e\xfc')) + self.assertEqual(buf.getvalue(), 'b\ufffd u\xfc e\xfc') # decode with `encoding` attribute e.encoding = 'latin1' e.write(b' b\xfc') - self.assertEqual(buf.getvalue(), u'b\ufffd u\xfc e\xfc b\xfc') + self.assertEqual(buf.getvalue(), 'b\ufffd u\xfc e\xfc b\xfc') if __name__ == '__main__': diff --git a/docutils/test/test_nodes.py b/docutils/test/test_nodes.py index 8db5d0b6f..e09f8cd09 100755 --- a/docutils/test/test_nodes.py +++ b/docutils/test/test_nodes.py @@ -21,7 +21,7 @@ class TextTests(unittest.TestCase): def setUp(self): self.text = nodes.Text('Line 1.\nLine 2.') - self.unicode_text = nodes.Text(u'Möhren') + self.unicode_text = nodes.Text('Möhren') self.longtext = nodes.Text('Mary had a little lamb whose ' 'fleece was white as snow and ' 'everwhere that Mary went the ' @@ -37,24 +37,24 @@ def test_str(self): self.assertEqual(str(self.text), 'Line 1.\nLine 2.') def test_unicode(self): - self.assertEqual(str(self.unicode_text), u'Möhren') + self.assertEqual(str(self.unicode_text), 'Möhren') self.assertEqual(str(self.unicode_text), 'M\xf6hren') def test_astext(self): self.assertTrue(isinstance(self.text.astext(), str)) - self.assertEqual(self.text.astext(), u'Line 1.\nLine 2.') - self.assertEqual(self.unicode_text.astext(), u'Möhren') + self.assertEqual(self.text.astext(), 'Line 1.\nLine 2.') + self.assertEqual(self.unicode_text.astext(), 'Möhren') def test_pformat(self): self.assertTrue(isinstance(self.text.pformat(), str)) - self.assertEqual(self.text.pformat(), u'Line 1.\nLine 2.\n') + self.assertEqual(self.text.pformat(), 'Line 1.\nLine 2.\n') def test_strip(self): text = nodes.Text(' was noch ') stripped = text.lstrip().rstrip() stripped2 = text.lstrip(' wahn').rstrip(' wahn') - self.assertEqual(stripped, u'was noch') - self.assertEqual(stripped2, u's noc') + self.assertEqual(stripped, 'was noch') + self.assertEqual(stripped2, 's noc') def test_asciirestriction(self): # no bytes at all allowed @@ -92,19 +92,19 @@ def test_empty(self): dom.unlink() self.assertEqual(element.pformat(), '<Element attr="1">\n') del element['attr'] - element['mark'] = u'\u2022' + element['mark'] = '\u2022' self.assertEqual(repr(element), '<Element: >') - self.assertEqual(str(element), u'<Element mark="\u2022"/>') + self.assertEqual(str(element), '<Element mark="\u2022"/>') dom = element.asdom() - self.assertEqual(dom.toxml(), u'<Element mark="\u2022"/>') + self.assertEqual(dom.toxml(), '<Element mark="\u2022"/>') dom.unlink() - element['names'] = ['nobody', u'имя', u'näs'] - self.assertEqual(repr(element), u'<Element "nobody; имя; näs": >') + element['names'] = ['nobody', 'имя', 'näs'] + self.assertEqual(repr(element), '<Element "nobody; имя; näs": >') self.assertTrue(isinstance(repr(element), str)) def test_withtext(self): element = nodes.Element('text\nmore', nodes.Text('text\nmore')) - uelement = nodes.Element(u'grün', nodes.Text(u'grün')) + uelement = nodes.Element('grün', nodes.Text('grün')) self.assertEqual(repr(element), r"<Element: <#text: 'text\nmore'>>") self.assertEqual(repr(uelement), "<Element: <#text: 'grün'>>") self.assertTrue(isinstance(repr(uelement), str)) @@ -316,8 +316,8 @@ def test_replace_self(self): self.assertEqual(len(parent), 5) def test_unicode(self): - node = nodes.Element(u'Möhren', nodes.Text(u'Möhren')) - self.assertEqual(str(node), u'<Element>Möhren</Element>') + node = nodes.Element('Möhren', nodes.Text('Möhren')) + self.assertEqual(str(node), '<Element>Möhren</Element>') class MiscTests(unittest.TestCase): @@ -333,173 +333,173 @@ def test_node_class_names(self): nodes.node_class_names.sort() self.assertEqual(node_class_names, nodes.node_class_names) - ids = [(u'a', 'a'), ('A', 'a'), ('', ''), ('a b \n c', 'a-b-c'), + ids = [('a', 'a'), ('A', 'a'), ('', ''), ('a b \n c', 'a-b-c'), ('a.b.c', 'a-b-c'), (' - a - b - c - ', 'a-b-c'), (' - ', ''), - (u'\u2020\u2066', ''), (u'a \xa7 b \u2020 c', 'a-b-c'), + ('\u2020\u2066', ''), ('a \xa7 b \u2020 c', 'a-b-c'), ('1', ''), ('1abc', 'abc'), ] ids_unicode_all = [ - (u'\u00f8 o with stroke', 'o-o-with-stroke'), - (u'\u0111 d with stroke', 'd-d-with-stroke'), - (u'\u0127 h with stroke', 'h-h-with-stroke'), - (u'\u0131 dotless i', 'i-dotless-i'), - (u'\u0142 l with stroke', 'l-l-with-stroke'), - (u'\u0167 t with stroke', 't-t-with-stroke'), + ('\u00f8 o with stroke', 'o-o-with-stroke'), + ('\u0111 d with stroke', 'd-d-with-stroke'), + ('\u0127 h with stroke', 'h-h-with-stroke'), + ('\u0131 dotless i', 'i-dotless-i'), + ('\u0142 l with stroke', 'l-l-with-stroke'), + ('\u0167 t with stroke', 't-t-with-stroke'), # From Latin Extended-B - (u'\u0180 b with stroke', 'b-b-with-stroke'), - (u'\u0183 b with topbar', 'b-b-with-topbar'), - (u'\u0188 c with hook', 'c-c-with-hook'), - (u'\u018c d with topbar', 'd-d-with-topbar'), - (u'\u0192 f with hook', 'f-f-with-hook'), - (u'\u0199 k with hook', 'k-k-with-hook'), - (u'\u019a l with bar', 'l-l-with-bar'), - (u'\u019e n with long right leg', 'n-n-with-long-right-leg'), - (u'\u01a5 p with hook', 'p-p-with-hook'), - (u'\u01ab t with palatal hook', 't-t-with-palatal-hook'), - (u'\u01ad t with hook', 't-t-with-hook'), - (u'\u01b4 y with hook', 'y-y-with-hook'), - (u'\u01b6 z with stroke', 'z-z-with-stroke'), - (u'\u01e5 g with stroke', 'g-g-with-stroke'), - (u'\u0225 z with hook', 'z-z-with-hook'), - (u'\u0234 l with curl', 'l-l-with-curl'), - (u'\u0235 n with curl', 'n-n-with-curl'), - (u'\u0236 t with curl', 't-t-with-curl'), - (u'\u0237 dotless j', 'j-dotless-j'), - (u'\u023c c with stroke', 'c-c-with-stroke'), - (u'\u023f s with swash tail', 's-s-with-swash-tail'), - (u'\u0240 z with swash tail', 'z-z-with-swash-tail'), - (u'\u0247 e with stroke', 'e-e-with-stroke'), - (u'\u0249 j with stroke', 'j-j-with-stroke'), - (u'\u024b q with hook tail', 'q-q-with-hook-tail'), - (u'\u024d r with stroke', 'r-r-with-stroke'), - (u'\u024f y with stroke', 'y-y-with-stroke'), + ('\u0180 b with stroke', 'b-b-with-stroke'), + ('\u0183 b with topbar', 'b-b-with-topbar'), + ('\u0188 c with hook', 'c-c-with-hook'), + ('\u018c d with topbar', 'd-d-with-topbar'), + ('\u0192 f with hook', 'f-f-with-hook'), + ('\u0199 k with hook', 'k-k-with-hook'), + ('\u019a l with bar', 'l-l-with-bar'), + ('\u019e n with long right leg', 'n-n-with-long-right-leg'), + ('\u01a5 p with hook', 'p-p-with-hook'), + ('\u01ab t with palatal hook', 't-t-with-palatal-hook'), + ('\u01ad t with hook', 't-t-with-hook'), + ('\u01b4 y with hook', 'y-y-with-hook'), + ('\u01b6 z with stroke', 'z-z-with-stroke'), + ('\u01e5 g with stroke', 'g-g-with-stroke'), + ('\u0225 z with hook', 'z-z-with-hook'), + ('\u0234 l with curl', 'l-l-with-curl'), + ('\u0235 n with curl', 'n-n-with-curl'), + ('\u0236 t with curl', 't-t-with-curl'), + ('\u0237 dotless j', 'j-dotless-j'), + ('\u023c c with stroke', 'c-c-with-stroke'), + ('\u023f s with swash tail', 's-s-with-swash-tail'), + ('\u0240 z with swash tail', 'z-z-with-swash-tail'), + ('\u0247 e with stroke', 'e-e-with-stroke'), + ('\u0249 j with stroke', 'j-j-with-stroke'), + ('\u024b q with hook tail', 'q-q-with-hook-tail'), + ('\u024d r with stroke', 'r-r-with-stroke'), + ('\u024f y with stroke', 'y-y-with-stroke'), # From Latin-1 Supplements - (u'\u00e0: a with grave', 'a-a-with-grave'), - (u'\u00e1 a with acute', 'a-a-with-acute'), - (u'\u00e2 a with circumflex', 'a-a-with-circumflex'), - (u'\u00e3 a with tilde', 'a-a-with-tilde'), - (u'\u00e4 a with diaeresis', 'a-a-with-diaeresis'), - (u'\u00e5 a with ring above', 'a-a-with-ring-above'), - (u'\u00e7 c with cedilla', 'c-c-with-cedilla'), - (u'\u00e8 e with grave', 'e-e-with-grave'), - (u'\u00e9 e with acute', 'e-e-with-acute'), - (u'\u00ea e with circumflex', 'e-e-with-circumflex'), - (u'\u00eb e with diaeresis', 'e-e-with-diaeresis'), - (u'\u00ec i with grave', 'i-i-with-grave'), - (u'\u00ed i with acute', 'i-i-with-acute'), - (u'\u00ee i with circumflex', 'i-i-with-circumflex'), - (u'\u00ef i with diaeresis', 'i-i-with-diaeresis'), - (u'\u00f1 n with tilde', 'n-n-with-tilde'), - (u'\u00f2 o with grave', 'o-o-with-grave'), - (u'\u00f3 o with acute', 'o-o-with-acute'), - (u'\u00f4 o with circumflex', 'o-o-with-circumflex'), - (u'\u00f5 o with tilde', 'o-o-with-tilde'), - (u'\u00f6 o with diaeresis', 'o-o-with-diaeresis'), - (u'\u00f9 u with grave', 'u-u-with-grave'), - (u'\u00fa u with acute', 'u-u-with-acute'), - (u'\u00fb u with circumflex', 'u-u-with-circumflex'), - (u'\u00fc u with diaeresis', 'u-u-with-diaeresis'), - (u'\u00fd y with acute', 'y-y-with-acute'), - (u'\u00ff y with diaeresis', 'y-y-with-diaeresis'), + ('\u00e0: a with grave', 'a-a-with-grave'), + ('\u00e1 a with acute', 'a-a-with-acute'), + ('\u00e2 a with circumflex', 'a-a-with-circumflex'), + ('\u00e3 a with tilde', 'a-a-with-tilde'), + ('\u00e4 a with diaeresis', 'a-a-with-diaeresis'), + ('\u00e5 a with ring above', 'a-a-with-ring-above'), + ('\u00e7 c with cedilla', 'c-c-with-cedilla'), + ('\u00e8 e with grave', 'e-e-with-grave'), + ('\u00e9 e with acute', 'e-e-with-acute'), + ('\u00ea e with circumflex', 'e-e-with-circumflex'), + ('\u00eb e with diaeresis', 'e-e-with-diaeresis'), + ('\u00ec i with grave', 'i-i-with-grave'), + ('\u00ed i with acute', 'i-i-with-acute'), + ('\u00ee i with circumflex', 'i-i-with-circumflex'), + ('\u00ef i with diaeresis', 'i-i-with-diaeresis'), + ('\u00f1 n with tilde', 'n-n-with-tilde'), + ('\u00f2 o with grave', 'o-o-with-grave'), + ('\u00f3 o with acute', 'o-o-with-acute'), + ('\u00f4 o with circumflex', 'o-o-with-circumflex'), + ('\u00f5 o with tilde', 'o-o-with-tilde'), + ('\u00f6 o with diaeresis', 'o-o-with-diaeresis'), + ('\u00f9 u with grave', 'u-u-with-grave'), + ('\u00fa u with acute', 'u-u-with-acute'), + ('\u00fb u with circumflex', 'u-u-with-circumflex'), + ('\u00fc u with diaeresis', 'u-u-with-diaeresis'), + ('\u00fd y with acute', 'y-y-with-acute'), + ('\u00ff y with diaeresis', 'y-y-with-diaeresis'), # From Latin Extended-A - (u'\u0101 a with macron', 'a-a-with-macron'), - (u'\u0103 a with breve', 'a-a-with-breve'), - (u'\u0105 a with ogonek', 'a-a-with-ogonek'), - (u'\u0107 c with acute', 'c-c-with-acute'), - (u'\u0109 c with circumflex', 'c-c-with-circumflex'), - (u'\u010b c with dot above', 'c-c-with-dot-above'), - (u'\u010d c with caron', 'c-c-with-caron'), - (u'\u010f d with caron', 'd-d-with-caron'), - (u'\u0113 e with macron', 'e-e-with-macron'), - (u'\u0115 e with breve', 'e-e-with-breve'), - (u'\u0117 e with dot above', 'e-e-with-dot-above'), - (u'\u0119 e with ogonek', 'e-e-with-ogonek'), - (u'\u011b e with caron', 'e-e-with-caron'), - (u'\u011d g with circumflex', 'g-g-with-circumflex'), - (u'\u011f g with breve', 'g-g-with-breve'), - (u'\u0121 g with dot above', 'g-g-with-dot-above'), - (u'\u0123 g with cedilla', 'g-g-with-cedilla'), - (u'\u0125 h with circumflex', 'h-h-with-circumflex'), - (u'\u0129 i with tilde', 'i-i-with-tilde'), - (u'\u012b i with macron', 'i-i-with-macron'), - (u'\u012d i with breve', 'i-i-with-breve'), - (u'\u012f i with ogonek', 'i-i-with-ogonek'), - (u'\u0133 ligature ij', 'ij-ligature-ij'), - (u'\u0135 j with circumflex', 'j-j-with-circumflex'), - (u'\u0137 k with cedilla', 'k-k-with-cedilla'), - (u'\u013a l with acute', 'l-l-with-acute'), - (u'\u013c l with cedilla', 'l-l-with-cedilla'), - (u'\u013e l with caron', 'l-l-with-caron'), - (u'\u0140 l with middle dot', 'l-l-with-middle-dot'), - (u'\u0144 n with acute', 'n-n-with-acute'), - (u'\u0146 n with cedilla', 'n-n-with-cedilla'), - (u'\u0148 n with caron', 'n-n-with-caron'), - (u'\u014d o with macron', 'o-o-with-macron'), - (u'\u014f o with breve', 'o-o-with-breve'), - (u'\u0151 o with double acute', 'o-o-with-double-acute'), - (u'\u0155 r with acute', 'r-r-with-acute'), - (u'\u0157 r with cedilla', 'r-r-with-cedilla'), - (u'\u0159 r with caron', 'r-r-with-caron'), - (u'\u015b s with acute', 's-s-with-acute'), - (u'\u015d s with circumflex', 's-s-with-circumflex'), - (u'\u015f s with cedilla', 's-s-with-cedilla'), - (u'\u0161 s with caron', 's-s-with-caron'), - (u'\u0163 t with cedilla', 't-t-with-cedilla'), - (u'\u0165 t with caron', 't-t-with-caron'), - (u'\u0169 u with tilde', 'u-u-with-tilde'), - (u'\u016b u with macron', 'u-u-with-macron'), - (u'\u016d u with breve', 'u-u-with-breve'), - (u'\u016f u with ring above', 'u-u-with-ring-above'), - (u'\u0171 u with double acute', 'u-u-with-double-acute'), - (u'\u0173 u with ogonek', 'u-u-with-ogonek'), - (u'\u0175 w with circumflex', 'w-w-with-circumflex'), - (u'\u0177 y with circumflex', 'y-y-with-circumflex'), - (u'\u017a z with acute', 'z-z-with-acute'), - (u'\u017c z with dot above', 'z-z-with-dot-above'), - (u'\u017e z with caron', 'z-z-with-caron'), + ('\u0101 a with macron', 'a-a-with-macron'), + ('\u0103 a with breve', 'a-a-with-breve'), + ('\u0105 a with ogonek', 'a-a-with-ogonek'), + ('\u0107 c with acute', 'c-c-with-acute'), + ('\u0109 c with circumflex', 'c-c-with-circumflex'), + ('\u010b c with dot above', 'c-c-with-dot-above'), + ('\u010d c with caron', 'c-c-with-caron'), + ('\u010f d with caron', 'd-d-with-caron'), + ('\u0113 e with macron', 'e-e-with-macron'), + ('\u0115 e with breve', 'e-e-with-breve'), + ('\u0117 e with dot above', 'e-e-with-dot-above'), + ('\u0119 e with ogonek', 'e-e-with-ogonek'), + ('\u011b e with caron', 'e-e-with-caron'), + ('\u011d g with circumflex', 'g-g-with-circumflex'), + ('\u011f g with breve', 'g-g-with-breve'), + ('\u0121 g with dot above', 'g-g-with-dot-above'), + ('\u0123 g with cedilla', 'g-g-with-cedilla'), + ('\u0125 h with circumflex', 'h-h-with-circumflex'), + ('\u0129 i with tilde', 'i-i-with-tilde'), + ('\u012b i with macron', 'i-i-with-macron'), + ('\u012d i with breve', 'i-i-with-breve'), + ('\u012f i with ogonek', 'i-i-with-ogonek'), + ('\u0133 ligature ij', 'ij-ligature-ij'), + ('\u0135 j with circumflex', 'j-j-with-circumflex'), + ('\u0137 k with cedilla', 'k-k-with-cedilla'), + ('\u013a l with acute', 'l-l-with-acute'), + ('\u013c l with cedilla', 'l-l-with-cedilla'), + ('\u013e l with caron', 'l-l-with-caron'), + ('\u0140 l with middle dot', 'l-l-with-middle-dot'), + ('\u0144 n with acute', 'n-n-with-acute'), + ('\u0146 n with cedilla', 'n-n-with-cedilla'), + ('\u0148 n with caron', 'n-n-with-caron'), + ('\u014d o with macron', 'o-o-with-macron'), + ('\u014f o with breve', 'o-o-with-breve'), + ('\u0151 o with double acute', 'o-o-with-double-acute'), + ('\u0155 r with acute', 'r-r-with-acute'), + ('\u0157 r with cedilla', 'r-r-with-cedilla'), + ('\u0159 r with caron', 'r-r-with-caron'), + ('\u015b s with acute', 's-s-with-acute'), + ('\u015d s with circumflex', 's-s-with-circumflex'), + ('\u015f s with cedilla', 's-s-with-cedilla'), + ('\u0161 s with caron', 's-s-with-caron'), + ('\u0163 t with cedilla', 't-t-with-cedilla'), + ('\u0165 t with caron', 't-t-with-caron'), + ('\u0169 u with tilde', 'u-u-with-tilde'), + ('\u016b u with macron', 'u-u-with-macron'), + ('\u016d u with breve', 'u-u-with-breve'), + ('\u016f u with ring above', 'u-u-with-ring-above'), + ('\u0171 u with double acute', 'u-u-with-double-acute'), + ('\u0173 u with ogonek', 'u-u-with-ogonek'), + ('\u0175 w with circumflex', 'w-w-with-circumflex'), + ('\u0177 y with circumflex', 'y-y-with-circumflex'), + ('\u017a z with acute', 'z-z-with-acute'), + ('\u017c z with dot above', 'z-z-with-dot-above'), + ('\u017e z with caron', 'z-z-with-caron'), # From Latin Extended-B - (u'\u01a1 o with horn', 'o-o-with-horn'), - (u'\u01b0 u with horn', 'u-u-with-horn'), - (u'\u01c6 dz with caron', 'dz-dz-with-caron'), - (u'\u01c9 lj', 'lj-lj'), - (u'\u01cc nj', 'nj-nj'), - (u'\u01ce a with caron', 'a-a-with-caron'), - (u'\u01d0 i with caron', 'i-i-with-caron'), - (u'\u01d2 o with caron', 'o-o-with-caron'), - (u'\u01d4 u with caron', 'u-u-with-caron'), - (u'\u01e7 g with caron', 'g-g-with-caron'), - (u'\u01e9 k with caron', 'k-k-with-caron'), - (u'\u01eb o with ogonek', 'o-o-with-ogonek'), - (u'\u01ed o with ogonek and macron', 'o-o-with-ogonek-and-macron'), - (u'\u01f0 j with caron', 'j-j-with-caron'), - (u'\u01f3 dz', 'dz-dz'), - (u'\u01f5 g with acute', 'g-g-with-acute'), - (u'\u01f9 n with grave', 'n-n-with-grave'), - (u'\u0201 a with double grave', 'a-a-with-double-grave'), - (u'\u0203 a with inverted breve', 'a-a-with-inverted-breve'), - (u'\u0205 e with double grave', 'e-e-with-double-grave'), - (u'\u0207 e with inverted breve', 'e-e-with-inverted-breve'), - (u'\u0209 i with double grave', 'i-i-with-double-grave'), - (u'\u020b i with inverted breve', 'i-i-with-inverted-breve'), - (u'\u020d o with double grave', 'o-o-with-double-grave'), - (u'\u020f o with inverted breve', 'o-o-with-inverted-breve'), - (u'\u0211 r with double grave', 'r-r-with-double-grave'), - (u'\u0213 r with inverted breve', 'r-r-with-inverted-breve'), - (u'\u0215 u with double grave', 'u-u-with-double-grave'), - (u'\u0217 u with inverted breve', 'u-u-with-inverted-breve'), - (u'\u0219 s with comma below', 's-s-with-comma-below'), - (u'\u021b t with comma below', 't-t-with-comma-below'), - (u'\u021f h with caron', 'h-h-with-caron'), - (u'\u0227 a with dot above', 'a-a-with-dot-above'), - (u'\u0229 e with cedilla', 'e-e-with-cedilla'), - (u'\u022f o with dot above', 'o-o-with-dot-above'), - (u'\u0233 y with macron', 'y-y-with-macron'), + ('\u01a1 o with horn', 'o-o-with-horn'), + ('\u01b0 u with horn', 'u-u-with-horn'), + ('\u01c6 dz with caron', 'dz-dz-with-caron'), + ('\u01c9 lj', 'lj-lj'), + ('\u01cc nj', 'nj-nj'), + ('\u01ce a with caron', 'a-a-with-caron'), + ('\u01d0 i with caron', 'i-i-with-caron'), + ('\u01d2 o with caron', 'o-o-with-caron'), + ('\u01d4 u with caron', 'u-u-with-caron'), + ('\u01e7 g with caron', 'g-g-with-caron'), + ('\u01e9 k with caron', 'k-k-with-caron'), + ('\u01eb o with ogonek', 'o-o-with-ogonek'), + ('\u01ed o with ogonek and macron', 'o-o-with-ogonek-and-macron'), + ('\u01f0 j with caron', 'j-j-with-caron'), + ('\u01f3 dz', 'dz-dz'), + ('\u01f5 g with acute', 'g-g-with-acute'), + ('\u01f9 n with grave', 'n-n-with-grave'), + ('\u0201 a with double grave', 'a-a-with-double-grave'), + ('\u0203 a with inverted breve', 'a-a-with-inverted-breve'), + ('\u0205 e with double grave', 'e-e-with-double-grave'), + ('\u0207 e with inverted breve', 'e-e-with-inverted-breve'), + ('\u0209 i with double grave', 'i-i-with-double-grave'), + ('\u020b i with inverted breve', 'i-i-with-inverted-breve'), + ('\u020d o with double grave', 'o-o-with-double-grave'), + ('\u020f o with inverted breve', 'o-o-with-inverted-breve'), + ('\u0211 r with double grave', 'r-r-with-double-grave'), + ('\u0213 r with inverted breve', 'r-r-with-inverted-breve'), + ('\u0215 u with double grave', 'u-u-with-double-grave'), + ('\u0217 u with inverted breve', 'u-u-with-inverted-breve'), + ('\u0219 s with comma below', 's-s-with-comma-below'), + ('\u021b t with comma below', 't-t-with-comma-below'), + ('\u021f h with caron', 'h-h-with-caron'), + ('\u0227 a with dot above', 'a-a-with-dot-above'), + ('\u0229 e with cedilla', 'e-e-with-cedilla'), + ('\u022f o with dot above', 'o-o-with-dot-above'), + ('\u0233 y with macron', 'y-y-with-macron'), # digraphs From Latin-1 Supplements - (u'\u00df: ligature sz', 'sz-ligature-sz'), - (u'\u00e6 ae', 'ae-ae'), - (u'\u0153 ligature oe', 'oe-ligature-oe'), - (u'\u0238 db digraph', 'db-db-digraph'), - (u'\u0239 qp digraph', 'qp-qp-digraph'), + ('\u00df: ligature sz', 'sz-ligature-sz'), + ('\u00e6 ae', 'ae-ae'), + ('\u0153 ligature oe', 'oe-ligature-oe'), + ('\u0238 db digraph', 'db-db-digraph'), + ('\u0239 qp digraph', 'qp-qp-digraph'), ] def test_make_id(self): diff --git a/docutils/test/test_parsers/test_rst/test_SimpleTableParser.py b/docutils/test/test_parsers/test_rst/test_SimpleTableParser.py index f05e8f4d8..80ac50974 100755 --- a/docutils/test/test_parsers/test_rst/test_SimpleTableParser.py +++ b/docutils/test/test_parsers/test_rst/test_SimpleTableParser.py @@ -35,8 +35,8 @@ def suite(): """, ([12, 15], [], - [[[0, 0, 1, [u'A ta\u0304ble w\u0305ith']], - [0, 0, 1, [u'comb\u0332ining chars']]]])], + [[[0, 0, 1, ['A ta\u0304ble w\u0305ith']], + [0, 0, 1, ['comb\u0332ining chars']]]])], ["""\ ============ ============ A table with two columns diff --git a/docutils/test/test_parsers/test_rst/test_TableParser.py b/docutils/test/test_parsers/test_rst/test_TableParser.py index 94ecbce29..d58584f32 100755 --- a/docutils/test/test_parsers/test_rst/test_TableParser.py +++ b/docutils/test/test_parsers/test_rst/test_TableParser.py @@ -45,12 +45,12 @@ def suite(): # | A tāble w̅ith | comb̲ining chars. | # +--------------+------------------+ # """, -# [(0, 0, 2, 15, [u'A table with']), -# (0, 15, 2, 30, [u'combining chars.'])], +# [(0, 0, 2, 15, ['A table with']), +# (0, 15, 2, 30, ['combining chars.'])], # ([14, 14], # [], -# [[(0, 0, 1, [u'A table with']), -# (0, 0, 1, [u'combining chars.'])]])], +# [[(0, 0, 1, ['A table with']), +# (0, 0, 1, ['combining chars.'])]])], ["""\ +--------------+-------------+ | A table with | two columns | diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_include.py b/docutils/test/test_parsers/test_rst/test_directives/test_include.py index e1c206c02..5b9ee0551 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_include.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_include.py @@ -63,7 +63,7 @@ def reldir(path): # Different error for path with 8bit chars with locale == C or None: try: - open(u'\u043c\u0438\u0440.txt') + open('\u043c\u0438\u0440.txt') except UnicodeEncodeError: errstr_8bit_path = """\ Cannot encode input file path "\u043c\u0438\u0440.txt" (wrong locale?).\ diff --git a/docutils/test/test_settings.py b/docutils/test/test_settings.py index 9d1f6f232..85f34e812 100755 --- a/docutils/test/test_settings.py +++ b/docutils/test/test_settings.py @@ -35,34 +35,34 @@ class ConfigFileTests(unittest.TestCase): # expected settings after parsing the equally named config_file: settings = { - 'old': {u'datestamp': u'%Y-%m-%d %H:%M UTC', - u'generator': True, - u'no_random': True, - u'python_home': u'http://www.python.org', - u'source_link': True, + 'old': {'datestamp': '%Y-%m-%d %H:%M UTC', + 'generator': True, + 'no_random': True, + 'python_home': 'http://www.python.org', + 'source_link': True, 'stylesheet': None, - u'stylesheet_path': [u'stylesheets/pep.css'], - 'template': fixpath(u'data/pep-html-template')}, - 'one': {u'datestamp': u'%Y-%m-%d %H:%M UTC', - u'generator': True, - u'no_random': True, - u'python_home': u'http://www.python.org', - u'raw_enabled': False, + 'stylesheet_path': ['stylesheets/pep.css'], + 'template': fixpath('data/pep-html-template')}, + 'one': {'datestamp': '%Y-%m-%d %H:%M UTC', + 'generator': True, + 'no_random': True, + 'python_home': 'http://www.python.org', + 'raw_enabled': False, 'record_dependencies': utils.DependencyList(), - u'source_link': True, + 'source_link': True, 'stylesheet': None, - u'stylesheet_path': [u'stylesheets/pep.css'], - u'tab_width': 8, - u'template': fixpath(u'data/pep-html-template'), - u'trim_footnote_reference_space': True, + 'stylesheet_path': ['stylesheets/pep.css'], + 'tab_width': 8, + 'template': fixpath('data/pep-html-template'), + 'trim_footnote_reference_space': True, 'output_encoding': 'ascii', 'output_encoding_error_handler': 'xmlcharrefreplace', }, - 'two': {u'footnote_references': u'superscript', - u'generator': False, + 'two': {'footnote_references': 'superscript', + 'generator': False, 'record_dependencies': utils.DependencyList(), - u'stylesheet': None, - u'stylesheet_path': [u'test.css'], + 'stylesheet': None, + 'stylesheet_path': ['test.css'], 'trim_footnote_reference_space': None, 'output_encoding_error_handler': 'namereplace'}, 'two_html5': { @@ -76,21 +76,21 @@ class ConfigFileTests(unittest.TestCase): 'trim_footnote_reference_space': True, 'output_encoding_error_handler': 'namereplace', }, - 'list': {u'expose_internals': [u'a', u'b', u'c', u'd', u'e'], - u'strip_classes': [u'spam', u'pan', u'fun', u'parrot'], - u'strip_elements_with_classes': [u'sugar', u'flour', u'milk', - u'safran']}, - 'list2': {u'expose_internals': [u'a', u'b', u'c', u'd', u'e', u'f'], - u'strip_classes': [u'spam', u'pan', u'fun', u'parrot', - u'ham', u'eggs'], - u'strip_elements_with_classes': [u'sugar', u'flour', - u'milk', u'safran', - u'eggs', u'salt'], + 'list': {'expose_internals': ['a', 'b', 'c', 'd', 'e'], + 'strip_classes': ['spam', 'pan', 'fun', 'parrot'], + 'strip_elements_with_classes': ['sugar', 'flour', 'milk', + 'safran']}, + 'list2': {'expose_internals': ['a', 'b', 'c', 'd', 'e', 'f'], + 'strip_classes': ['spam', 'pan', 'fun', 'parrot', + 'ham', 'eggs'], + 'strip_elements_with_classes': ['sugar', 'flour', + 'milk', 'safran', + 'eggs', 'salt'], 'stylesheet': ['style2.css'], 'stylesheet_path': None, }, - 'error': {u'error_encoding': u'ascii', - u'error_encoding_error_handler': u'strict'}, + 'error': {'error_encoding': 'ascii', + 'error_encoding_error_handler': 'strict'}, 'error2': {'error_encoding': 'latin1'}, } @@ -212,7 +212,7 @@ def tearDown(self): class HelperFunctionsTests(unittest.TestCase): - pathdict = {'foo': 'hallo', 'ham': u'h\xE4m', 'spam': u'spam'} + pathdict = {'foo': 'hallo', 'ham': 'h\xE4m', 'spam': 'spam'} keys = ['foo', 'ham'] def setUp(self): @@ -223,9 +223,9 @@ def test_make_paths_absolute(self): pathdict = self.pathdict.copy() frontend.make_paths_absolute(pathdict, self.keys, base_path='base') self.assertEqual(pathdict['foo'], os.path.abspath('base/hallo')) - self.assertEqual(pathdict['ham'], os.path.abspath(u'base/h\xE4m')) + self.assertEqual(pathdict['ham'], os.path.abspath('base/h\xE4m')) # not touched, because key not in keys: - self.assertEqual(pathdict['spam'], u'spam') + self.assertEqual(pathdict['spam'], 'spam') def test_make_paths_absolute_cwd(self): # With base_path None, the cwd is used as base path. @@ -233,20 +233,20 @@ def test_make_paths_absolute_cwd(self): # os.getcwdu() is used and the converted path is a unicode instance: pathdict = self.pathdict.copy() frontend.make_paths_absolute(pathdict, self.keys) - self.assertEqual(pathdict['foo'], os.path.abspath(u'hallo')) - self.assertEqual(pathdict['ham'], os.path.abspath(u'h\xE4m')) + self.assertEqual(pathdict['foo'], os.path.abspath('hallo')) + self.assertEqual(pathdict['ham'], os.path.abspath('h\xE4m')) # not touched, because key not in keys: - self.assertEqual(pathdict['spam'], u'spam') + self.assertEqual(pathdict['spam'], 'spam') boolean_settings = ( (True, True ), ('1', True ), - (u'on', True ), + ('on', True ), ('yes', True ), - (u'true', True ), - (u'0', False ), + ('true', True ), + ('0', False ), ('off', False ), - (u'no', False ), + ('no', False ), ('false', False ), ) def test_validate_boolean(self): @@ -258,7 +258,7 @@ def test_validate_boolean(self): def test_validate_ternary(self): tests = ( ('500V', '500V'), - (u'parrot', u'parrot'), + ('parrot', 'parrot'), ) for t in self.boolean_settings + tests: self.assertEqual( @@ -267,12 +267,12 @@ def test_validate_ternary(self): def test_validate_colon_separated_string_list(self): tests = ( - (u'a', ['a',] ), ('a', ['a',] ), - (u'a:b', ['a', 'b'] ), + ('a', ['a',] ), + ('a:b', ['a', 'b'] ), ('a:b', ['a', 'b'] ), - ([u'a',], ['a',] ), - ([u'a', u'b:c'], ['a', 'b', 'c'] ), + (['a',], ['a',] ), + (['a', 'b:c'], ['a', 'b', 'c'] ), ) for t in tests: self.assertEqual( @@ -281,12 +281,12 @@ def test_validate_colon_separated_string_list(self): def test_validate_comma_separated_list(self): tests = ( - (u'a', ['a',] ), ('a', ['a',] ), - (u'a,b', ['a', 'b'] ), + ('a', ['a',] ), ('a,b', ['a', 'b'] ), - ([u'a',], ['a',] ), - ([u'a', u'b,c'], ['a', 'b', 'c'] ), + ('a,b', ['a', 'b'] ), + (['a',], ['a',] ), + (['a', 'b,c'], ['a', 'b', 'c'] ), (['a', 'b,c'], ['a', 'b', 'c'] ), ) for t in tests: @@ -298,7 +298,7 @@ def test_validate_url_trailing_slash(self): tests = ( ('', './' ), (None, './' ), - (u'http://example.org', u'http://example.org/' ), + ('http://example.org', 'http://example.org/' ), ('http://example.org/', 'http://example.org/' ), ) for t in tests: @@ -309,11 +309,11 @@ def test_validate_url_trailing_slash(self): def test_validate_smartquotes_locales(self): tests = ( ('en:ssvv', [('en', 'ssvv')]), - (u'sd:«»°°', [(u'sd', u'«»°°')]), - ([('sd', u'«»°°'), u'ds:°°«»'], [('sd', u'«»°°'), - ('ds', u'°°«»')]), - (u'frs:« : »:((:))', [(u'frs', [u'« ', u' »', - u'((', u'))'])]), + ('sd:«»°°', [('sd', '«»°°')]), + ([('sd', '«»°°'), 'ds:°°«»'], [('sd', '«»°°'), + ('ds', '°°«»')]), + ('frs:« : »:((:))', [('frs', ['« ', ' »', + '((', '))'])]), ) for t in tests: self.assertEqual( diff --git a/docutils/test/test_transforms/test_smartquotes.py b/docutils/test/test_transforms/test_smartquotes.py index dea85efae..b61f143ce 100644 --- a/docutils/test/test_transforms/test_smartquotes.py +++ b/docutils/test/test_transforms/test_smartquotes.py @@ -35,7 +35,7 @@ def suite(): settings['smart_quotes'] = 'alternative' s.generateTests(totest_de_alt) settings['smart_quotes'] = True - settings['smartquotes_locales'] = [('de', u'«»()'), ('nl', u'„”’’')] + settings['smartquotes_locales'] = [('de', '«»()'), ('nl', '„”’’')] s.generateTests(totest_locales) return s diff --git a/docutils/test/test_utils.py b/docutils/test/test_utils.py index a4e9fc552..23ec95ff2 100755 --- a/docutils/test/test_utils.py +++ b/docutils/test/test_utils.py @@ -74,7 +74,7 @@ def test_level4(self): def test_unicode_message(self): - sw = self.reporter.system_message(0, u'mesidʒ') + sw = self.reporter.system_message(0, 'mesidʒ') self.assertEqual(sw.pformat(), """\ <system_message level="0" source="test data" type="DEBUG"> <paragraph> @@ -86,7 +86,7 @@ def test_unicode_message_from_exception(self): unicode(<exception instance>) uses __str__ and hence fails with unicode message""" try: - raise Exception(u'mesidʒ') + raise Exception('mesidʒ') except Exception as err: sw = self.reporter.system_message(0, err) self.assertEqual(sw.pformat(), """\ @@ -198,13 +198,13 @@ def test_extract_extension_options(self): nodes.field_body('', nodes.paragraph('', '2.0'))) field_list += nodes.field( '', nodes.field_name('', 'cdef'), - nodes.field_body('', nodes.paragraph('', u'hol\u00e0'))) + nodes.field_body('', nodes.paragraph('', 'hol\u00e0'))) field_list += nodes.field( '', nodes.field_name('', 'empty'), nodes.field_body()) self.assertEqual( utils.extract_extension_options(field_list, self.optionspec), {'a': 1, 'bbb': 2.0, - 'cdef': u'hol\u00e0', + 'cdef': 'hol\u00e0', 'empty': None}) self.assertRaises(KeyError, utils.extract_extension_options, field_list, {}) @@ -272,22 +272,22 @@ def test_normalize_language_tag(self): 'grc-x-altquot', 'grc']) def test_column_width(self): - self.assertEqual(utils.column_width(u'de'), 2) - self.assertEqual(utils.column_width(u'dâ'), 2) # pre-composed - self.assertEqual(utils.column_width(u'dâ'), 2) # combining + self.assertEqual(utils.column_width('de'), 2) + self.assertEqual(utils.column_width('dâ'), 2) # pre-composed + self.assertEqual(utils.column_width('dâ'), 2) # combining def test_decode_path(self): try: - bytes_filename = u'späm'.encode(sys.getfilesystemencoding()) + bytes_filename = 'späm'.encode(sys.getfilesystemencoding()) except UnicodeEncodeError: bytes_filename = b'spam' bytespath = utils.decode_path(bytes_filename) - unipath = utils.decode_path(u'späm') + unipath = utils.decode_path('späm') defaultpath = utils.decode_path(None) if bytes_filename != b'spam': # skip if ä cannot be encoded - self.assertEqual(bytespath, u'späm') - self.assertEqual(unipath, u'späm') - self.assertEqual(defaultpath, u'') + self.assertEqual(bytespath, 'späm') + self.assertEqual(unipath, 'späm') + self.assertEqual(defaultpath, '') self.assertTrue(isinstance(bytespath, str)) self.assertTrue(isinstance(unipath, str)) self.assertTrue(isinstance(defaultpath, str)) @@ -313,16 +313,16 @@ def test_relative_path(self): # self.assertEqual(utils.relative_path(source, target), # os.path.abspath('fileB')) # Correctly process unicode instances: - self.assertEqual(utils.relative_path(u'spam', u'spam'), u'') - source = os.path.join(u'h\xE4m', u'spam', u'fileA') - target = os.path.join(u'h\xE4m', u'spam', u'fileB') - self.assertEqual(utils.relative_path(source, target), u'fileB') - source = os.path.join(u'h\xE4m', u'spam', u'fileA') - target = os.path.join(u'h\xE4m', u'fileB') - self.assertEqual(utils.relative_path(source, target), u'../fileB') + self.assertEqual(utils.relative_path('spam', 'spam'), '') + source = os.path.join('h\xE4m', 'spam', 'fileA') + target = os.path.join('h\xE4m', 'spam', 'fileB') + self.assertEqual(utils.relative_path(source, target), 'fileB') + source = os.path.join('h\xE4m', 'spam', 'fileA') + target = os.path.join('h\xE4m', 'fileB') + self.assertEqual(utils.relative_path(source, target), '../fileB') # if source is None, default to the cwd: - target = os.path.join(u'eggs', u'fileB') - self.assertEqual(utils.relative_path(None, target), u'eggs/fileB') + target = os.path.join('eggs', 'fileB') + self.assertEqual(utils.relative_path(None, target), 'eggs/fileB') def test_find_file_in_dirs(self): # Search for file `path` in the sequence of directories `dirs`. diff --git a/docutils/test/test_writers/test_docutils_xml.py b/docutils/test/test_writers/test_docutils_xml.py index 25da57677..dc56dc847 100755 --- a/docutils/test/test_writers/test_docutils_xml.py +++ b/docutils/test/test_writers/test_docutils_xml.py @@ -43,7 +43,7 @@ "http://docutils.sourceforge.net/docs/ref/docutils.dtd"> """ -generatedby = u'<!-- Generated by Docutils %s -->\n' % docutils.__version__ +generatedby = '<!-- Generated by Docutils %s -->\n' % docutils.__version__ bodynormal = """\ <document source="<string>"><paragraph>Test</paragraph>\ @@ -147,7 +147,7 @@ def test_publish(self): settings['newlines'] = False for settings['xml_declaration'] in True, False: for settings['doctype_declaration'] in True, False: - expected = u'' + expected = '' if settings['xml_declaration']: expected += xmldecl if settings['doctype_declaration']: @@ -186,14 +186,14 @@ def test_invalid_raw_xml(self): self.assertEqual(result, expected) warnings.seek(0) self.assertEqual(warnings.readlines(), - [u'<string>:5: ' - u'(WARNING/2) Invalid raw XML in column 2, line offset 3:\n', - u'<root>\n', - u' <child>Test \xe4\xf6\xfc\u20ac</child>\n', - u'</mismatch>\n', - u'<string>:10: ' - u'(WARNING/2) Invalid raw XML in column 30, line offset 1:\n', - u'<test>inline raw XML</test>\n']) + ['<string>:5: ' + '(WARNING/2) Invalid raw XML in column 2, line offset 3:\n', + '<root>\n', + ' <child>Test \xe4\xf6\xfc\u20ac</child>\n', + '</mismatch>\n', + '<string>:10: ' + '(WARNING/2) Invalid raw XML in column 30, line offset 1:\n', + '<test>inline raw XML</test>\n']) settings['halt_level'] = 2 # convert info messages to exceptions settings['warning_stream'] = '' self.assertRaises(docutils.utils.SystemMessage, diff --git a/docutils/test/test_writers/test_html4css1_misc.py b/docutils/test/test_writers/test_html4css1_misc.py index 0c83e06bb..b13b680b2 100755 --- a/docutils/test/test_writers/test_html4css1_misc.py +++ b/docutils/test/test_writers/test_html4css1_misc.py @@ -24,7 +24,7 @@ def test_xmlcharrefreplace(self): 'stylesheet': '', '_disable_config': True,} result = core.publish_string( - u'EUR = \u20ac', writer_name='html4css1', + 'EUR = \u20ac', writer_name='html4css1', settings_overrides=settings_overrides) # Encoding a euro sign with latin1 doesn't work, so the # xmlcharrefreplace handler is used. diff --git a/docutils/test/test_writers/test_html5_polyglot_misc.py b/docutils/test/test_writers/test_html5_polyglot_misc.py index b8227201b..bee9a1ebd 100644 --- a/docutils/test/test_writers/test_html5_polyglot_misc.py +++ b/docutils/test/test_writers/test_html5_polyglot_misc.py @@ -27,7 +27,7 @@ def test_xmlcharrefreplace(self): 'stylesheet': '', '_disable_config': True,} result = core.publish_string( - u'EUR = \u20ac', writer_name='html5_polyglot', + 'EUR = \u20ac', writer_name='html5_polyglot', settings_overrides=settings_overrides) # Encoding a euro sign with latin1 doesn't work, so the # xmlcharrefreplace handler is used. @@ -144,7 +144,7 @@ def test_future_warnings(self): } with warnings.catch_warnings(record=True) as wng: warnings.simplefilter("always") - core.publish_string(u'warnings test', writer_name='html5', + core.publish_string('warnings test', writer_name='html5', settings_overrides=mysettings) self.assertEqual(len(wng), 1, "Expected FutureWarning.") assert issubclass(wng[0].category, FutureWarning) diff --git a/docutils/test/test_writers/test_latex2e_misc.py b/docutils/test/test_writers/test_latex2e_misc.py index 7cb310759..c4ce200b2 100644 --- a/docutils/test/test_writers/test_latex2e_misc.py +++ b/docutils/test/test_writers/test_latex2e_misc.py @@ -64,7 +64,7 @@ def test_future_warnings(self): } with warnings.catch_warnings(record=True) as wng: warnings.simplefilter("always") - core.publish_string(u'warnings test', writer_name='latex', + core.publish_string('warnings test', writer_name='latex', settings_overrides=mysettings) self.assertEqual(len(wng), 2, "Expected 2 FutureWarnings.") assert issubclass(wng[0].category, FutureWarning) diff --git a/docutils/tools/dev/generate_punctuation_chars.py b/docutils/tools/dev/generate_punctuation_chars.py index 30b503cf2..b9f9f6b61 100644 --- a/docutils/tools/dev/generate_punctuation_chars.py +++ b/docutils/tools/dev/generate_punctuation_chars.py @@ -90,21 +90,21 @@ %(delimiters)s if sys.maxunicode >= 0x10FFFF: # "wide" build %(delimiters_wide)s -closing_delimiters = u'\\\\\\\\.,;!?' +closing_delimiters = '\\\\\\\\.,;!?' # Matching open/close quotes # -------------------------- quote_pairs = {# open char: matching closing characters # usage example - u'\\xbb': u'\\xbb', # » » Swedish - u'\\u2018': u'\\u201a', # ‘ ‚ Albanian/Greek/Turkish - u'\\u2019': u'\\u2019', # ’ ’ Swedish - u'\\u201a': u'\\u2018\\u2019', # ‚ ‘ German ‚ ’ Polish - u'\\u201c': u'\\u201e', # “ „ Albanian/Greek/Turkish - u'\\u201e': u'\\u201c\\u201d', # „ “ German „ ” Polish - u'\\u201d': u'\\u201d', # ” ” Swedish - u'\\u203a': u'\\u203a', # › › Swedish + '\\xbb': '\\xbb', # » » Swedish + '\\u2018': '\\u201a', # ‘ ‚ Albanian/Greek/Turkish + '\\u2019': '\\u2019', # ’ ’ Swedish + '\\u201a': '\\u2018\\u2019', # ‚ ‘ German ‚ ’ Polish + '\\u201c': '\\u201e', # “ „ Albanian/Greek/Turkish + '\\u201e': '\\u201c\\u201d', # „ “ German „ ” Polish + '\\u201d': '\\u201d', # ” ” Swedish + '\\u203a': '\\u203a', # › › Swedish } """Additional open/close quote pairs.""" @@ -121,7 +121,7 @@ def match_chars(c1, c2): i = openers.index(c1) except ValueError: # c1 not in openers return False - return c2 == closers[i] or c2 in quote_pairs.get(c1, u'')\ + return c2 == closers[i] or c2 in quote_pairs.get(c1, '')\ ''' @@ -202,21 +202,21 @@ def character_category_patterns(): # low quotation marks are also used as closers (e.g. in Greek) # move them to category Pi: - ucharlists['Ps'].remove(u'‚') # 201A SINGLE LOW-9 QUOTATION MARK - ucharlists['Ps'].remove(u'„') # 201E DOUBLE LOW-9 QUOTATION MARK - ucharlists['Pi'] += [u'‚', u'„'] + ucharlists['Ps'].remove('‚') # 201A SINGLE LOW-9 QUOTATION MARK + ucharlists['Ps'].remove('„') # 201E DOUBLE LOW-9 QUOTATION MARK + ucharlists['Pi'] += ['‚', '„'] - ucharlists['Pi'].remove(u'‛') # 201B SINGLE HIGH-REVERSED-9 QUOTATION MARK - ucharlists['Pi'].remove(u'‟') # 201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK - ucharlists['Pf'] += [u'‛', u'‟'] + ucharlists['Pi'].remove('‛') # 201B SINGLE HIGH-REVERSED-9 QUOTATION MARK + ucharlists['Pi'].remove('‟') # 201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK + ucharlists['Pf'] += ['‛', '‟'] # 301F LOW DOUBLE PRIME QUOTATION MARK misses the opening pendant: - ucharlists['Ps'].insert(ucharlists['Pe'].index(u'\u301f'), u'\u301d') + ucharlists['Ps'].insert(ucharlists['Pe'].index('\u301f'), '\u301d') - # print(u''.join(ucharlists['Ps']).encode('utf8') - # print(u''.join(ucharlists['Pe']).encode('utf8') - # print(u''.join(ucharlists['Pi']).encode('utf8') - # print(u''.join(ucharlists['Pf']).encode('utf8') + # print(''.join(ucharlists['Ps']).encode('utf8') + # print(''.join(ucharlists['Pe']).encode('utf8') + # print(''.join(ucharlists['Pi']).encode('utf8') + # print(''.join(ucharlists['Pf']).encode('utf8') # The Docutils character categories # --------------------------------- @@ -226,24 +226,24 @@ def character_category_patterns(): # recognition rules`_) # allowed before markup if there is a matching closer - openers = [u'"\'(<\\[{'] + openers = ['"\'(<\\[{'] for category in ('Ps', 'Pi', 'Pf'): openers.extend(ucharlists[category]) # allowed after markup if there is a matching opener - closers = [u'"\')>\\]}'] + closers = ['"\')>\\]}'] for category in ('Pe', 'Pf', 'Pi'): closers.extend(ucharlists[category]) # non-matching, allowed on both sides - delimiters = [u'\\-/:'] + delimiters = ['\\-/:'] for category in ('Pd', 'Po'): delimiters.extend(ucharlists[category]) # non-matching, after markup closing_delimiters = [r'\\.,;!?'] - return [u''.join(chars) for chars in (openers, closers, delimiters, + return [''.join(chars) for chars in (openers, closers, delimiters, closing_delimiters)] def separate_wide_chars(s): @@ -273,12 +273,12 @@ def mark_intervals(s): for i in l: i = [chr(n) for n in i] if len(i) > 2: - i = i[0], u'-', i[-1] + i = i[0], '-', i[-1] l2.extend(i) return ''.join(l2) -def wrap_string(s, startstring= "(u'", +def wrap_string(s, startstring= "('", endstring = "')", wrap=67): """Line-wrap a unicode string literal definition.""" c = len(startstring) @@ -384,14 +384,14 @@ def print_differences(old, new, name): 'python_version': '.'.join(str(s) for s in sys.version_info[:3]), 'unidata_version': unicodedata.unidata_version, 'openers': wrap_string(o.encode('unicode-escape').decode(), - startstring="openers = (u'"), + startstring="openers = ('"), 'closers': wrap_string(c.encode('unicode-escape').decode(), - startstring="closers = (u'"), + startstring="closers = ('"), 'delimiters': wrap_string(d.encode('unicode-escape').decode(), - startstring="delimiters = (u'"), + startstring="delimiters = ('"), 'delimiters_wide': wrap_string( d_wide.encode('unicode-escape').decode(), - startstring=" delimiters += (u'") + startstring=" delimiters += ('") } print(module_template % substitutions) diff --git a/docutils/tools/docutils-cli.py b/docutils/tools/docutils-cli.py index dac39caab..f839f76ae 100755 --- a/docutils/tools/docutils-cli.py +++ b/docutils/tools/docutils-cli.py @@ -54,7 +54,7 @@ class CliSettingsSpec(docutils.SettingsSpec): 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') @@ -65,14 +65,32 @@ class CliSettingsSpec(docutils.SettingsSpec): formatter_class=argparse.ArgumentDefaultsHelpFormatter, add_help=False,) -argparser.add_argument('--reader', help='reader name', - default=default_settings.reader) -argparser.add_argument('--parser', help='parser name', - default=default_settings.parser) -argparser.add_argument('--writer', help='writer name', - default=default_settings.writer) +description = 'Generate documents from reStructuredText or Markdown sources.' -(args, remainder) = argparser.parse_known_args() +epilog = ('Further optional arguments are added by the selected ' + 'components, the list below adapts to your selection.' + ) + +parser = argparse.ArgumentParser(add_help=False, + description=description, epilog=epilog, + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + +parser.add_argument('source', nargs='?') +parser.add_argument('destination', nargs='?') +parser.add_argument('--reader', help='reader name', + default=default_settings['reader']) +parser.add_argument('--parser', help='parser name', + default=default_settings['parser']) +parser.add_argument('--writer', help='writer name', + default=default_settings['writer']) + +(args, remainder) = parser.parse_known_args() + +# push back positional arguments +if args.destination: + remainder.insert(0, args.destination) +if args.source: + remainder.insert(0, args.source) if '-h' in sys.argv or '--help' in sys.argv: print(argparser.format_help()) diff --git a/docutils/tools/rst2html5.py b/docutils/tools/rst2html5.py index ce49466e8..744b5c751 100755 --- a/docutils/tools/rst2html5.py +++ b/docutils/tools/rst2html5.py @@ -26,8 +26,8 @@ from docutils.core import publish_cmdline, default_description -description = (u'Generates HTML5 documents from standalone ' - u'reStructuredText sources.\n' +description = ('Generates HTML5 documents from standalone ' + 'reStructuredText sources.\n' + default_description) publish_cmdline(writer_name='html5', description=description) From a03f4ae8b79acc3e7e43b02b33b52944b43ab15b Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Fri, 21 Jan 2022 19:01:30 +0000 Subject: [PATCH 05/36] s/u'''/'''/ --- docutils/tools/dev/generate_punctuation_chars.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docutils/tools/dev/generate_punctuation_chars.py b/docutils/tools/dev/generate_punctuation_chars.py index b9f9f6b61..e8fd068bd 100644 --- a/docutils/tools/dev/generate_punctuation_chars.py +++ b/docutils/tools/dev/generate_punctuation_chars.py @@ -41,7 +41,7 @@ # # Problem: ``ur`` prefix fails with Py 3.5 :: -module_template = u'''#!/usr/bin/env python3 +module_template = '''#!/usr/bin/env python3 # :Id: $Id$ # :Copyright: © 2011, 2017 Günter Milde. # :License: Released under the terms of the `2-Clause BSD license`_, in short: From 55b17ba0c7f30e94da0ace88c5bdb51b9f4403c5 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Fri, 21 Jan 2022 19:03:51 +0000 Subject: [PATCH 06/36] Use a raw string in generate_punctuation_chars.py --- .../tools/dev/generate_punctuation_chars.py | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/docutils/tools/dev/generate_punctuation_chars.py b/docutils/tools/dev/generate_punctuation_chars.py index e8fd068bd..a45cf26c2 100644 --- a/docutils/tools/dev/generate_punctuation_chars.py +++ b/docutils/tools/dev/generate_punctuation_chars.py @@ -38,10 +38,8 @@ # Template for utils.punctuation_chars # ------------------------------------ -# -# Problem: ``ur`` prefix fails with Py 3.5 :: -module_template = '''#!/usr/bin/env python3 +module_template = r'''#!/usr/bin/env python3 # :Id: $Id$ # :Copyright: © 2011, 2017 Günter Milde. # :License: Released under the terms of the `2-Clause BSD license`_, in short: @@ -90,21 +88,21 @@ %(delimiters)s if sys.maxunicode >= 0x10FFFF: # "wide" build %(delimiters_wide)s -closing_delimiters = '\\\\\\\\.,;!?' +closing_delimiters = '\\\\.,;!?' # Matching open/close quotes # -------------------------- quote_pairs = {# open char: matching closing characters # usage example - '\\xbb': '\\xbb', # » » Swedish - '\\u2018': '\\u201a', # ‘ ‚ Albanian/Greek/Turkish - '\\u2019': '\\u2019', # ’ ’ Swedish - '\\u201a': '\\u2018\\u2019', # ‚ ‘ German ‚ ’ Polish - '\\u201c': '\\u201e', # “ „ Albanian/Greek/Turkish - '\\u201e': '\\u201c\\u201d', # „ “ German „ ” Polish - '\\u201d': '\\u201d', # ” ” Swedish - '\\u203a': '\\u203a', # › › Swedish + '\xbb': '\xbb', # » » Swedish + '\u2018': '\u201a', # ‘ ‚ Albanian/Greek/Turkish + '\u2019': '\u2019', # ’ ’ Swedish + '\u201a': '\u2018\u2019', # ‚ ‘ German ‚ ’ Polish + '\u201c': '\u201e', # “ „ Albanian/Greek/Turkish + '\u201e': '\u201c\u201d', # „ “ German „ ” Polish + '\u201d': '\u201d', # ” ” Swedish + '\u203a': '\u203a', # › › Swedish } """Additional open/close quote pairs.""" From d7c64629914c7edff1910a7911dd81f94c98625c Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Sat, 22 Jan 2022 17:30:55 +0000 Subject: [PATCH 07/36] Set literals --- docutils/docutils/transforms/universal.py | 4 ++-- docutils/docutils/writers/html5_polyglot/__init__.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docutils/docutils/transforms/universal.py b/docutils/docutils/transforms/universal.py index 715c724b6..e31249593 100644 --- a/docutils/docutils/transforms/universal.py +++ b/docutils/docutils/transforms/universal.py @@ -198,8 +198,8 @@ class StripClassesAndElements(Transform): def apply(self): if self.document.settings.strip_elements_with_classes: - self.strip_elements = set( - self.document.settings.strip_elements_with_classes) + self.strip_elements = {*self.document.settings + .strip_elements_with_classes} # Iterate over a tuple as removing the current node # corrupts the iterator returned by `iter`: for node in tuple(self.document.findall(self.check_classes)): diff --git a/docutils/docutils/writers/html5_polyglot/__init__.py b/docutils/docutils/writers/html5_polyglot/__init__.py index b6cbea957..670666293 100644 --- a/docutils/docutils/writers/html5_polyglot/__init__.py +++ b/docutils/docutils/writers/html5_polyglot/__init__.py @@ -155,7 +155,7 @@ def depart_caption(self, node): # <figcaption> is closed in depart_figure(), as legend may follow. # use HTML block-level tags if matching class value found - supported_block_tags = set(('ins', 'del')) + 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: @@ -301,9 +301,9 @@ def depart_image(self, node): pass # use HTML text-level tags if matching class value found - supported_inline_tags = set(('code', 'kbd', 'dfn', 'samp', 'var', - 'bdi', 'del', 'ins', 'mark', 'small', - 'b', 'i', 'q', 's', 'u')) + supported_inline_tags = {'code', 'kbd', 'dfn', 'samp', 'var', + 'bdi', 'del', 'ins', 'mark', 'small', + 'b', 'i', 'q', 's', 'u'} def visit_inline(self, node): # Use `supported_inline_tags` if found in class values classes = node['classes'] From f211d4cc453aca6fce96347797be6e5c425a7105 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Sat, 22 Jan 2022 17:33:12 +0000 Subject: [PATCH 08/36] Dictionary literals --- docutils/docutils/transforms/universal.py | 1 + docutils/docutils/utils/math/math2html.py | 8 ++++---- docutils/docutils/writers/html4css1/__init__.py | 2 +- docutils/docutils/writers/latex2e/__init__.py | 2 +- docutils/docutils/writers/xetex/__init__.py | 2 +- docutils/test/local-parser.py | 1 - 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docutils/docutils/transforms/universal.py b/docutils/docutils/transforms/universal.py index e31249593..012bf9cae 100644 --- a/docutils/docutils/transforms/universal.py +++ b/docutils/docutils/transforms/universal.py @@ -279,6 +279,7 @@ def apply(self): document_language = self.document.settings.language_code lc_smartquotes = self.document.settings.smartquotes_locales if lc_smartquotes: + # TODO this modifies global state, perhaps refactor smartquotes.smartchars.quotes.update(dict(lc_smartquotes)) # "Educate" quotes in normal text. Handle each block of text diff --git a/docutils/docutils/utils/math/math2html.py b/docutils/docutils/utils/math/math2html.py index c59de617c..16216d94c 100755 --- a/docutils/docutils/utils/math/math2html.py +++ b/docutils/docutils/utils/math/math2html.py @@ -625,7 +625,7 @@ class Options(object): simplemath = False showlines = True - branches = dict() + branches = {} def parseoptions(self, args): "Parse command line options" @@ -734,7 +734,7 @@ class Parser(object): def __init__(self): self.begin = 0 - self.parameters = dict() + self.parameters = {} def parseheader(self, reader): "Parse the header" @@ -2042,7 +2042,7 @@ class FormulaFactory(object): def __init__(self): "Initialize the map of instances." - self.instances = dict() + self.instances = {} def detecttype(self, type, pos): "Detect a bit of a given type." @@ -2933,7 +2933,7 @@ class ParameterFunction(CommandBit): def readparams(self, readtemplate, pos): "Read the params according to the template." - self.params = dict() + self.params = {} for paramdef in self.paramdefs(readtemplate): paramdef.read(pos, self) self.params['$' + paramdef.name] = paramdef diff --git a/docutils/docutils/writers/html4css1/__init__.py b/docutils/docutils/writers/html4css1/__init__.py index 2152f3cef..3720789c0 100644 --- a/docutils/docutils/writers/html4css1/__init__.py +++ b/docutils/docutils/writers/html4css1/__init__.py @@ -158,7 +158,7 @@ class HTMLTranslator(writers._html_base.HTMLTranslator): ' 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} special_characters[0xa0] = ' ' # use character reference for dash (not valid in HTML5) diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py index 7ed7067b7..74fc0d91e 100644 --- a/docutils/docutils/writers/latex2e/__init__.py +++ b/docutils/docutils/writers/latex2e/__init__.py @@ -388,7 +388,7 @@ class Babel(object): # zh-Latn: Chinese Pinyin } # normalize (downcase) keys - language_codes = dict([(k.lower(), v) for (k, v) in language_codes.items()]) + language_codes = {k.lower(): v for k, v in language_codes.items()} warn_msg = 'Language "%s" not supported by LaTeX (babel)' diff --git a/docutils/docutils/writers/xetex/__init__.py b/docutils/docutils/writers/xetex/__init__.py index 34fed5d6b..a1e68f0ac 100644 --- a/docutils/docutils/writers/xetex/__init__.py +++ b/docutils/docutils/writers/xetex/__init__.py @@ -94,7 +94,7 @@ class Babel(latex2e.Babel): # zh-Latn: ??? # Chinese Pinyin }) # normalize (downcase) keys - language_codes = dict([(k.lower(), v) for (k, v) in language_codes.items()]) + language_codes = {k.lower(): v for k, v in language_codes.items()} # Languages without Polyglossia support: for key in ('af', # 'afrikaans', diff --git a/docutils/test/local-parser.py b/docutils/test/local-parser.py index 265a04baa..97fb23b79 100644 --- a/docutils/test/local-parser.py +++ b/docutils/test/local-parser.py @@ -16,5 +16,4 @@ class Parser(parsers.Parser): def parser(self, inputstring, document): self.setup_parse(inputstring, document) - document = dict() self.finish_parse() From b9120d2a49786dfb0caa0140554cdab5dea1bfb4 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Sat, 22 Jan 2022 17:38:15 +0000 Subject: [PATCH 09/36] Generator expressions for built-ins --- docutils/docutils/utils/__init__.py | 4 ++-- docutils/docutils/utils/math/math2html.py | 4 ++-- docutils/docutils/writers/latex2e/__init__.py | 7 +++---- docutils/tools/dev/generate_punctuation_chars.py | 2 +- docutils/tools/dev/unicode2rstsubs.py | 2 +- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/docutils/docutils/utils/__init__.py b/docutils/docutils/utils/__init__.py index 6e0c17324..0608ac2dd 100644 --- a/docutils/docutils/utils/__init__.py +++ b/docutils/docutils/utils/__init__.py @@ -639,8 +639,8 @@ def column_width(text): Correct ``len(text)`` for wide East Asian and combining Unicode chars. """ - width = sum([east_asian_widths[unicodedata.east_asian_width(c)] - for c in text]) + width = sum(east_asian_widths[unicodedata.east_asian_width(c)] + for c in text) # correction for combining chars: width -= len(find_combining_chars(text)) return width diff --git a/docutils/docutils/utils/math/math2html.py b/docutils/docutils/utils/math/math2html.py index 16216d94c..122818018 100755 --- a/docutils/docutils/utils/math/math2html.py +++ b/docutils/docutils/utils/math/math2html.py @@ -1653,7 +1653,7 @@ def computesize(self): "Compute the size of the bit as the max of the sizes of all contents." if len(self.contents) == 0: return 1 - self.size = max([element.size for element in self.contents]) + self.size = max(element.size for element in self.contents) return self.size def clone(self): @@ -2848,7 +2848,7 @@ def findright(self, contents, index): def findmax(self, contents, leftindex, rightindex): "Find the max size of the contents between the two given indices." sliced = contents[leftindex:rightindex] - return max([element.size for element in sliced]) + return max(element.size for element in sliced) def resize(self, command, size): "Resize a bracket command to the given size." diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py index 74fc0d91e..ab46dc0e8 100644 --- a/docutils/docutils/writers/latex2e/__init__.py +++ b/docutils/docutils/writers/latex2e/__init__.py @@ -995,9 +995,8 @@ def get_column_width(self): def get_multicolumn_width(self, start, len_): """Return sum of columnwidths for multicell.""" try: - multicol_width = sum([width - for width in ([self._colwidths[start + co] - for co in range(len_)])]) + multicol_width = sum(self._colwidths[start + co] + for co in range(len_)) if self.legacy_column_widths: return 'p{%.2f\\DUtablewidth}' % multicol_width return 'p{\\DUcolumnwidth{%.3f}}' % multicol_width @@ -1038,7 +1037,7 @@ def depart_thead(self): n_c = len(self._col_specs) a.append('\\endhead\n') # footer on all but last page (if it fits): - twidth = sum([node['colwidth']+2 for node in self._col_specs]) + twidth = sum(node['colwidth']+2 for node in self._col_specs) if twidth > 30 or (twidth > 12 and not self.colwidths_auto): a.append(r'\multicolumn{%d}{%s}' % (n_c, self.get_multicolumn_width(0, n_c)) diff --git a/docutils/tools/dev/generate_punctuation_chars.py b/docutils/tools/dev/generate_punctuation_chars.py index a45cf26c2..90dc02d7f 100644 --- a/docutils/tools/dev/generate_punctuation_chars.py +++ b/docutils/tools/dev/generate_punctuation_chars.py @@ -257,7 +257,7 @@ def mark_intervals(s): Sort string and replace 'cdef' by 'c-f' and similar. """ l =[] - s = sorted([ord(ch) for ch in s]) + s = sorted(ord(ch) for ch in s) for n in s: try: if l[-1][-1]+1 == n: diff --git a/docutils/tools/dev/unicode2rstsubs.py b/docutils/tools/dev/unicode2rstsubs.py index 5727a1cf0..58a76b63b 100755 --- a/docutils/tools/dev/unicode2rstsubs.py +++ b/docutils/tools/dev/unicode2rstsubs.py @@ -170,7 +170,7 @@ def write_set(self, set_name, wide=None): print('writing file "%s"' % outname) outfile.write(self.header + '\n') set = self.sets[set_name] - entities = sorted([(e.lower(), e) for e in set.keys()]) + entities = sorted((e.lower(), e) for e in set.keys()) longest = 0 for _, entity_name in entities: longest = max(longest, len(entity_name)) From fcd9c3254eec9ecbd47a5a6190610aaf0f009a5e Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Sat, 22 Jan 2022 17:41:50 +0000 Subject: [PATCH 10/36] Generator expression for str.join --- docutils/docutils/io.py | 2 +- docutils/docutils/nodes.py | 20 +++++++++---------- .../parsers/rst/directives/__init__.py | 6 +++--- .../docutils/parsers/rst/directives/misc.py | 4 ++-- docutils/docutils/parsers/rst/states.py | 2 +- docutils/docutils/utils/__init__.py | 2 +- docutils/docutils/utils/math/__init__.py | 4 ++-- docutils/docutils/utils/math/latex2mathml.py | 6 +++--- .../docutils/utils/math/tex2mathml_extern.py | 4 ++-- docutils/docutils/utils/smartquotes.py | 16 +++------------ docutils/docutils/writers/latex2e/__init__.py | 12 +++++------ docutils/docutils/writers/odf_odt/__init__.py | 4 ++-- docutils/docutils/writers/s5_html/__init__.py | 2 +- .../test/test_parsers/test_rst/test_tables.py | 12 +++++------ docutils/tools/dev/unicode2rstsubs.py | 2 +- docutils/tools/quicktest.py | 4 ++-- 16 files changed, 46 insertions(+), 56 deletions(-) diff --git a/docutils/docutils/io.py b/docutils/docutils/io.py index c1b16636b..c3ba3a9ac 100644 --- a/docutils/docutils/io.py +++ b/docutils/docutils/io.py @@ -145,7 +145,7 @@ def decode(self, data): error = err raise UnicodeError( 'Unable to decode input data. Tried the following encodings: ' - '%s.\n(%s)' % (', '.join([repr(enc) for enc in encodings]), + '%s.\n(%s)' % (', '.join(repr(enc) for enc in encodings), error_string(error))) coding_slug = re.compile(br"coding[:=]\s*([-\w.]+)") diff --git a/docutils/docutils/nodes.py b/docutils/docutils/nodes.py index f30bed71a..dfdb3ba47 100644 --- a/docutils/docutils/nodes.py +++ b/docutils/docutils/nodes.py @@ -553,7 +553,7 @@ def _dom_node(self, domroot): element = domroot.createElement(self.tagname) for attribute, value in self.attlist(): if isinstance(value, list): - value = ' '.join([serial_escape('%s' % (v,)) for v in value]) + value = ' '.join(serial_escape('%s' % (v,)) for v in value) element.setAttribute(attribute, '%s' % value) for child in self.children: element.appendChild(child._dom_node(domroot)) @@ -582,7 +582,7 @@ def shortrepr(self): def __str__(self): if self.children: return '%s%s%s' % (self.starttag(), - ''.join([str(c) for c in self.children]), + ''.join(str(c) for c in self.children), self.endtag()) else: return self.emptytag() @@ -609,9 +609,9 @@ def endtag(self): return '</%s>' % self.tagname def emptytag(self): - return '<%s/>' % ' '.join([self.tagname] + - ['%s="%s"' % (n, v) - for n, v in self.attlist()]) + return '<%s/>' % ' '.join((self.tagname, + *('%s="%s"' % (n, v) + for n, v in self.attlist()))) def __len__(self): return len(self.children) @@ -1052,9 +1052,9 @@ def first_child_not_matching_class(self, childclass, start=0, 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]) + return ''.join(('%s%s\n' % (indent * level, self.starttag()), + *(child.pformat(indent, level+1) + for child in self.children))) def copy(self): obj = self.__class__(rawsource=self.rawsource, **self.attributes) @@ -1867,8 +1867,8 @@ def pformat(self, indent=' ', level=0): else: internals.append('%7s%s: %r' % ('', key, value)) return (Element.pformat(self, indent, level) - + ''.join([(' %s%s\n' % (indent * level, line)) - for line in internals])) + + ''.join((' %s%s\n' % (indent * level, line)) + for line in internals)) def copy(self): obj = self.__class__(self.transform, self.details, self.rawsource, diff --git a/docutils/docutils/parsers/rst/directives/__init__.py b/docutils/docutils/parsers/rst/directives/__init__.py index 281e7b1b7..2c2bbe7c2 100644 --- a/docutils/docutils/parsers/rst/directives/__init__.py +++ b/docutils/docutils/parsers/rst/directives/__init__.py @@ -184,7 +184,7 @@ def path(argument): if argument is None: raise ValueError('argument required but none supplied') else: - path = ''.join([s.strip() for s in argument.splitlines()]) + path = ''.join(s.strip() for s in argument.splitlines()) return path def uri(argument): @@ -239,7 +239,7 @@ def get_measure(argument, units): except (AttributeError, ValueError): raise ValueError( 'not a positive measure of one of the following units:\n%s' - % ' '.join(['"%s"' % i for i in units])) + % ' '.join('"%s"' % i for i in units)) return match.group(1) + match.group(2) def length_or_unitless(argument): @@ -404,7 +404,7 @@ def yesno(argument): % (argument, format_values(values))) def format_values(values): - return '%s, or "%s"' % (', '.join(['"%s"' % s for s in values[:-1]]), + return '%s, or "%s"' % (', '.join('"%s"' % s for s in values[:-1]), values[-1]) def value_or(values, other): diff --git a/docutils/docutils/parsers/rst/directives/misc.py b/docutils/docutils/parsers/rst/directives/misc.py index 0c96ed93e..bfe864d5b 100644 --- a/docutils/docutils/parsers/rst/directives/misc.py +++ b/docutils/docutils/parsers/rst/directives/misc.py @@ -177,8 +177,8 @@ def run(self): (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]]))) + % (self.name, ' < '.join((path, *(pth for pth, opt + in reversed(include_log)))))) if 'parser' in self.options: # parse into a dummy document and return created nodes diff --git a/docutils/docutils/parsers/rst/states.py b/docutils/docutils/parsers/rst/states.py index cbacc6541..e5b82e3ae 100644 --- a/docutils/docutils/parsers/rst/states.py +++ b/docutils/docutils/parsers/rst/states.py @@ -1980,7 +1980,7 @@ def parse_target(self, block, block_text, lineno): - 'malformed' and a system_message node """ if block and block[-1].strip()[-1:] == '_': # possible indirect target - reference = ' '.join([line.strip() for line in block]) + reference = ' '.join(line.strip() for line in block) refname = self.is_reference(reference) if refname: return 'refname', refname diff --git a/docutils/docutils/utils/__init__.py b/docutils/docutils/utils/__init__.py index 0608ac2dd..e21cbaf27 100644 --- a/docutils/docutils/utils/__init__.py +++ b/docutils/docutils/utils/__init__.py @@ -597,7 +597,7 @@ def split_escaped_whitespace(text): return list(itertools.chain(*strings)) def strip_combining_chars(text): - return ''.join([c for c in text if not unicodedata.combining(c)]) + return ''.join(c for c in text if not unicodedata.combining(c)) def find_combining_chars(text): """Return indices of all combining chars in Unicode string `text`. diff --git a/docutils/docutils/utils/math/__init__.py b/docutils/docutils/utils/math/__init__.py index 3e18434b8..4f210a9c2 100644 --- a/docutils/docutils/utils/math/__init__.py +++ b/docutils/docutils/utils/math/__init__.py @@ -28,8 +28,8 @@ def toplevel_code(code): """Return string (LaTeX math) `code` with environments stripped out.""" chunks = code.split(r'\begin{') - return r'\begin{'.join([chunk.split(r'\end{')[-1] - for chunk in chunks]) + return r'\begin{'.join(chunk.split(r'\end{')[-1] + for chunk in chunks) def pick_math_environment(code, numbered=False): """Return the right math environment to display `code`. diff --git a/docutils/docutils/utils/math/latex2mathml.py b/docutils/docutils/utils/math/latex2mathml.py index bd5603b9f..54a8d1d6d 100644 --- a/docutils/docutils/utils/math/latex2mathml.py +++ b/docutils/docutils/utils/math/latex2mathml.py @@ -412,10 +412,10 @@ def _xml(self, level=0): + ['</%s>' % self.__class__.__name__]) def xml_starttag(self): - attrs = ['%s="%s"' % (k, str(v).replace('True', 'true').replace('False', 'false')) + attrs = ('%s="%s"' % (k, str(v).replace('True', 'true').replace('False', 'false')) for k, v in self.attributes.items() - if v is not None] - return '<%s>' % ' '.join([self.__class__.__name__] + attrs) + if v is not None) + return '<%s>' % ' '.join((self.__class__.__name__, *attrs)) def _xml_body(self, level=0): xml = [] diff --git a/docutils/docutils/utils/math/tex2mathml_extern.py b/docutils/docutils/utils/math/tex2mathml_extern.py index ff55c0e2e..f2fd95b23 100644 --- a/docutils/docutils/utils/math/tex2mathml_extern.py +++ b/docutils/docutils/utils/math/tex2mathml_extern.py @@ -90,8 +90,8 @@ def ttm(math_code, reporter=None): result = p.stdout.read() err = p.stderr.read().decode('utf8') if err.find('**** Unknown') >= 0: - msg = '\n'.join([line for line in err.splitlines() - if line.startswith('****')]) + msg = '\n'.join(line for line in err.splitlines() + if line.startswith('****')) raise SyntaxError('\nMessage from external converter TtM:\n'+ msg) if reporter and err.find('**** Error') >= 0 or not result: reporter.error(err) diff --git a/docutils/docutils/utils/smartquotes.py b/docutils/docutils/utils/smartquotes.py index f2dadb2ee..0c546c1ed 100644 --- a/docutils/docutils/utils/smartquotes.py +++ b/docutils/docutils/utils/smartquotes.py @@ -502,8 +502,8 @@ def __init__(self, language='en'): 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'): @@ -878,16 +878,6 @@ def tokenize(text): Based on the _tokenize() subroutine from Brad Choate's MTRegex plugin. <http://www.bradchoate.com/past/mtregex.php> """ - - pos = 0 - length = len(text) - # tokens = [] - - depth = 6 - nested_tags = "|".join(['(?:<(?:[^<>]',] * depth) + (')*>)' * depth) - #match = r"""(?: <! ( -- .*? -- \s* )+ > ) | # comments - # (?: <\? .*? \?> ) | # directives - # %s # nested tags """ % (nested_tags,) tag_soup = re.compile(r"""([^<]*)(<[^>]*>)""") token_match = tag_soup.search(text) @@ -926,7 +916,7 @@ def tokenize(text): # find all combinations of subtags for n in range(len(_subtags), 0, -1): for tags in itertools.combinations(_subtags, n): - _tag = '-'.join((_basetag,)+tags) + _tag = '-'.join((_basetag, *tags)) if _tag in smartchars.quotes: defaultlanguage = _tag break diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py index ab46dc0e8..aa7413b25 100644 --- a/docutils/docutils/writers/latex2e/__init__.py +++ b/docutils/docutils/writers/latex2e/__init__.py @@ -428,7 +428,7 @@ def __call__(self): self.setup = [r'\usepackage[%s]{babel}' % ','.join(languages)] # Deactivate "active characters" shorthands = [] - for c in ''.join([self.active_chars.get(l, '') for l in languages]): + for c in ''.join(self.active_chars.get(l, '') for l in languages): if c not in shorthands: shorthands.append(c) if shorthands: @@ -1565,8 +1565,8 @@ def append_hypertargets(self, node): """Append hypertargets for all ids of `node`""" # hypertarget places the anchor at the target's baseline, # so we raise it explicitly - self.out.append('%\n'.join(['\\raisebox{1em}{\\hypertarget{%s}{}}' % - id for id in node['ids']])) + self.out.append('%\n'.join('\\raisebox{1em}{\\hypertarget{%s}{}}' % + id for id in node['ids'])) def ids_to_labels(self, node, set_anchor=True, protect=False, newline=False): @@ -2156,9 +2156,9 @@ def visit_enumerated_list(self, node): if self.compound_enumerators: if (self.section_prefix_for_enumerators and self.section_level and not self._enumeration_counters): - prefix = '.'.join([str(n) for n in - self._section_number[:self.section_level]] - ) + self.section_enumerator_separator + prefix = '.'.join(str(n) for n in + self._section_number[:self.section_level] + ) + self.section_enumerator_separator if self._enumeration_counters: prefix += self._enumeration_counters[-1] prefix += node.get('prefix', '') diff --git a/docutils/docutils/writers/odf_odt/__init__.py b/docutils/docutils/writers/odf_odt/__init__.py index 74b35c4b2..3e8b5e72d 100644 --- a/docutils/docutils/writers/odf_odt/__init__.py +++ b/docutils/docutils/writers/odf_odt/__init__.py @@ -2873,9 +2873,9 @@ def visit_raw(self, node): formatlist = formats.split() if 'odt' in formatlist: rawstr = node.astext() - attrstr = ' '.join([ + attrstr = ' '.join( '%s="%s"' % (k, v, ) - for k, v in list(CONTENT_NAMESPACE_ATTRIB.items())]) + for k, v in list(CONTENT_NAMESPACE_ATTRIB.items())) contentstr = '<stuff %s>%s</stuff>' % (attrstr, rawstr, ) contentstr = contentstr.encode("utf-8") content = etree.fromstring(contentstr) diff --git a/docutils/docutils/writers/s5_html/__init__.py b/docutils/docutils/writers/s5_html/__init__.py index 6514f8af9..16dcf7c1a 100644 --- a/docutils/docutils/writers/s5_html/__init__.py +++ b/docutils/docutils/writers/s5_html/__init__.py @@ -242,7 +242,7 @@ def copy_theme(self): required.remove(f) raise docutils.ApplicationError( 'Theme files not found: %s' - % ', '.join(['%r' % f for f in required])) + % ', '.join('%r' % f for f in required)) files_to_skip_pattern = re.compile(r'~$|\.bak$|#$|\.cvsignore$') diff --git a/docutils/test/test_parsers/test_rst/test_tables.py b/docutils/test/test_parsers/test_rst/test_tables.py index 50cee7f79..be742509c 100755 --- a/docutils/test/test_parsers/test_rst/test_tables.py +++ b/docutils/test/test_parsers/test_rst/test_tables.py @@ -571,8 +571,8 @@ def suite(): | (The first cell of this table may expand | | to accommodate long filesystem paths.) | +------------------------------------------------------------------------------+ -""") % ('\n'.join(['| %-70s |' % include2[part * 70 : (part + 1) * 70] - for part in range(len(include2) // 70 + 1)])), +""") % ('\n'.join('| %-70s |' % include2[part * 70 : (part + 1) * 70] + for part in range(len(include2) // 70 + 1))), """\ <document source="test data"> <table> @@ -606,8 +606,8 @@ def suite(): Something afterwards. And more. -""") % ('\n'.join(['| %-70s |' % include2[part * 70 : (part + 1) * 70] - for part in range(len(include2) // 70 + 1)])), +""") % ('\n'.join('| %-70s |' % include2[part * 70 : (part + 1) * 70] + for part in range(len(include2) // 70 + 1))), """\ <document source="test data"> <paragraph> @@ -1274,8 +1274,8 @@ def suite(): Note The first row of this table may expand to accommodate long filesystem paths. ========= ===================================================================== -""" % ('\n'.join([' %-65s' % include2[part * 65 : (part + 1) * 65] - for part in range(len(include2) // 65 + 1)])), +""" % ('\n'.join(' %-65s' % include2[part * 65 : (part + 1) * 65] + for part in range(len(include2) // 65 + 1))), """\ <document source="test data"> <table> diff --git a/docutils/tools/dev/unicode2rstsubs.py b/docutils/tools/dev/unicode2rstsubs.py index 58a76b63b..182a44040 100755 --- a/docutils/tools/dev/unicode2rstsubs.py +++ b/docutils/tools/dev/unicode2rstsubs.py @@ -188,7 +188,7 @@ def write_entity(self, set, set_name, entity_name, outfile, longest, for code in charid[1:].split('-'): if int(code, 16) > 0xFFFF: return 1 # wide-Unicode character - codes = ' '.join(['U+%s' % code for code in charid[1:].split('-')]) + codes = ' '.join('U+%s' % code for code in charid[1:].split('-')) outfile.write('.. %-*s unicode:: %s .. %s\n' % (longest + 2, '|' + entity_name + '|', codes, self.descriptions[charid])) diff --git a/docutils/tools/quicktest.py b/docutils/tools/quicktest.py index 0ada37da7..5294cc9ce 100755 --- a/docutils/tools/quicktest.py +++ b/docutils/tools/quicktest.py @@ -128,8 +128,8 @@ def getArgs(): def posixGetArgs(argv): outputFormat = 'pretty' # convert fancy_getopt style option list to getopt.getopt() arguments - shortopts = ''.join([option[1] + ':' * (option[0][-1:] == '=') - for option in options if option[1]]) + shortopts = ''.join(option[1] + ':' * (option[0][-1:] == '=') + for option in options if option[1]) longopts = [option[0] for option in options if option[0]] try: opts, args = getopt.getopt(argv, shortopts, longopts) From 29ddd0ac424f2e46dfbe7b2fd55c5378e7710f30 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Sat, 22 Jan 2022 22:15:01 +0000 Subject: [PATCH 11/36] Use implicit string concatenation This can be constant-folded by the interpreter at compile time --- docutils/docutils/writers/latex2e/__init__.py | 22 +++++++++---------- docutils/docutils/writers/xetex/__init__.py | 12 +++++----- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py index aa7413b25..f65dabd19 100644 --- a/docutils/docutils/writers/latex2e/__init__.py +++ b/docutils/docutils/writers/latex2e/__init__.py @@ -37,10 +37,10 @@ class Writer(writers.Writer): default_template = 'default.tex' default_template_path = os.path.dirname(os.path.abspath(__file__)) - default_preamble = '\n'.join([r'% PDF Standard Fonts', - r'\usepackage{mathptmx} % Times', - r'\usepackage[scaled=.90]{helvet}', - r'\usepackage{courier}']) + default_preamble = ('% PDF Standard Fonts\n' + r'\usepackage{mathptmx} % Times' '\n' + r'\usepackage[scaled=.90]{helvet}' '\n' + r'\usepackage{courier}') table_style_values = [# TODO: align-left, align-center, align-right, ?? 'booktabs', 'borderless', 'colwidths-auto', 'nolines', 'standard'] @@ -1399,9 +1399,9 @@ def stylesheet_call(self, path): self.document.reporter.error(msg) return '% ' + msg.replace('\n', '\n% ') if is_package: - content = '\n'.join([r'\makeatletter', - content, - r'\makeatother']) + content = (r'\makeatletter' '\n' + + content + '\n' + r'\makeatother') return '%% embedded stylesheet: %s\n%s' % (path, content) # Link to style file: if is_package: @@ -2561,10 +2561,10 @@ def visit_literal_block(self, node): if _in_table and _use_env and not _autowidth_table: # Wrap in minipage to prevent extra vertical space # with alltt and verbatim-like environments: - self.fallbacks['ttem'] = '\n'.join(['', - r'% character width in monospaced font', - r'\newlength{\ttemwidth}', - r'\settowidth{\ttemwidth}{\ttfamily M}']) + self.fallbacks['ttem'] = ( + '\n% character width in monospaced font\n' + r'\newlength{\ttemwidth}' '\n' + r'\settowidth{\ttemwidth}{\ttfamily M}') self.out.append('\\begin{minipage}{%d\\ttemwidth}\n' % (max(len(line) for line in node.astext().split('\n')))) self.context.append('\n\\end{minipage}\n') diff --git a/docutils/docutils/writers/xetex/__init__.py b/docutils/docutils/writers/xetex/__init__.py index a1e68f0ac..dab643b77 100644 --- a/docutils/docutils/writers/xetex/__init__.py +++ b/docutils/docutils/writers/xetex/__init__.py @@ -37,12 +37,12 @@ class Writer(latex2e.Writer): """Formats this writer supports.""" default_template = 'xelatex.tex' - default_preamble = '\n'.join([ - r'% Linux Libertine (free, wide coverage, not only for Linux)', - r'\setmainfont{Linux Libertine O}', - r'\setsansfont{Linux Biolinum O}', - r'\setmonofont[HyphenChar=None,Scale=MatchLowercase]{DejaVu Sans Mono}', - ]) + default_preamble = ( + '% Linux Libertine (free, wide coverage, not only for Linux)\n' + r'\setmainfont{Linux Libertine O}' '\n' + r'\setsansfont{Linux Biolinum O}' '\n' + r'\setmonofont[HyphenChar=None,Scale=MatchLowercase]{DejaVu Sans Mono}' + ) config_section = 'xetex writer' config_section_dependencies = ('writers', 'latex writers', From e318c22212f114b97d44ed2d8fef5f82e457c551 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Sat, 22 Jan 2022 21:36:33 +0000 Subject: [PATCH 12/36] Remove outdated default description for ``FileInput.__init__`` --- docutils/docutils/io.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docutils/docutils/io.py b/docutils/docutils/io.py index c3ba3a9ac..e605053d6 100644 --- a/docutils/docutils/io.py +++ b/docutils/docutils/io.py @@ -321,8 +321,7 @@ def __init__(self, source=None, source_path=None, - `autoclose`: close automatically after read (except when `sys.stdin` is the source). - `mode`: how the file is to be opened (see standard function - `open`). The default 'rU' provides universal newline support - for text files with Python 2.x. + `open`). The default is read only ('r'). """ Input.__init__(self, source, source_path, encoding, error_handler) self.autoclose = autoclose From 63ab81114b5af052160b25a87c0804f601b9d9a9 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Sat, 22 Jan 2022 21:44:38 +0000 Subject: [PATCH 13/36] "u" prefix isn't used by repr in Python 3 --- docutils/test/DocutilsTestSupport.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docutils/test/DocutilsTestSupport.py b/docutils/test/DocutilsTestSupport.py index ff8106956..babd42c6e 100644 --- a/docutils/test/DocutilsTestSupport.py +++ b/docutils/test/DocutilsTestSupport.py @@ -841,13 +841,9 @@ def _format_str(*args): return_tuple = [] for i in args: r = repr(i) - if ( (isinstance(i, bytes) or isinstance(i, str)) - and '\n' in i): + if isinstance(i, (str, bytes)) and '\n' in i: stripped = '' - if isinstance(i, str) and r.startswith('u'): - stripped = r[0] - r = r[1:] - elif isinstance(i, bytes) and r.startswith('b'): + if isinstance(i, bytes) and r.startswith('b'): stripped = r[0] r = r[1:] # quote_char = "'" or '"' From e22828d70036cb340dd271010a4aa75c50c00a15 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Sat, 22 Jan 2022 21:48:02 +0000 Subject: [PATCH 14/36] Update generate_punctuation_chars to not generate the 'u' prefix --- docutils/tools/dev/generate_punctuation_chars.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docutils/tools/dev/generate_punctuation_chars.py b/docutils/tools/dev/generate_punctuation_chars.py index 90dc02d7f..db913ae1b 100644 --- a/docutils/tools/dev/generate_punctuation_chars.py +++ b/docutils/tools/dev/generate_punctuation_chars.py @@ -280,7 +280,7 @@ def wrap_string(s, startstring= "('", endstring = "')", wrap=67): """Line-wrap a unicode string literal definition.""" c = len(startstring) - contstring = "'\n" + ' ' * (len(startstring)-2) + "u'" + contstring = "'\n" + ' ' * (len(startstring)-2) + "'" l = [startstring] for ch in s.replace("'", r"\'"): c += 1 From 9ebe8bf406656f6de456b579b804908815bc533f Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Sat, 22 Jan 2022 22:33:09 +0000 Subject: [PATCH 15/36] IOError is an alias to OSError https://docs.python.org/3/library/exceptions.html#OSError --- docutils/docutils/core.py | 2 +- docutils/docutils/frontend.py | 4 ++-- docutils/docutils/io.py | 8 ++++---- docutils/docutils/parsers/rst/directives/images.py | 2 +- docutils/docutils/parsers/rst/directives/misc.py | 6 +++--- docutils/docutils/parsers/rst/directives/tables.py | 4 ++-- docutils/docutils/utils/error_reporting.py | 2 +- docutils/docutils/writers/_html_base.py | 6 +++--- docutils/docutils/writers/html4css1/__init__.py | 2 +- docutils/docutils/writers/latex2e/__init__.py | 4 ++-- docutils/test/test_error_reporting.py | 10 +++++----- docutils/test/test_publisher.py | 8 ++++---- 12 files changed, 29 insertions(+), 29 deletions(-) diff --git a/docutils/docutils/core.py b/docutils/docutils/core.py index 93b368c9c..36f885b00 100644 --- a/docutils/docutils/core.py +++ b/docutils/docutils/core.py @@ -165,7 +165,7 @@ def set_source(self, source=None, source_path=None): source_path = self.settings._source else: self.settings._source = source_path - # Raise IOError instead of system exit with `tracback == True` + # Raise OSError instead of system exit with `tracback == True` # TODO: change io.FileInput's default behaviour and remove this hack try: self.source = self.source_class( diff --git a/docutils/docutils/frontend.py b/docutils/docutils/frontend.py index 524de4834..0776e4ce4 100644 --- a/docutils/docutils/frontend.py +++ b/docutils/docutils/frontend.py @@ -189,7 +189,7 @@ def validate_dependency_file(setting, value, option_parser, config_parser=None, config_section=None): try: return docutils.utils.DependencyList(value) - except IOError: + except OSError: return docutils.utils.DependencyList(None) def validate_strip_class(setting, value, option_parser, @@ -780,7 +780,7 @@ def read(self, filenames, option_parser): self._stderr.write(self.not_utf8_error % (filename, filename)) continue - except IOError: + except OSError: continue self._files.append(filename) if self.has_section('options'): diff --git a/docutils/docutils/io.py b/docutils/docutils/io.py index e605053d6..1fd3793ad 100644 --- a/docutils/docutils/io.py +++ b/docutils/docutils/io.py @@ -39,8 +39,8 @@ locale_encoding = None -class InputError(IOError): pass -class OutputError(IOError): pass +class InputError(OSError): pass +class OutputError(OSError): pass def check_encoding(stream, encoding): @@ -333,7 +333,7 @@ def __init__(self, source=None, source_path=None, self.source = open(source_path, mode, encoding=self.encoding, errors=self.error_handler) - except IOError as error: + except OSError as error: raise InputError(error.errno, error.strerror, source_path) else: self.source = sys.stdin @@ -454,7 +454,7 @@ def open(self): kwargs = {} try: self.destination = open(self.destination_path, self.mode, **kwargs) - except IOError as error: + except OSError as error: raise OutputError(error.errno, error.strerror, self.destination_path) self.opened = True diff --git a/docutils/docutils/parsers/rst/directives/images.py b/docutils/docutils/parsers/rst/directives/images.py index 8c250ce3c..d04323475 100644 --- a/docutils/docutils/parsers/rst/directives/images.py +++ b/docutils/docutils/parsers/rst/directives/images.py @@ -131,7 +131,7 @@ def run(self): try: with PIL.Image.open(imagepath) as img: figure_node['width'] = '%dpx' % img.size[0] - except (IOError, UnicodeEncodeError): + except (OSError, UnicodeEncodeError): pass # TODO: warn? else: self.state.document.settings.record_dependencies.add( diff --git a/docutils/docutils/parsers/rst/directives/misc.py b/docutils/docutils/parsers/rst/directives/misc.py index bfe864d5b..b7055cc8f 100644 --- a/docutils/docutils/parsers/rst/directives/misc.py +++ b/docutils/docutils/parsers/rst/directives/misc.py @@ -80,7 +80,7 @@ def run(self): 'Cannot encode input file path "%s" ' '(wrong locale?).' % (self.name, path)) - except IOError as error: + except OSError as error: raise self.severe('Problems with "%s" directive path:\n%s.' % (self.name, io.error_string(error))) @@ -251,7 +251,7 @@ def run(self): # TODO: currently, raw input files are recorded as # dependencies even if not used for the chosen output format. self.state.document.settings.record_dependencies.add(path) - except IOError as error: + except OSError as error: raise self.severe('Problems with "%s" directive path:\n%s.' % (self.name, io.error_string(error))) try: @@ -269,7 +269,7 @@ def run(self): from urllib.error import URLError try: raw_text = urlopen(source).read() - except (URLError, IOError, OSError) as error: + 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))) raw_file = io.StringInput(source=raw_text, source_path=source, diff --git a/docutils/docutils/parsers/rst/directives/tables.py b/docutils/docutils/parsers/rst/directives/tables.py index c817fd707..dac1a54b2 100644 --- a/docutils/docutils/parsers/rst/directives/tables.py +++ b/docutils/docutils/parsers/rst/directives/tables.py @@ -320,7 +320,7 @@ def get_csv_data(self): encoding=encoding, error_handler=error_handler) csv_data = csv_file.read().splitlines() - except IOError as error: + except OSError as error: severe = self.state_machine.reporter.severe( 'Problems with "%s" directive path:\n%s.' % (self.name, error), @@ -338,7 +338,7 @@ def get_csv_data(self): source = self.options['url'] try: csv_text = urlopen(source).read() - except (URLError, IOError, OSError, ValueError) as error: + except (URLError, OSError, ValueError) as error: severe = self.state_machine.reporter.severe( 'Problems with "%s" directive URL "%s":\n%s.' % (self.name, self.options['url'], error), diff --git a/docutils/docutils/utils/error_reporting.py b/docutils/docutils/utils/error_reporting.py index a5c873db4..88fe3c042 100644 --- a/docutils/docutils/utils/error_reporting.py +++ b/docutils/docutils/utils/error_reporting.py @@ -36,7 +36,7 @@ * In Python 2, unicode(<exception instance>) fails, with non-ASCII chars in arguments. (Use case: in some locales, the errstr - argument of IOError contains non-ASCII chars.) + argument of OSError contains non-ASCII chars.) * In Python 2, str(<exception instance>) fails, with non-ASCII chars in `unicode` arguments. diff --git a/docutils/docutils/writers/_html_base.py b/docutils/docutils/writers/_html_base.py index fff6e5ec3..38665514a 100644 --- a/docutils/docutils/writers/_html_base.py +++ b/docutils/docutils/writers/_html_base.py @@ -393,7 +393,7 @@ def stylesheet_call(self, path, adjust_path=None): content = docutils.io.FileInput(source_path=path, encoding='utf-8').read() self.settings.record_dependencies.add(path) - except IOError as err: + except OSError as err: msg = f'Cannot embed stylesheet: {err}' self.document.reporter.error(msg) return '<--- %s --->\n' % msg @@ -1002,7 +1002,7 @@ def visit_image(self, node): try: with PIL.Image.open(imagepath) as img: imgsize = img.size - except (IOError, UnicodeEncodeError): + except (OSError, UnicodeEncodeError): pass # TODO: warn? else: self.settings.record_dependencies.add( @@ -1048,7 +1048,7 @@ def visit_image(self, node): try: with open(url2pathname(uri), 'rb') as imagefile: imagedata = imagefile.read() - except IOError as err: + except OSError as err: err_msg = err.strerror if err_msg: self.document.reporter.error('Cannot embed image %r: %s' diff --git a/docutils/docutils/writers/html4css1/__init__.py b/docutils/docutils/writers/html4css1/__init__.py index 3720789c0..235b275bd 100644 --- a/docutils/docutils/writers/html4css1/__init__.py +++ b/docutils/docutils/writers/html4css1/__init__.py @@ -566,7 +566,7 @@ def visit_image(self, node): try: with PIL.Image.open(imagepath) as img: img_size = img.size - except (IOError, UnicodeEncodeError): + except (OSError, UnicodeEncodeError): pass # TODO: warn? else: self.settings.record_dependencies.add( diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py index f65dabd19..c1d49ba9a 100644 --- a/docutils/docutils/writers/latex2e/__init__.py +++ b/docutils/docutils/writers/latex2e/__init__.py @@ -274,7 +274,7 @@ def translate(self): try: with open(templatepath, encoding='utf8') as fp: template = fp.read() - except IOError: + except OSError: templatepath = os.path.join(self.default_template_path, templatepath) with open(templatepath, encoding= 'utf8') as fp: @@ -1394,7 +1394,7 @@ def stylesheet_call(self, path): content = docutils.io.FileInput(source_path=path, encoding='utf-8').read() self.settings.record_dependencies.add(path) - except IOError as err: + except OSError as err: msg = f'Cannot embed stylesheet:\n {err}' self.document.reporter.error(msg) return '% ' + msg.replace('\n', '\n% ') diff --git a/docutils/test/test_error_reporting.py b/docutils/test/test_error_reporting.py index 7b73d49b2..271a4b6a5 100644 --- a/docutils/test/test_error_reporting.py +++ b/docutils/test/test_error_reporting.py @@ -6,7 +6,7 @@ """ Test `EnvironmentError` reporting. -In some locales, the `errstr` argument of IOError and OSError contains +In some locales, the `errstr` argument of OSError contains non-ASCII chars. In Python 2, converting an exception instance to `str` or `unicode` @@ -18,7 +18,7 @@ try: something - except IOError as error: + except OSError as error: print('Found %s' % error) unless the minimal required Python version has this problem fixed. @@ -172,16 +172,16 @@ class SafeStringTests_locale(unittest.TestCase): us = '\xfc' try: open(b'\xc3\xbc') - except IOError as e: # in Python 3 the name for the exception instance + except OSError as e: # in Python 3 the name for the exception instance bioe = e # is local to the except clause try: open('\xfc') - except IOError as e: + except OSError as e: uioe = e except UnicodeEncodeError: try: open('\xfc'.encode(sys.getfilesystemencoding(), 'replace')) - except IOError as e: + except OSError as e: uioe = e try: os.chdir(b'\xc3\xbc') diff --git a/docutils/test/test_publisher.py b/docutils/test/test_publisher.py index 1180e6c68..dca54bf37 100755 --- a/docutils/test/test_publisher.py +++ b/docutils/test/test_publisher.py @@ -64,20 +64,20 @@ def test_input_error_handling(self): # core.publish_cmdline(argv=['nonexisting/path']) # exits with a short message, if `traceback` is False, - # pass IOErrors to calling application if `traceback` is True + # pass OSErrors to calling application if `traceback` is True try: core.publish_cmdline(argv=['nonexisting/path'], settings_overrides={'traceback': True}) - except IOError as e: + except OSError as e: self.assertTrue(isinstance(e, io.InputError)) def test_output_error_handling(self): - # pass IOErrors to calling application if `traceback` is True + # pass OSErrors to calling application if `traceback` is True try: core.publish_cmdline(argv=['data/include.txt', 'nonexisting/path'], settings_overrides={'traceback': True}) - except IOError as e: + except OSError as e: self.assertTrue(isinstance(e, io.OutputError)) From f9e92107c1ad8bb03fe8a55d3dc3fc92ea764ebd Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Sat, 22 Jan 2022 22:34:32 +0000 Subject: [PATCH 16/36] EnvironmentError is an alias to OSError https://docs.python.org/3/library/exceptions.html#OSError --- docutils/docutils/utils/error_reporting.py | 4 ++-- docutils/test/test_error_reporting.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docutils/docutils/utils/error_reporting.py b/docutils/docutils/utils/error_reporting.py index 88fe3c042..22e6f7fa6 100644 --- a/docutils/docutils/utils/error_reporting.py +++ b/docutils/docutils/utils/error_reporting.py @@ -130,11 +130,11 @@ def __unicode__(self): """ try: u = unicode(self.data) - if isinstance(self.data, EnvironmentError): + if isinstance(self.data, OSError): u = u.replace(": '", ": '") # normalize filename quoting return u except UnicodeError as error: # catch ..Encode.. and ..Decode.. errors - if isinstance(self.data, EnvironmentError): + if isinstance(self.data, OSError): return "[Errno %s] %s: '%s'" % (self.data.errno, SafeString(self.data.strerror, self.encoding, self.decoding_errors), diff --git a/docutils/test/test_error_reporting.py b/docutils/test/test_error_reporting.py index 271a4b6a5..2e9c3a666 100644 --- a/docutils/test/test_error_reporting.py +++ b/docutils/test/test_error_reporting.py @@ -4,7 +4,7 @@ # Copyright: This module has been placed in the public domain. """ -Test `EnvironmentError` reporting. +Test `OSError` reporting. In some locales, the `errstr` argument of OSError contains non-ASCII chars. @@ -164,7 +164,7 @@ class SafeStringTests_locale(unittest.TestCase): """ Test docutils.SafeString with 'problematic' locales. - The error message in `EnvironmentError` instances comes from the OS + The error message in `OSError` instances comes from the OS and in some locales (e.g. ru_RU), contains high bit chars. """ # test data: From 7030e236330cf053b754a6b73350b975695463fb Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Sun, 23 Jan 2022 00:59:11 +0000 Subject: [PATCH 17/36] New style classes --- docutils/docutils/__init__.py | 2 +- docutils/docutils/core.py | 2 +- docutils/docutils/io.py | 2 +- docutils/docutils/languages/__init__.py | 2 +- docutils/docutils/nodes.py | 26 ++++++------ docutils/docutils/parsers/rst/__init__.py | 2 +- .../docutils/parsers/rst/directives/images.py | 2 +- docutils/docutils/parsers/rst/roles.py | 4 +- docutils/docutils/parsers/rst/states.py | 4 +- docutils/docutils/parsers/rst/tableparser.py | 2 +- docutils/docutils/statemachine.py | 8 ++-- docutils/docutils/transforms/__init__.py | 2 +- docutils/docutils/utils/__init__.py | 4 +- docutils/docutils/utils/code_analyzer.py | 4 +- docutils/docutils/utils/error_reporting.py | 4 +- docutils/docutils/utils/math/latex2mathml.py | 2 +- docutils/docutils/utils/math/math2html.py | 42 +++++++++---------- docutils/docutils/utils/smartquotes.py | 2 +- docutils/docutils/writers/latex2e/__init__.py | 10 ++--- docutils/docutils/writers/manpage.py | 4 +- docutils/docutils/writers/odf_odt/__init__.py | 4 +- docutils/test/DocutilsTestSupport.py | 2 +- docutils/test/alltests.py | 2 +- docutils/test/test_statemachine.py | 2 +- docutils/tools/buildhtml.py | 4 +- docutils/tools/dev/create_unimap.py | 2 +- docutils/tools/dev/unicode2rstsubs.py | 2 +- 27 files changed, 74 insertions(+), 74 deletions(-) diff --git a/docutils/docutils/__init__.py b/docutils/docutils/__init__.py index 210c722ee..e9a177374 100644 --- a/docutils/docutils/__init__.py +++ b/docutils/docutils/__init__.py @@ -132,7 +132,7 @@ class ApplicationError(Exception): pass class DataError(ApplicationError): pass -class SettingsSpec(object): +class SettingsSpec: """ Runtime setting specification base class. diff --git a/docutils/docutils/core.py b/docutils/docutils/core.py index 36f885b00..b3c4ba28b 100644 --- a/docutils/docutils/core.py +++ b/docutils/docutils/core.py @@ -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. diff --git a/docutils/docutils/io.py b/docutils/docutils/io.py index 1fd3793ad..7fcb70138 100644 --- a/docutils/docutils/io.py +++ b/docutils/docutils/io.py @@ -223,7 +223,7 @@ def encode(self, data): 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 diff --git a/docutils/docutils/languages/__init__.py b/docutils/docutils/languages/__init__.py index c556f7e88..2c6cfb40d 100644 --- a/docutils/docutils/languages/__init__.py +++ b/docutils/docutils/languages/__init__.py @@ -17,7 +17,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 diff --git a/docutils/docutils/nodes.py b/docutils/docutils/nodes.py index dfdb3ba47..125861e11 100644 --- a/docutils/docutils/nodes.py +++ b/docutils/docutils/nodes.py @@ -38,7 +38,7 @@ # Functional Node Base Classes # ============================== -class Node(object): +class Node: """Abstract base class of nodes in a document tree.""" parent = None @@ -1151,12 +1151,12 @@ def __init__(self, rawsource='', text='', *children, **attributes): # Mixins # ======== -class Resolvable(object): +class Resolvable: resolved = 0 -class BackLinkable(object): +class BackLinkable: def add_backref(self, refid): self['backrefs'].append(refid) @@ -1166,19 +1166,19 @@ def add_backref(self, refid): # 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 @@ -1186,11 +1186,11 @@ class Decorative(PreBibliographic): pass -class Structural(object): +class Structural: pass -class Body(object): +class Body: pass @@ -1213,11 +1213,11 @@ class Invisible(PreBibliographic): """Internal elements that don't appear in output.""" -class Part(object): +class Part: pass -class Inline(object): +class Inline: pass @@ -1234,7 +1234,7 @@ class Targetable(Resolvable): Required for MoinMoin/reST compatibility.""" -class Labeled(object): +class Labeled: """Contains a `label` as its first element.""" @@ -1953,7 +1953,7 @@ class generated(Inline, TextElement): pass """A list of names of all concrete Node subclasses.""" -class NodeVisitor(object): +class NodeVisitor: """ "Visitor" pattern [GoF95]_ abstract superclass implementation for diff --git a/docutils/docutils/parsers/rst/__init__.py b/docutils/docutils/parsers/rst/__init__.py index 6afb42b58..1da73ff60 100644 --- a/docutils/docutils/parsers/rst/__init__.py +++ b/docutils/docutils/parsers/rst/__init__.py @@ -205,7 +205,7 @@ def __init__(self, level, message): self.msg = message -class Directive(object): +class Directive: """ Base class for reStructuredText directives. diff --git a/docutils/docutils/parsers/rst/directives/images.py b/docutils/docutils/parsers/rst/directives/images.py index d04323475..75d34893a 100644 --- a/docutils/docutils/parsers/rst/directives/images.py +++ b/docutils/docutils/parsers/rst/directives/images.py @@ -16,7 +16,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 diff --git a/docutils/docutils/parsers/rst/roles.py b/docutils/docutils/parsers/rst/roles.py index 95fd09d4f..6fcbb2557 100644 --- a/docutils/docutils/parsers/rst/roles.py +++ b/docutils/docutils/parsers/rst/roles.py @@ -190,7 +190,7 @@ def register_generic_role(canonical_name, node_class): register_canonical_role(canonical_name, role) -class GenericRole(object): +class GenericRole: """ Generic interpreted text role. @@ -207,7 +207,7 @@ def __call__(self, role, rawtext, text, lineno, inliner, 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): diff --git a/docutils/docutils/parsers/rst/states.py b/docutils/docutils/parsers/rst/states.py index e5b82e3ae..e041b7931 100644 --- a/docutils/docutils/parsers/rst/states.py +++ b/docutils/docutils/parsers/rst/states.py @@ -126,7 +126,7 @@ class ParserError(ApplicationError): pass class MarkupMismatch(Exception): pass -class Struct(object): +class Struct: """Stores data attributes for dotted-attribute access.""" @@ -459,7 +459,7 @@ def build_regexp(definition, compile=True): return regexp -class Inliner(object): +class Inliner: """ Parse inline markup; call the `parse()` method. diff --git a/docutils/docutils/parsers/rst/tableparser.py b/docutils/docutils/parsers/rst/tableparser.py index ba54766eb..baaeaeb81 100644 --- a/docutils/docutils/parsers/rst/tableparser.py +++ b/docutils/docutils/parsers/rst/tableparser.py @@ -40,7 +40,7 @@ def __init__(self, *args, **kwargs): DataError.__init__(self, *args) -class TableParser(object): +class TableParser: """ Abstract superclass for the common parts of the syntax-specific parsers. diff --git a/docutils/docutils/statemachine.py b/docutils/docutils/statemachine.py index b250f7e79..7b0cb2815 100644 --- a/docutils/docutils/statemachine.py +++ b/docutils/docutils/statemachine.py @@ -113,7 +113,7 @@ def atransition(self, match, context, next_state): from docutils import io, utils -class StateMachine(object): +class StateMachine: """ A finite state machine for text filters using regular expressions. @@ -504,7 +504,7 @@ def notify_observers(self): observer(*info) -class State(object): +class State: """ State superclass. Contains a list of transitions, and transition methods. @@ -1020,7 +1020,7 @@ def first_known_indent(self, match, context, next_state): return context, next_state, results -class _SearchOverride(object): +class _SearchOverride: """ Mix-in class to override `StateMachine` regular expression behavior. @@ -1053,7 +1053,7 @@ class SearchStateMachineWS(_SearchOverride, StateMachineWS): pass -class ViewList(object): +class ViewList: """ List with extended functionality: slices of ViewList objects are child diff --git a/docutils/docutils/transforms/__init__.py b/docutils/docutils/transforms/__init__.py index 32c9a840d..5bded1035 100644 --- a/docutils/docutils/transforms/__init__.py +++ b/docutils/docutils/transforms/__init__.py @@ -30,7 +30,7 @@ class TransformError(ApplicationError): pass -class Transform(object): +class Transform: """ Docutils transform component abstract base class. diff --git a/docutils/docutils/utils/__init__.py b/docutils/docutils/utils/__init__.py index e21cbaf27..a756d0033 100644 --- a/docutils/docutils/utils/__init__.py +++ b/docutils/docutils/utils/__init__.py @@ -30,7 +30,7 @@ def __init__(self, system_message, level): class SystemMessagePropagation(ApplicationError): pass -class Reporter(object): +class Reporter: """ Info/warning/error reporter and ``system_message`` element generator. @@ -679,7 +679,7 @@ def normalize_language_tag(tag): return taglist -class DependencyList(object): +class DependencyList: """ List of dependencies, with file recording support. diff --git a/docutils/docutils/utils/code_analyzer.py b/docutils/docutils/utils/code_analyzer.py index 6a003821b..02619e114 100644 --- a/docutils/docutils/utils/code_analyzer.py +++ b/docutils/docutils/utils/code_analyzer.py @@ -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 @@ def __iter__(self): yield (classes, value) -class NumberLines(object): +class NumberLines: """Insert linenumber-tokens at the start of every code line. Arguments diff --git a/docutils/docutils/utils/error_reporting.py b/docutils/docutils/utils/error_reporting.py index 22e6f7fa6..eb2b37777 100644 --- a/docutils/docutils/utils/error_reporting.py +++ b/docutils/docutils/utils/error_reporting.py @@ -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 @@ def __unicode__(self): 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 diff --git a/docutils/docutils/utils/math/latex2mathml.py b/docutils/docutils/utils/math/latex2mathml.py index 54a8d1d6d..ab136be27 100644 --- a/docutils/docutils/utils/math/latex2mathml.py +++ b/docutils/docutils/utils/math/latex2mathml.py @@ -306,7 +306,7 @@ # MathML element classes # ---------------------- -class math(object): +class math: """Base class for MathML elements and root of MathML trees.""" nchildren = None diff --git a/docutils/docutils/utils/math/math2html.py b/docutils/docutils/utils/math/math2html.py index 122818018..e211e1f36 100755 --- a/docutils/docutils/utils/math/math2html.py +++ b/docutils/docutils/utils/math/math2html.py @@ -32,7 +32,7 @@ __version__ = '1.3 (2021-06-02)' -class Trace(object): +class Trace: "A tracing class" debugmode = False @@ -78,7 +78,7 @@ def show(cls, message, channel): show = classmethod(show) -class ContainerConfig(object): +class ContainerConfig: "Configuration class from elyxer.config file" extracttext = { @@ -104,7 +104,7 @@ class ContainerConfig(object): } -class EscapeConfig(object): +class EscapeConfig: "Configuration class from elyxer.config file" chars = { @@ -120,7 +120,7 @@ class EscapeConfig(object): } -class FormulaConfig(object): +class FormulaConfig: "Configuration class from elyxer.config file" alphacommands = { @@ -545,7 +545,7 @@ class FormulaConfig(object): } -class CommandLineParser(object): +class CommandLineParser: "A parser for runtime options" def __init__(self, options): @@ -613,7 +613,7 @@ def readequalskey(self, arg, args): return key -class Options(object): +class Options: "A set of runtime options" location = None @@ -671,7 +671,7 @@ def showversion(self): sys.exit() -class Cloner(object): +class Cloner: "An object used to clone other objects." def clone(cls, original): @@ -688,7 +688,7 @@ def create(cls, type): 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 @@ def safeclone(self, container): return clone -class Parser(object): +class Parser: "A generic parser" def __init__(self): @@ -865,7 +865,7 @@ def parse(self, reader): -class ContainerOutput(object): +class ContainerOutput: "The generic HTML output for a container." def gethtml(self, container): @@ -1010,7 +1010,7 @@ def gethtml(self, container): 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 @@ def nextending(self): return None return nextending.ending -class EndingList(object): +class EndingList: "A list of position endings" def __init__(self): @@ -1192,7 +1192,7 @@ def __str__(self): return string + ']' -class PositionEnding(object): +class PositionEnding: "An ending for a parsing position" def __init__(self, ending, optional): @@ -1303,7 +1303,7 @@ def extract(self, length): 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 @@ -1509,7 +1509,7 @@ def __str__(self): return 'Constant: ' + self.string -class DocumentParameters(object): +class DocumentParameters: "Global parameters for the document." displaymode = False @@ -1875,7 +1875,7 @@ def clone(self): return bracket -class MathsProcessor(object): +class MathsProcessor: "A processor for a maths construction inside the FormulaProcessor." def process(self, contents, index): @@ -1887,7 +1887,7 @@ def __str__(self): return 'Maths processor ' + self.__class__.__name__ -class FormulaProcessor(object): +class FormulaProcessor: "A processor specifically for formulas." processors = [] @@ -2032,7 +2032,7 @@ def parsebit(self, pos): 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 @@ -2353,7 +2353,7 @@ def process(self): TextFunction, SpacedCommand] -class BigBracket(object): +class BigBracket: "A big bracket generator." def __init__(self, size, bracket, alignment='l'): @@ -2868,7 +2868,7 @@ def resize(self, command, size): -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}." @@ -3086,7 +3086,7 @@ def computehybridsize(self): element.size = self.size -class HybridSize(object): +class HybridSize: "The size associated with a hybrid function." configsizes = FormulaConfig.hybridsizes diff --git a/docutils/docutils/utils/smartquotes.py b/docutils/docutils/utils/smartquotes.py index 0c546c1ed..1ec51c983 100644 --- a/docutils/docutils/utils/smartquotes.py +++ b/docutils/docutils/utils/smartquotes.py @@ -381,7 +381,7 @@ import re, sys -class smartchars(object): +class smartchars: """Smart quotes and dashes """ diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py index c1d49ba9a..83eb6d68b 100644 --- a/docutils/docutils/writers/latex2e/__init__.py +++ b/docutils/docutils/writers/latex2e/__init__.py @@ -297,7 +297,7 @@ def assemble_parts(self): self.parts[part] = ''.join(lines) -class Babel(object): +class Babel: """Language specifics for LaTeX.""" # TeX (babel) language names: @@ -498,7 +498,7 @@ def sortedvalues(self): # \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 @@ -609,7 +609,7 @@ def _read_block(fp): # ------------------- # :: -class CharMaps(object): +class CharMaps: """LaTeX representations for active and Unicode characters.""" # characters that need escaping even in `alltt` environments: @@ -784,7 +784,7 @@ class CharMaps(object): # and unimap.py from TeXML -class DocumentClass(object): +class DocumentClass: """Details of a LaTeX document class.""" def __init__(self, document_class, with_part=False): @@ -825,7 +825,7 @@ def latex_section_depth(self, depth): return depth -class Table(object): +class Table: """Manage a table while traversing. Table style might be diff --git a/docutils/docutils/writers/manpage.py b/docutils/docutils/writers/manpage.py index cb02ee9c3..f4d9f8564 100644 --- a/docutils/docutils/writers/manpage.py +++ b/docutils/docutils/writers/manpage.py @@ -108,7 +108,7 @@ def translate(self): self.output = visitor.astext() -class Table(object): +class Table: def __init__(self): self._rows = [] self._options = ['center'] @@ -303,7 +303,7 @@ def depart_Text(self, node): pass def list_start(self, node): - class EnumChar(object): + class EnumChar: enum_style = { 'bullet': '\\(bu', 'emdash': '\\(em', diff --git a/docutils/docutils/writers/odf_odt/__init__.py b/docutils/docutils/writers/odf_odt/__init__.py index 3e8b5e72d..61eab6f1b 100644 --- a/docutils/docutils/writers/odf_odt/__init__.py +++ b/docutils/docutils/writers/odf_odt/__init__.py @@ -307,7 +307,7 @@ def escape_cdata(text): # -class TableStyle(object): +class TableStyle: def __init__(self, border=None, backgroundcolor=None): self.border = border self.backgroundcolor = backgroundcolor @@ -335,7 +335,7 @@ def set_backgroundcolor_(self, backgroundcolor): # # 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 diff --git a/docutils/test/DocutilsTestSupport.py b/docutils/test/DocutilsTestSupport.py index babd42c6e..b663a53aa 100644 --- a/docutils/test/DocutilsTestSupport.py +++ b/docutils/test/DocutilsTestSupport.py @@ -87,7 +87,7 @@ StringList.__repr__ = StringList.__str__ -class DevNull(object): +class DevNull: """Output sink.""" diff --git a/docutils/test/alltests.py b/docutils/test/alltests.py index 16973c827..107154531 100755 --- a/docutils/test/alltests.py +++ b/docutils/test/alltests.py @@ -25,7 +25,7 @@ import docutils -class Tee(object): +class Tee: """Write to a file and a stream (default: stdout) simultaneously.""" diff --git a/docutils/test/test_statemachine.py b/docutils/test/test_statemachine.py index 92ea197f1..8c498d4dc 100755 --- a/docutils/test/test_statemachine.py +++ b/docutils/test/test_statemachine.py @@ -203,7 +203,7 @@ def test_run(self): self.assertEqual(self.sm.run(testtext), expected) -class EmptyClass(object): +class EmptyClass: pass diff --git a/docutils/tools/buildhtml.py b/docutils/tools/buildhtml.py index 640092fa2..32f6031e5 100755 --- a/docutils/tools/buildhtml.py +++ b/docutils/tools/buildhtml.py @@ -119,7 +119,7 @@ def check_args(self, args): return source, destination -class Struct(object): +class Struct: """Stores data attributes for dotted-attribute access.""" @@ -127,7 +127,7 @@ def __init__(self, **keywordargs): self.__dict__.update(keywordargs) -class Builder(object): +class Builder: def __init__(self): self.publishers = { diff --git a/docutils/tools/dev/create_unimap.py b/docutils/tools/dev/create_unimap.py index 76b1cbc2f..e5083e906 100755 --- a/docutils/tools/dev/create_unimap.py +++ b/docutils/tools/dev/create_unimap.py @@ -18,7 +18,7 @@ math_map = {} -class Visitor(object): +class Visitor: """Node visitor for contents of unicode.xml.""" def visit_character(self, node): diff --git a/docutils/tools/dev/unicode2rstsubs.py b/docutils/tools/dev/unicode2rstsubs.py index 182a44040..839ed870d 100755 --- a/docutils/tools/dev/unicode2rstsubs.py +++ b/docutils/tools/dev/unicode2rstsubs.py @@ -54,7 +54,7 @@ def process(infile): grouper.write_sets() -class CharacterEntitySetExtractor(object): +class CharacterEntitySetExtractor: """ Extracts character entity information from unicode.xml file, groups it by From ce6e39416a504715203b8bdbec2c840baebe2b5f Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Sun, 23 Jan 2022 01:04:19 +0000 Subject: [PATCH 18/36] Zero-argument ``super()`` --- docutils/docutils/__init__.py | 4 ++-- docutils/docutils/transforms/writer_aux.py | 2 +- docutils/docutils/utils/error_reporting.py | 4 ++-- docutils/docutils/utils/math/latex2mathml.py | 6 +++--- docutils/docutils/writers/html5_polyglot/__init__.py | 5 ++--- docutils/docutils/writers/latex2e/__init__.py | 2 +- docutils/test/test_error_reporting.py | 4 ++-- docutils/test/test_functional.py | 2 +- docutils/test/test_io.py | 6 +++--- docutils/test/test_language.py | 2 +- docutils/test/test_writers/test_odt.py | 3 +-- 11 files changed, 19 insertions(+), 21 deletions(-) diff --git a/docutils/docutils/__init__.py b/docutils/docutils/__init__.py index e9a177374..0ba21d499 100644 --- a/docutils/docutils/__init__.py +++ b/docutils/docutils/__init__.py @@ -90,8 +90,8 @@ def __new__(cls, major=0, minor=0, micro=0, if serial != 0: raise ValueError('"serial" must be 0 for final releases') - return super(VersionInfo, cls).__new__(cls, major, minor, micro, - releaselevel, serial, release) + return super().__new__(cls, major, minor, micro, + releaselevel, serial, release) def __lt__(self, other): if isinstance(other, tuple): diff --git a/docutils/docutils/transforms/writer_aux.py b/docutils/docutils/transforms/writer_aux.py index 1ddbf5d17..9ca89727a 100644 --- a/docutils/docutils/transforms/writer_aux.py +++ b/docutils/docutils/transforms/writer_aux.py @@ -46,7 +46,7 @@ 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.', DeprecationWarning, stacklevel=2) - super(Compound, self).__init__(document, startnode) + super().__init__(document, startnode) def apply(self): for compound in self.document.findall(nodes.compound): diff --git a/docutils/docutils/utils/error_reporting.py b/docutils/docutils/utils/error_reporting.py index eb2b37777..082bf188f 100644 --- a/docutils/docutils/utils/error_reporting.py +++ b/docutils/docutils/utils/error_reporting.py @@ -155,11 +155,11 @@ class ErrorString(SafeString): """ def __str__(self): return '%s: %s' % (self.data.__class__.__name__, - super(ErrorString, self).__str__()) + super().__str__()) def __unicode__(self): return '%s: %s' % (self.data.__class__.__name__, - super(ErrorString, self).__unicode__()) + super().__unicode__()) class ErrorOutput: diff --git a/docutils/docutils/utils/math/latex2mathml.py b/docutils/docutils/utils/math/latex2mathml.py index ab136be27..bef53e388 100644 --- a/docutils/docutils/utils/math/latex2mathml.py +++ b/docutils/docutils/utils/math/latex2mathml.py @@ -472,7 +472,7 @@ def close(self): self.children[0].parent = parent except (AttributeError, ValueError): return self.children[0] - return super(mrow, self).close() + return super().close() # >>> mrow(displaystyle=False) # mrow(displaystyle=False) @@ -509,7 +509,7 @@ class MathToken(math): def __init__(self, data, **attributes): self.data = data - super(MathToken, self).__init__(**attributes) + super().__init__(**attributes) def _xml_body(self, level=0): return [str(self.data).translate(self.xml_entities)] @@ -538,7 +538,7 @@ def __init__(self, *children, **kwargs): math.__init__(self, *children, **kwargs) def append(self, child): - current_node = super(MathSchema, self).append(child) + current_node = super().append(child) # normalize order if full if self.switch and self.full(): self.children[-1], self.children[-2] = self.children[-2], self.children[-1] diff --git a/docutils/docutils/writers/html5_polyglot/__init__.py b/docutils/docutils/writers/html5_polyglot/__init__.py index 670666293..2bd273b27 100644 --- a/docutils/docutils/writers/html5_polyglot/__init__.py +++ b/docutils/docutils/writers/html5_polyglot/__init__.py @@ -273,7 +273,7 @@ def visit_image(self, node): uri = node['uri'] mimetype = mimetypes.guess_type(uri)[0] if mimetype not in self.videotypes: - return super(HTMLTranslator, self).visit_image(node) + return super().visit_image(node) # image size if 'width' in node: atts['width'] = node['width'].replace('px', '') @@ -438,8 +438,7 @@ def depart_topic(self, node): # append self-link def section_title_tags(self, node): - start_tag, close_tag = super(HTMLTranslator, - self).section_title_tags(node) + start_tag, close_tag = super().section_title_tags(node) ids = node.parent['ids'] if (ids and getattr(self.settings, 'section_self_link', None) and not isinstance(node.parent, nodes.document)): diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py index 83eb6d68b..734e8fd04 100644 --- a/docutils/docutils/writers/latex2e/__init__.py +++ b/docutils/docutils/writers/latex2e/__init__.py @@ -1149,7 +1149,7 @@ class LaTeXTranslator(nodes.NodeVisitor): alltt = False # inside `alltt` environment def __init__(self, document, babel_class=Babel): - nodes.NodeVisitor.__init__(self, document) # TODO: use super() + super().__init__(document) # Reporter # ~~~~~~~~ self.warn = self.document.reporter.warning diff --git a/docutils/test/test_error_reporting.py b/docutils/test/test_error_reporting.py index 2e9c3a666..d5c7935da 100644 --- a/docutils/test/test_error_reporting.py +++ b/docutils/test/test_error_reporting.py @@ -110,7 +110,7 @@ class BBuf(BytesIO): def write(self, data): if isinstance(data, str): data.encode('ascii', 'strict') - super(BBuf, self).write(data) + super().write(data) # Stub: Buffer expecting unicode string: class UBuf(StringIO): @@ -118,7 +118,7 @@ def write(self, data): # emulate Python 3 handling of stdout, stderr if isinstance(data, bytes): raise TypeError('must be unicode, not bytes') - super(UBuf, self).write(data) + super().write(data) class ErrorOutputTests(unittest.TestCase): def test_defaults(self): diff --git a/docutils/test/test_functional.py b/docutils/test/test_functional.py index 85a655c32..f14e91387 100755 --- a/docutils/test/test_functional.py +++ b/docutils/test/test_functional.py @@ -34,7 +34,7 @@ class FunctionalTestSuite(DocutilsTestSupport.CustomTestSuite): def __init__(self): """Process all config files in functional/tests/.""" - DocutilsTestSupport.CustomTestSuite.__init__(self) + super().__init__() os.chdir(DocutilsTestSupport.testroot) self.clear_output_directory() self.added = 0 diff --git a/docutils/test/test_io.py b/docutils/test/test_io.py index 9fc49b849..725d29a0d 100755 --- a/docutils/test/test_io.py +++ b/docutils/test/test_io.py @@ -22,7 +22,7 @@ class BBuf(BytesIO): def write(self, data): if isinstance(data, str): data.encode('ascii', 'strict') - super(BBuf, self).write(data) + super().write(data) # Stub: Buffer expecting unicode string: @@ -31,7 +31,7 @@ def write(self, data): # emulate Python 3 handling of stdout, stderr if isinstance(data, bytes): raise TypeError('must be unicode, not bytes') - super(UBuf, self).write(data) + super().write(data) class mock_stdout(UBuf): @@ -39,7 +39,7 @@ class mock_stdout(UBuf): def __init__(self): self.buffer = BBuf() - UBuf.__init__(self) + super().__init__() class HelperTests(unittest.TestCase): diff --git a/docutils/test/test_language.py b/docutils/test/test_language.py index 5119ee536..ac3266953 100755 --- a/docutils/test/test_language.py +++ b/docutils/test/test_language.py @@ -32,7 +32,7 @@ class LanguageTestSuite(DocutilsTestSupport.CustomTestSuite): language_module_pattern = re.compile(r'^([a-z]{2,3}(_[a-z]{2,8})*)\.py$') def __init__(self, languages=None): - DocutilsTestSupport.CustomTestSuite.__init__(self) + super().__init__() if languages: self.languages = languages else: diff --git a/docutils/test/test_writers/test_odt.py b/docutils/test/test_writers/test_odt.py index 2126bf933..0e5f688a7 100755 --- a/docutils/test/test_writers/test_odt.py +++ b/docutils/test/test_writers/test_odt.py @@ -118,8 +118,7 @@ def assertEqual(self, first, second, msg=None): sep, first, sep, second, sep, ) #msg2 = '%s\n%s' % (msg1, msg, ) msg2 = '%s' % (msg, ) - DocutilsTestSupport.StandardTestCase.assertEqual(self, - first, second, msg2) + super().assertEqual(first, second, msg2) # # Unit test methods From 33939411ec663ce5d60028f767d99dfba58def25 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Sun, 23 Jan 2022 01:09:42 +0000 Subject: [PATCH 19/36] Use str over type('') --- docutils/docutils/statemachine.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docutils/docutils/statemachine.py b/docutils/docutils/statemachine.py index 7b0cb2815..6bd626876 100644 --- a/docutils/docutils/statemachine.py +++ b/docutils/docutils/statemachine.py @@ -1,4 +1,4 @@ - # $Id$ +# $Id$ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. @@ -720,11 +720,10 @@ def make_transitions(self, name_list): name string, or a 1- or 2-tuple (transition name, optional next state name). """ - stringtype = type('') names = [] transitions = {} for namestate in name_list: - if isinstance(namestate, stringtype): + if isinstance(namestate, str): transitions[namestate] = self.make_transition(namestate) names.append(namestate) else: From ee8f8506490568975e3fbc664bbf3634fbbccab4 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Sun, 23 Jan 2022 01:11:45 +0000 Subject: [PATCH 20/36] Use yield from --- docutils/docutils/nodes.py | 27 +++++++++-------------- docutils/docutils/utils/math/math2html.py | 3 +-- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/docutils/docutils/nodes.py b/docutils/docutils/nodes.py index 125861e11..e8b51157e 100644 --- a/docutils/docutils/nodes.py +++ b/docutils/docutils/nodes.py @@ -206,8 +206,7 @@ def _fast_findall(self, cls): if isinstance(self, cls): yield self for child in self.children: - for subnode in child._fast_findall(cls): - yield subnode + yield from child._fast_findall(cls) def _superfast_findall(self): """Return iterator that doesn't check for a condition.""" @@ -216,8 +215,7 @@ def _superfast_findall(self): # which yields only the direct children. yield self for child in self.children: - for subnode in child._superfast_findall(): - yield subnode + yield from child._superfast_findall() def traverse(self, condition=None, include_self=True, descend=True, siblings=False, ascend=False): @@ -277,12 +275,10 @@ def findall(self, condition=None, include_self=True, descend=True, # optimized version of traverse() if include_self and descend and not siblings: if condition is None: - for subnode in self._superfast_findall(): - yield subnode + yield from self._superfast_findall() return elif isinstance(condition, type): - for subnode in self._fast_findall(condition): - yield subnode + yield from self._fast_findall(condition) return # Check if `condition` is a class (check for TypeType for Python # implementations that use only new-style classes, like PyPy). @@ -296,19 +292,18 @@ def condition(node, node_class=node_class): yield self if descend and len(self.children): for child in self: - for subnode in child.findall(condition=condition, - include_self=True, descend=True, - siblings=False, ascend=False): - yield subnode + yield from child.findall(condition=condition, + include_self=True, descend=True, + siblings=False, ascend=False) if siblings or ascend: node = self while node.parent: index = node.parent.index(node) for sibling in node.parent[index+1:]: - for subnode in sibling.findall(condition=condition, - include_self=True, descend=descend, - siblings=False, ascend=False): - yield subnode + yield from sibling.findall( + condition=condition, + include_self=True, descend=descend, + siblings=False, ascend=False) if not ascend: break else: diff --git a/docutils/docutils/utils/math/math2html.py b/docutils/docutils/utils/math/math2html.py index e211e1f36..b88fcb0c8 100755 --- a/docutils/docutils/utils/math/math2html.py +++ b/docutils/docutils/utils/math/math2html.py @@ -1932,8 +1932,7 @@ def traverse(self, bit): if hasattr(element, 'type') and element.type: yield (element, bit.contents) elif isinstance(element, FormulaBit): - for pair in self.traverse(element): - yield pair + yield from self.traverse(element) def italicize(self, bit, contents): "Italicize the given bit of text." From 55582def42b0b6ef825891dc574d1d010dac9d44 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Sun, 23 Jan 2022 02:03:28 +0000 Subject: [PATCH 21/36] Remove coding line --- docutils/test/test_utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/docutils/test/test_utils.py b/docutils/test/test_utils.py index 23ec95ff2..17304bbd6 100755 --- a/docutils/test/test_utils.py +++ b/docutils/test/test_utils.py @@ -1,5 +1,4 @@ #! /usr/bin/env python3 -# -*- coding: utf-8 -*- # $Id$ # Author: David Goodger <goodger@python.org> From f873a8e97421599e92e58851902d1ab7a1a91d71 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Sun, 23 Jan 2022 02:04:54 +0000 Subject: [PATCH 22/36] Use standard Python version recipe --- docutils/tools/dev/generate_punctuation_chars.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docutils/tools/dev/generate_punctuation_chars.py b/docutils/tools/dev/generate_punctuation_chars.py index db913ae1b..48314bea5 100644 --- a/docutils/tools/dev/generate_punctuation_chars.py +++ b/docutils/tools/dev/generate_punctuation_chars.py @@ -379,7 +379,7 @@ def print_differences(old, new, name): # Replacements:: substitutions = { - 'python_version': '.'.join(str(s) for s in sys.version_info[:3]), + 'python_version': sys.version.split()[0], 'unidata_version': unicodedata.unidata_version, 'openers': wrap_string(o.encode('unicode-escape').decode(), startstring="openers = ('"), From 517f80f9b0c278d98fbd1136046d86faf9d6319a Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Sun, 23 Jan 2022 03:17:47 +0000 Subject: [PATCH 23/36] Fix backslashes --- .../test_recommonmark/test_section_headers.py | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docutils/test/test_parsers/test_recommonmark/test_section_headers.py b/docutils/test/test_parsers/test_recommonmark/test_section_headers.py index c9c46fb5f..cd8aa1c04 100755 --- a/docutils/test/test_parsers/test_recommonmark/test_section_headers.py +++ b/docutils/test/test_parsers/test_recommonmark/test_section_headers.py @@ -122,22 +122,22 @@ def suite(): <document source="test data"> <paragraph> Test return to existing, highest-level section (Title 3). - <section ids="title-1" names="title\ 1"> + <section ids="title-1" names="title\\ 1"> <title> Title 1 <paragraph> Paragraph 1. - <section ids="title-2" names="title\ 2"> + <section ids="title-2" names="title\\ 2"> <title> Title 2 <paragraph> Paragraph 2. - <section ids="title-3" names="title\ 3"> + <section ids="title-3" names="title\\ 3"> <title> Title 3 <paragraph> Paragraph 3. - <section ids="title-4" names="title\ 4"> + <section ids="title-4" names="title\\ 4"> <title> Title 4 <paragraph> @@ -160,19 +160,19 @@ def suite(): <document source="test data"> <paragraph> Test bad subsection order. - <section ids="title-1" names="title\ 1"> + <section ids="title-1" names="title\\ 1"> <title> Title 1 - <section ids="title-2" names="title\ 2"> + <section ids="title-2" names="title\\ 2"> <title> Title 2 - <section ids="title-3" names="title\ 3"> + <section ids="title-3" names="title\\ 3"> <title> Title 3 - <section ids="title-4" names="title\ 4"> + <section ids="title-4" names="title\\ 4"> <title> Title 4 - <section ids="title-5" names="title\ 5"> + <section ids="title-5" names="title\\ 5"> <title> Title 5 """], @@ -184,7 +184,7 @@ def suite(): """, """\ <document source="test data"> - <section ids="title-containing-inline-markup" names="title\ containing\ inline\ markup"> + <section ids="title-containing-inline-markup" names="title\\ containing\\ inline\\ markup"> <title> Title containing \n\ <emphasis> @@ -231,7 +231,7 @@ def suite(): """, """\ <document source="test data"> - <section ids="empty-section" names="empty\ section"> + <section ids="empty-section" names="empty\\ section"> <title> Empty Section """], From eedb12f93ee227b4979099a67ae04a932be06fdc Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Sun, 23 Jan 2022 22:02:49 +0000 Subject: [PATCH 24/36] Remove obsolete `__cmp__` method https://docs.python.org/3/whatsnew/3.0.html#ordering-comparisons --- docutils/docutils/statemachine.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docutils/docutils/statemachine.py b/docutils/docutils/statemachine.py index 6bd626876..50ef4117d 100644 --- a/docutils/docutils/statemachine.py +++ b/docutils/docutils/statemachine.py @@ -1113,12 +1113,6 @@ def __ne__(self, other): return self.data != self.__cast(other) def __gt__(self, other): return self.data > self.__cast(other) def __ge__(self, other): return self.data >= self.__cast(other) - def __cmp__(self, other): - # from https://docs.python.org/3.0/whatsnew/3.0.html - mine = self.data - yours = self.__cast(other) - return (mine > yours) - (yours < mine) - def __cast(self, other): if isinstance(other, ViewList): return other.data From 0cab7f3f49c23c6d1c6381daf6044cea2b333a63 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Sun, 23 Jan 2022 22:03:53 +0000 Subject: [PATCH 25/36] Dictionaries are ordered from Python 3.7 --- docutils/docutils/utils/math/latex2mathml.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docutils/docutils/utils/math/latex2mathml.py b/docutils/docutils/utils/math/latex2mathml.py index bef53e388..83a78633a 100644 --- a/docutils/docutils/utils/math/latex2mathml.py +++ b/docutils/docutils/utils/math/latex2mathml.py @@ -24,7 +24,6 @@ # # >>> from latex2mathml import * -import collections import copy import re import sys @@ -340,7 +339,7 @@ def __init__(self, *children, **attributes): self.children = [] self.extend(children) - self.attributes = collections.OrderedDict() + self.attributes = {} # sort attributes for predictable functional tests # as self.attributes.update(attributes) does not keep order in Python < 3.6 for key in sorted(attributes.keys()): From ed844f3bb9169e836e835d4eb70bd75a3c8b1984 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Mon, 24 Jan 2022 11:06:11 +0000 Subject: [PATCH 26/36] Remove re.U(NICODE), it is the default in Python 3 https://docs.python.org/3/library/re.html#re.ASCII --- docutils/docutils/parsers/rst/states.py | 49 ++++++++++++------------- docutils/docutils/utils/smartquotes.py | 10 ++--- docutils/docutils/writers/_html_base.py | 2 +- 3 files changed, 30 insertions(+), 31 deletions(-) diff --git a/docutils/docutils/parsers/rst/states.py b/docutils/docutils/parsers/rst/states.py index e041b7931..d35c3072b 100644 --- a/docutils/docutils/parsers/rst/states.py +++ b/docutils/docutils/parsers/rst/states.py @@ -454,7 +454,7 @@ def build_regexp(definition, compile=True): or_group = '|'.join(part_strings) regexp = '%(prefix)s(?P<%(name)s>%(or_group)s)%(suffix)s' % locals() if compile: - return re.compile(regexp, re.UNICODE) + return re.compile(regexp) else: return regexp @@ -519,9 +519,9 @@ def init_customizations(self, settings): self.patterns = Struct( initial=build_regexp(parts), emphasis=re.compile(self.non_whitespace_escape_before - + r'(\*)' + end_string_suffix, re.UNICODE), + + r'(\*)' + end_string_suffix), strong=re.compile(self.non_whitespace_escape_before - + r'(\*\*)' + end_string_suffix, re.UNICODE), + + r'(\*\*)' + end_string_suffix), interpreted_or_phrase_ref=re.compile( r""" %(non_unescaped_whitespace_escape_before)s @@ -533,7 +533,7 @@ def init_customizations(self, settings): ) ) %(end_string_suffix)s - """ % args, re.VERBOSE | re.UNICODE), + """ % args, re.VERBOSE), embedded_link=re.compile( r""" ( @@ -545,16 +545,16 @@ def init_customizations(self, settings): > # close bracket ) $ # end of string - """ % args, re.VERBOSE | re.UNICODE), + """ % args, re.VERBOSE), literal=re.compile(self.non_whitespace_before + '(``)' - + end_string_suffix, re.UNICODE), + + end_string_suffix), target=re.compile(self.non_whitespace_escape_before - + r'(`)' + end_string_suffix, re.UNICODE), + + r'(`)' + end_string_suffix), substitution_ref=re.compile(self.non_whitespace_escape_before + r'(\|_{0,2})' - + end_string_suffix, re.UNICODE), + + end_string_suffix), email=re.compile(self.email_pattern % args + '$', - re.VERBOSE | re.UNICODE), + re.VERBOSE), uri=re.compile( (r""" %(start_string_prefix)s @@ -586,7 +586,7 @@ def init_customizations(self, settings): ) ) %(end_string_suffix)s - """) % args, re.VERBOSE | re.UNICODE), + """) % args, re.VERBOSE), pep=re.compile( r""" %(start_string_prefix)s @@ -595,12 +595,12 @@ def init_customizations(self, settings): | (PEP\s+(?P<pepnum2>\d+)) # reference by name ) - %(end_string_suffix)s""" % args, re.VERBOSE | re.UNICODE), + %(end_string_suffix)s""" % args, re.VERBOSE), rfc=re.compile( r""" %(start_string_prefix)s (RFC(-|\s+)?(?P<rfcnum>\d+)) - %(end_string_suffix)s""" % args, re.VERBOSE | re.UNICODE)) + %(end_string_suffix)s""" % args, re.VERBOSE)) self.implicit_dispatch.append((self.patterns.uri, self.standalone_uri)) @@ -1102,7 +1102,7 @@ class Body(RSTState): enum.sequenceregexps = {} for sequence in enum.sequences: enum.sequenceregexps[sequence] = re.compile( - enum.sequencepats[sequence] + '$', re.UNICODE) + enum.sequencepats[sequence] + '$') grid_table_top_pat = re.compile(r'\+-[-+]+-\+ *$') """Matches the top (& bottom) of a full table).""" @@ -1196,8 +1196,7 @@ def block_quote(self, indented, line_offset): return elements # U+2014 is an em-dash: - attribution_pattern = re.compile('(---?(?!-)|\u2014) *(?=[^ \\n])', - re.UNICODE) + attribution_pattern = re.compile('(---?(?!-)|\u2014) *(?=[^ \\n])') def split_attribution(self, indented, line_offset): """ @@ -1856,7 +1855,7 @@ def build_table_row(self, rowdata, tableline): [ ]? # optional space : # end of reference name ([ ]+|$) # followed by whitespace - """ % vars(Inliner), re.VERBOSE | re.UNICODE), + """ % vars(Inliner), re.VERBOSE), reference=re.compile(r""" ( (?P<simple>%(simplename)s)_ @@ -1869,7 +1868,7 @@ def build_table_row(self, rowdata, tableline): # reference mark ) $ # end of string - """ % vars(Inliner), re.VERBOSE | re.UNICODE), + """ % vars(Inliner), re.VERBOSE), substitution=re.compile(r""" ( (?![ ]) # first char. not space @@ -1879,7 +1878,7 @@ def build_table_row(self, rowdata, tableline): ) ([ ]+|$) # followed by whitespace """ % vars(Inliner), - re.VERBOSE | re.UNICODE),) + re.VERBOSE),) def footnote(self, match): src, srcline = self.state_machine.get_source_and_line() @@ -2319,25 +2318,25 @@ def comment(self, match): ) \] ([ ]+|$) # whitespace or end of line - """ % Inliner.simplename, re.VERBOSE | re.UNICODE)), + """ % Inliner.simplename, re.VERBOSE)), (citation, re.compile(r""" \.\.[ ]+ # explicit markup start \[(%s)\] # citation label ([ ]+|$) # whitespace or end of line - """ % Inliner.simplename, re.VERBOSE | re.UNICODE)), + """ % Inliner.simplename, re.VERBOSE)), (hyperlink_target, re.compile(r""" \.\.[ ]+ # explicit markup start _ # target indicator (?![ ]|$) # first char. not space or EOL - """, re.VERBOSE | re.UNICODE)), + """, re.VERBOSE)), (substitution_def, re.compile(r""" \.\.[ ]+ # explicit markup start \| # substitution indicator (?![ ]|$) # first char. not space or EOL - """, re.VERBOSE | re.UNICODE)), + """, re.VERBOSE)), (directive, re.compile(r""" \.\.[ ]+ # explicit markup start @@ -2345,7 +2344,7 @@ def comment(self, match): [ ]? # optional space :: # directive delimiter ([ ]+|$) # whitespace or end of line - """ % Inliner.simplename, re.VERBOSE | re.UNICODE))] + """ % Inliner.simplename, re.VERBOSE))] def explicit_markup(self, match, context, next_state): """Footnotes, hyperlink targets, directives, comments.""" @@ -2677,7 +2676,7 @@ class SubstitutionDef(Body): patterns = { 'embedded_directive': re.compile(r'(%s)::( +|$)' - % Inliner.simplename, re.UNICODE), + % Inliner.simplename), 'text': r''} initial_transitions = ['embedded_directive', 'text'] @@ -3102,7 +3101,7 @@ def initial_quoted(self, match, context, next_state): """Match arbitrary quote character on the first line only.""" self.remove_transition('initial_quoted') quote = match.string[0] - pattern = re.compile(re.escape(quote), re.UNICODE) + pattern = re.compile(re.escape(quote)) # New transition matches consistent quotes only: self.add_transition('quoted', (pattern, self.quoted, self.__class__.__name__)) diff --git a/docutils/docutils/utils/smartquotes.py b/docutils/docutils/utils/smartquotes.py index 1ec51c983..455b01015 100644 --- a/docutils/docutils/utils/smartquotes.py +++ b/docutils/docutils/utils/smartquotes.py @@ -672,18 +672,18 @@ def educateQuotes(text, language='en'): ) ' # the quote (?=\\w|%(punct)s) # followed by a word character or punctuation - """ % ch_classes, re.VERBOSE | re.UNICODE) + """ % ch_classes, re.VERBOSE) text = opening_secondary_quotes_regex.sub(r'\1'+smart.osquote, text) # In many locales, secondary closing quotes are different from apostrophe: if smart.csquote != smart.apostrophe: - apostrophe_regex = re.compile(r"(?<=(\w|\d))'(?=\w)", re.UNICODE) + apostrophe_regex = re.compile(r"(?<=(\w|\d))'(?=\w)") text = apostrophe_regex.sub(smart.apostrophe, text) # TODO: keep track of quoting level to recognize apostrophe in, e.g., # "Ich fass' es nicht." - closing_secondary_quotes_regex = re.compile(r"(?<!\s)'", re.UNICODE) + closing_secondary_quotes_regex = re.compile(r"(?<!\s)'") text = closing_secondary_quotes_regex.sub(smart.csquote, text) # Any remaining secondary quotes should be opening ones: @@ -698,7 +698,7 @@ def educateQuotes(text, language='en'): ) " # the quote (?=\\w|%(punct)s) # followed by a word character or punctuation - """ % ch_classes, re.VERBOSE | re.UNICODE) + """ % ch_classes, re.VERBOSE) text = opening_primary_quotes_regex.sub(r'\1'+smart.opquote, text) @@ -708,7 +708,7 @@ def educateQuotes(text, language='en'): (?<!\s)" | # no whitespace before "(?=\s) # whitespace behind ) - """, re.VERBOSE | re.UNICODE) + """, re.VERBOSE) text = closing_primary_quotes_regex.sub(smart.cpquote, text) # Any remaining quotes should be opening ones. diff --git a/docutils/docutils/writers/_html_base.py b/docutils/docutils/writers/_html_base.py index 38665514a..85ccb9247 100644 --- a/docutils/docutils/writers/_html_base.py +++ b/docutils/docutils/writers/_html_base.py @@ -262,7 +262,7 @@ def depart_example(self, node): embedded_stylesheet = '<style type="text/css">\n\n%s\n</style>\n' words_and_spaces = re.compile(r'[^ \n]+| +|\n') # wrap point inside word: - in_word_wrap_point = re.compile(r'.+\W\W.+|[-?].+', re.U) + in_word_wrap_point = re.compile(r'.+\W\W.+|[-?].+') lang_attribute = 'lang' # name changes to 'xml:lang' in XHTML 1.1 special_characters = {ord('&'): '&', From 01c69d731f384e8bb91bb1768fbc26a3a9e89942 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Tue, 25 Jan 2022 21:31:25 +0000 Subject: [PATCH 27/36] Use True/False over 1/0 --- docutils/docutils/parsers/rst/states.py | 2 +- docutils/test/DocutilsTestSupport.py | 4 ++-- docutils/test/test_settings.py | 4 ++-- docutils/test/test_viewlist.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docutils/docutils/parsers/rst/states.py b/docutils/docutils/parsers/rst/states.py index d35c3072b..d8a43f31c 100644 --- a/docutils/docutils/parsers/rst/states.py +++ b/docutils/docutils/parsers/rst/states.py @@ -986,7 +986,7 @@ def reference(self, match, lineno, anonymous=False): return (string[:matchstart], [referencenode], string[matchend:], []) def anonymous_reference(self, match, lineno): - return self.reference(match, lineno, anonymous=1) + return self.reference(match, lineno, anonymous=True) def standalone_uri(self, match, lineno): if (not match.group('scheme') diff --git a/docutils/test/DocutilsTestSupport.py b/docutils/test/DocutilsTestSupport.py index b663a53aa..aedd636d1 100644 --- a/docutils/test/DocutilsTestSupport.py +++ b/docutils/test/DocutilsTestSupport.py @@ -210,8 +210,8 @@ def compare_output(self, input, output, expected): print('\n%s\ninput:' % (self,), file=sys.stderr) print(input, file=sys.stderr) try: - comparison = ''.join(self.compare(expected.splitlines(1), - output.splitlines(1))) + comparison = ''.join(self.compare(expected.splitlines(True), + output.splitlines(True))) print('-: expected\n+: output', file=sys.stderr) print(comparison, file=sys.stderr) except AttributeError: # expected or output not a string diff --git a/docutils/test/test_settings.py b/docutils/test/test_settings.py index 85f34e812..22cc91d06 100755 --- a/docutils/test/test_settings.py +++ b/docutils/test/test_settings.py @@ -130,8 +130,8 @@ def compare_output(self, result, expected): except AssertionError: print('\n%s\n' % (self,), file=sys.stderr) print('-: expected\n+: result', file=sys.stderr) - print(''.join(self.compare(expected.splitlines(1), - result.splitlines(1))), file=sys.stderr) + print(''.join(self.compare(expected.splitlines(True), + result.splitlines(True))), file=sys.stderr) raise def test_nofiles(self): diff --git a/docutils/test/test_viewlist.py b/docutils/test/test_viewlist.py index bfa6604c7..90f5e8f06 100755 --- a/docutils/test/test_viewlist.py +++ b/docutils/test/test_viewlist.py @@ -192,7 +192,7 @@ class StringList(unittest.TestCase): def setUp(self): - self.a_list = self.text.splitlines(1) + self.a_list = self.text.splitlines(True) self.a = statemachine.StringList(self.a_list, 'a') def test_trim_left(self): From 2d3bed9bce56f07126f7fba5c6ec5231834dbc2d Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Tue, 25 Jan 2022 21:40:17 +0000 Subject: [PATCH 28/36] Use decorator for staticmethod --- docutils/docutils/parsers/rst/directives/tables.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docutils/docutils/parsers/rst/directives/tables.py b/docutils/docutils/parsers/rst/directives/tables.py index dac1a54b2..749a4b6f3 100644 --- a/docutils/docutils/parsers/rst/directives/tables.py +++ b/docutils/docutils/parsers/rst/directives/tables.py @@ -358,20 +358,21 @@ def get_csv_data(self): raise SystemMessagePropagation(error) return csv_data, source + @staticmethod def decode_from_csv(s): warnings.warn('CSVTable.decode_from_csv()' ' is not required with Python 3' ' and will be removed in Docutils 0.21 or later.', DeprecationWarning, stacklevel=2) return s + + @staticmethod def encode_for_csv(s): warnings.warn('CSVTable.encode_from_csv()' ' is not required with Python 3' ' and will be removed in Docutils 0.21 or later.', DeprecationWarning, stacklevel=2) return s - decode_from_csv = staticmethod(decode_from_csv) - encode_for_csv = staticmethod(encode_for_csv) def parse_csv_data_into_rows(self, csv_data, dialect, source): csv_reader = csv.reader([line + '\n' for line in csv_data], From c80f69813ef1ed28bf9f4157f1f37eb910b14257 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Tue, 25 Jan 2022 21:41:37 +0000 Subject: [PATCH 29/36] Import locale_encoding from `docutils.io` --- .../test/test_parsers/test_rst/test_directives/test_date.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_date.py b/docutils/test/test_parsers/test_rst/test_directives/test_date.py index 471be9cb8..2289d11e3 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_date.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_date.py @@ -13,7 +13,7 @@ from test_parsers import DocutilsTestSupport import time -from docutils.utils.error_reporting import locale_encoding +from docutils.io import locale_encoding def suite(): s = DocutilsTestSupport.ParserTestSuite() From 9ba455fa808c6116a12866dd49d0044b21998242 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Tue, 25 Jan 2022 21:42:05 +0000 Subject: [PATCH 30/36] Remove duplicate dictionary keys --- docutils/docutils/parsers/rst/languages/ar.py | 2 -- docutils/docutils/parsers/rst/languages/es.py | 1 - 2 files changed, 3 deletions(-) diff --git a/docutils/docutils/parsers/rst/languages/ar.py b/docutils/docutils/parsers/rst/languages/ar.py index 23b389949..a8dc103ec 100644 --- a/docutils/docutils/parsers/rst/languages/ar.py +++ b/docutils/docutils/parsers/rst/languages/ar.py @@ -20,8 +20,6 @@ 'تنبيه': 'attention', 'احتیاط': 'caution', 'كود': 'code', - 'كود': 'code', - 'كود': 'code', 'خطر': 'danger', 'خطأ': 'error', 'تلميح': 'hint', diff --git a/docutils/docutils/parsers/rst/languages/es.py b/docutils/docutils/parsers/rst/languages/es.py index 149f0dda1..b9178d209 100644 --- a/docutils/docutils/parsers/rst/languages/es.py +++ b/docutils/docutils/parsers/rst/languages/es.py @@ -85,7 +85,6 @@ 'abreviatura': 'abbreviation', 'ab': 'abbreviation', 'acronimo': 'acronym', - 'acronimo': 'acronym', 'ac': 'acronym', 'code (translation required)': 'code', 'indice': 'index', From 901a764a9c8166bf2b0a6f1d8e839b1492902a55 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Tue, 25 Jan 2022 21:53:07 +0000 Subject: [PATCH 31/36] Remove redundant parentheses --- docutils/docutils/frontend.py | 2 +- docutils/docutils/io.py | 2 +- .../docutils/parsers/recommonmark_wrapper.py | 2 +- docutils/docutils/parsers/rst/directives/misc.py | 2 +- docutils/docutils/parsers/rst/states.py | 14 +++++++------- docutils/docutils/parsers/rst/tableparser.py | 2 +- docutils/docutils/statemachine.py | 10 +++++----- docutils/docutils/transforms/references.py | 2 +- docutils/docutils/transforms/universal.py | 4 ++-- docutils/docutils/utils/code_analyzer.py | 16 ++++++++-------- docutils/docutils/utils/error_reporting.py | 2 +- docutils/docutils/utils/math/math2html.py | 2 +- docutils/docutils/utils/smartquotes.py | 6 +++--- docutils/docutils/writers/_html_base.py | 10 +++++----- .../docutils/writers/html5_polyglot/__init__.py | 4 ++-- docutils/docutils/writers/latex2e/__init__.py | 8 ++++---- docutils/docutils/writers/odf_odt/__init__.py | 6 +++--- docutils/test/test_error_reporting.py | 2 +- docutils/test/test_io.py | 2 +- docutils/test/test_language.py | 2 +- .../test/test_writers/test_html4css1_misc.py | 2 +- .../test_writers/test_html5_polyglot_misc.py | 2 +- .../test_writers/test_html5_polyglot_parts.py | 2 +- docutils/tools/test/test_buildhtml.py | 2 +- 24 files changed, 54 insertions(+), 54 deletions(-) diff --git a/docutils/docutils/frontend.py b/docutils/docutils/frontend.py index 0776e4ce4..23dc9a05b 100644 --- a/docutils/docutils/frontend.py +++ b/docutils/docutils/frontend.py @@ -311,7 +311,7 @@ def update(self, other_dict, option_parser): other_dict = other_dict.__dict__ other_dict = other_dict.copy() for setting in option_parser.lists.keys(): - if (hasattr(self, setting) and setting in other_dict): + if hasattr(self, setting) and setting in other_dict: value = getattr(self, setting) if value: value += other_dict[setting] diff --git a/docutils/docutils/io.py b/docutils/docutils/io.py index 7fcb70138..fd4409a37 100644 --- a/docutils/docutils/io.py +++ b/docutils/docutils/io.py @@ -337,7 +337,7 @@ def __init__(self, source=None, source_path=None, raise InputError(error.errno, error.strerror, source_path) else: self.source = sys.stdin - elif (check_encoding(self.source, self.encoding) is False): + elif check_encoding(self.source, self.encoding) is False: # TODO: re-open, warn or raise error? raise UnicodeError('Encoding clash: encoding given is "%s" ' 'but source is opened with encoding "%s".' % diff --git a/docutils/docutils/parsers/recommonmark_wrapper.py b/docutils/docutils/parsers/recommonmark_wrapper.py index 39fcde0aa..00779e5b2 100644 --- a/docutils/docutils/parsers/recommonmark_wrapper.py +++ b/docutils/docutils/parsers/recommonmark_wrapper.py @@ -40,7 +40,7 @@ # already cached in `sys.modules` if recommonmark >= 0.5.0 except ImportError: # stub to prevent errors with recommonmark < 0.5.0 - class addnodes(): + class addnodes: pending_xref = nodes.pending diff --git a/docutils/docutils/parsers/rst/directives/misc.py b/docutils/docutils/parsers/rst/directives/misc.py index b7055cc8f..e25e838cc 100644 --- a/docutils/docutils/parsers/rst/directives/misc.py +++ b/docutils/docutils/parsers/rst/directives/misc.py @@ -318,7 +318,7 @@ def run(self): return [ self.state_machine.reporter.error( 'Error in "%s" directive: may contain a single paragraph ' - 'only.' % (self.name), line=self.lineno) ] + 'only.' % self.name, line=self.lineno) ] if node: return messages + node.children return messages diff --git a/docutils/docutils/parsers/rst/states.py b/docutils/docutils/parsers/rst/states.py index d8a43f31c..b202d1456 100644 --- a/docutils/docutils/parsers/rst/states.py +++ b/docutils/docutils/parsers/rst/states.py @@ -713,7 +713,7 @@ def inline_obj(self, match, lineno, end_pattern, nodeclass, matchstart = match.start('start') matchend = match.end('start') if self.quoted_start(match): - return (string[:matchend], [], string[matchend:], [], '') + return string[:matchend], [], string[matchend:], [], '' endmatch = end_pattern.search(string[matchend:]) if endmatch and endmatch.start(1): # 1 or more chars text = endmatch.string[:endmatch.start(1)] @@ -760,7 +760,7 @@ def interpreted_or_phrase_ref(self, match, lineno): role = role[1:-1] position = 'prefix' elif self.quoted_start(match): - return (string[:matchend], [], string[matchend:], []) + return string[:matchend], [], string[matchend:], [] endmatch = end_pattern.search(string[matchend:]) if endmatch and endmatch.start(1): # 1 or more chars textend = matchend + endmatch.end() @@ -966,7 +966,7 @@ def footnote_reference(self, match, lineno): self.document.note_footnote_ref(refnode) if utils.get_trim_footnote_ref_space(self.document.settings): before = before.rstrip() - return (before, [refnode], remaining, []) + return before, [refnode], remaining, [] def reference(self, match, lineno, anonymous=False): referencename = match.group('refname') @@ -983,7 +983,7 @@ def reference(self, match, lineno, anonymous=False): string = match.string matchstart = match.start('whole') matchend = match.end('whole') - return (string[:matchstart], [referencenode], string[matchend:], []) + return string[:matchstart], [referencenode], string[matchend:], [] def anonymous_reference(self, match, lineno): return self.reference(match, lineno, anonymous=True) @@ -1231,7 +1231,7 @@ def split_attribution(self, indented, line_offset): else: blank = i else: - return (indented, None, None, None, None) + return indented, None, None, None, None def check_attribution(self, indented, attribution_start): """ @@ -2206,7 +2206,7 @@ def parse_directive_block(self, indented, line_offset, directive, arguments = [] if content and not has_content: raise MarkupError('no content permitted') - return (arguments, options, content, content_offset) + return arguments, options, content, content_offset def parse_directive_options(self, option_presets, option_spec, arg_block): options = option_presets.copy() @@ -2266,7 +2266,7 @@ def parse_extension_options(self, option_spec, datalines): try: options = utils.extract_extension_options(node, option_spec) except KeyError as detail: - return 0, ('unknown option: "%s"' % detail.args[0]) + return 0, 'unknown option: "%s"' % detail.args[0] except (ValueError, TypeError) as detail: return 0, ('invalid option value: %s' % ' '.join(detail.args)) except utils.ExtensionOptionError as detail: diff --git a/docutils/docutils/parsers/rst/tableparser.py b/docutils/docutils/parsers/rst/tableparser.py index baaeaeb81..d2b1cde0c 100644 --- a/docutils/docutils/parsers/rst/tableparser.py +++ b/docutils/docutils/parsers/rst/tableparser.py @@ -320,7 +320,7 @@ def structure_from_cells(self): else: headrows = [] bodyrows = rows - return (colspecs, headrows, bodyrows) + return colspecs, headrows, bodyrows class SimpleTableParser(TableParser): diff --git a/docutils/docutils/statemachine.py b/docutils/docutils/statemachine.py index 50ef4117d..5785b099c 100644 --- a/docutils/docutils/statemachine.py +++ b/docutils/docutils/statemachine.py @@ -371,16 +371,16 @@ def get_source_and_line(self, lineno=None): try: src, srcoffset = self.input_lines.info(offset) srcline = srcoffset + 1 - except (TypeError): + except TypeError: # line is None if index is "Just past the end" src, srcline = self.get_source_and_line(offset + self.input_offset) return src, srcline + 1 - except (IndexError): # `offset` is off the list + except IndexError: # `offset` is off the list src, srcline = None, None # raise AssertionError('cannot find line %d in %s lines' % # (offset, len(self.input_lines))) # # list(self.input_lines.lines()))) - return (src, srcline) + return src, srcline def insert_input(self, input_lines, source): self.input_lines.insert(self.line_offset + 1, '', @@ -710,7 +710,7 @@ def make_transition(self, name, next_state=None): except AttributeError: raise TransitionMethodNotFound( '%s.%s' % (self.__class__.__name__, name)) - return (pattern, method, next_state) + return pattern, method, next_state def make_transitions(self, name_list): """ @@ -1307,7 +1307,7 @@ def disconnect(self): def xitems(self): """Return iterator yielding (source, offset, value) tuples.""" for (value, (source, offset)) in zip(self.data, self.items): - yield (source, offset, value) + yield source, offset, value def pprint(self): """Print the list in `grep` format (`source:offset:value` lines)""" diff --git a/docutils/docutils/transforms/references.py b/docutils/docutils/transforms/references.py index d23a7a76a..116b9543a 100644 --- a/docutils/docutils/transforms/references.py +++ b/docutils/docutils/transforms/references.py @@ -688,7 +688,7 @@ def apply(self): if len(subdef.astext()) > line_length_limit: msg = self.document.reporter.error( 'Substitution definition "%s" exceeds the' - ' line-length-limit.' % (key)) + ' line-length-limit.' % key) if msg: msgid = self.document.set_id(msg) prb = nodes.problematic( diff --git a/docutils/docutils/transforms/universal.py b/docutils/docutils/transforms/universal.py index 012bf9cae..e5c478bdc 100644 --- a/docutils/docutils/transforms/universal.py +++ b/docutils/docutils/transforms/universal.py @@ -259,12 +259,12 @@ def get_tokens(self, txtnodes): for node in txtnodes: if (isinstance(node.parent, self.literal_nodes) or isinstance(node.parent.parent, self.literal_nodes)): - yield ('literal', str(node)) + yield 'literal', str(node) else: # SmartQuotes uses backslash escapes instead of null-escapes # Insert backslashes before escaped "active" characters. txt = re.sub('(?<=\x00)([-\\\'".`])', r'\\\1', str(node)) - yield ('plain', txt) + yield 'plain', txt def apply(self): smart_quotes = self.document.settings.setdefault('smart_quotes', diff --git a/docutils/docutils/utils/code_analyzer.py b/docutils/docutils/utils/code_analyzer.py index 02619e114..7050f5fdf 100644 --- a/docutils/docutils/utils/code_analyzer.py +++ b/docutils/docutils/utils/code_analyzer.py @@ -82,18 +82,18 @@ def merge(self, tokens): if ttype is lasttype: lastval += value else: - yield(lasttype, lastval) + yield lasttype, lastval (lasttype, lastval) = (ttype, value) if lastval.endswith('\n'): lastval = lastval[:-1] if lastval: - yield(lasttype, lastval) + yield lasttype, lastval def __iter__(self): """Parse self.code and yield "classified" tokens. """ if self.lexer is None: - yield ([], self.code) + yield [], self.code return tokens = pygments.lex(self.code, self.lexer) for tokentype, value in self.merge(tokens): @@ -102,7 +102,7 @@ def __iter__(self): else: # short CSS class args classes = [_get_ttype_class(tokentype)] classes = [cls for cls in classes if cls not in unstyled_tokens] - yield (classes, value) + yield classes, value class NumberLines: @@ -126,11 +126,11 @@ def __init__(self, tokens, startline, endline): def __iter__(self): lineno = self.startline - yield (['ln'], self.fmt_str % lineno) + yield ['ln'], self.fmt_str % lineno for ttype, value in self.tokens: lines = value.split('\n') for line in lines[:-1]: - yield (ttype, line + '\n') + yield ttype, line + '\n' lineno += 1 - yield (['ln'], self.fmt_str % lineno) - yield (ttype, lines[-1]) + yield ['ln'], self.fmt_str % lineno + yield ttype, lines[-1] diff --git a/docutils/docutils/utils/error_reporting.py b/docutils/docutils/utils/error_reporting.py index 082bf188f..9349e16ba 100644 --- a/docutils/docutils/utils/error_reporting.py +++ b/docutils/docutils/utils/error_reporting.py @@ -183,7 +183,7 @@ def __init__(self, stream=None, encoding=None, """ if stream is None: stream = sys.stderr - elif not(stream): + elif not stream: stream = False # if `stream` is a file name, open it elif isinstance(stream, str): diff --git a/docutils/docutils/utils/math/math2html.py b/docutils/docutils/utils/math/math2html.py index b88fcb0c8..a4caaa52f 100755 --- a/docutils/docutils/utils/math/math2html.py +++ b/docutils/docutils/utils/math/math2html.py @@ -1930,7 +1930,7 @@ def traverse(self, bit): "Traverse a formula and yield a flattened structure of (bit, list) pairs." for element in bit.contents: if hasattr(element, 'type') and element.type: - yield (element, bit.contents) + yield element, bit.contents elif isinstance(element, FormulaBit): yield from self.traverse(element) diff --git a/docutils/docutils/utils/smartquotes.py b/docutils/docutils/utils/smartquotes.py index 455b01015..8bff85880 100644 --- a/docutils/docutils/utils/smartquotes.py +++ b/docutils/docutils/utils/smartquotes.py @@ -885,15 +885,15 @@ def tokenize(text): previous_end = 0 while token_match is not None: if token_match.group(1): - yield ('text', token_match.group(1)) + yield 'text', token_match.group(1) - yield ('tag', token_match.group(2)) + yield 'tag', token_match.group(2) previous_end = token_match.end() token_match = tag_soup.search(text, token_match.end()) if previous_end < len(text): - yield ('text', text[previous_end:]) + yield 'text', text[previous_end:] diff --git a/docutils/docutils/writers/_html_base.py b/docutils/docutils/writers/_html_base.py index 85ccb9247..414c7d896 100644 --- a/docutils/docutils/writers/_html_base.py +++ b/docutils/docutils/writers/_html_base.py @@ -769,7 +769,7 @@ def depart_description(self, node): def visit_docinfo(self, node): self.context.append(len(self.body)) classes = ['docinfo'] - if (self.is_compactable(node)): + if self.is_compactable(node): classes.append('simple') self.body.append(self.starttag(node, 'dl', classes=classes)) @@ -885,7 +885,7 @@ def visit_field_list(self, node): classes.pop(i) break classes.append('field-list') - if (self.is_compactable(node)): + if self.is_compactable(node): classes.append('simple') self.body.append(self.starttag(node, 'dl', **atts)) @@ -1249,11 +1249,11 @@ def visit_math(self, node, math_env=''): self.document.reporter) elif converter == 'blahtexml': math_code = tex2mathml_extern.blahtexml(math_code, - inline=not(math_env), - reporter=self.document.reporter) + inline=not math_env, + reporter=self.document.reporter) elif not converter: math_code = latex2mathml.tex2mathml(math_code, - inline=not(math_env)) + inline=not math_env) else: self.document.reporter.error('option "%s" not supported ' 'with math-output "MathML"') diff --git a/docutils/docutils/writers/html5_polyglot/__init__.py b/docutils/docutils/writers/html5_polyglot/__init__.py index 2bd273b27..8317e6786 100644 --- a/docutils/docutils/writers/html5_polyglot/__init__.py +++ b/docutils/docutils/writers/html5_polyglot/__init__.py @@ -328,7 +328,7 @@ def depart_inline(self, node): if (node.html5tagname == 'small' and node.get('classes') == ['ln'] and isinstance(node.parent, nodes.literal_block)): self.body.append('<code data-lineno="%s">' % node.astext()) - del(node.html5tagname) + del node.html5tagname # place inside HTML5 <figcaption> element (together with caption) def visit_legend(self, node): @@ -434,7 +434,7 @@ def visit_topic(self, node): def depart_topic(self, node): self.body.append('</%s>\n'%node.html_tagname) - del(node.html_tagname) + del node.html_tagname # append self-link def section_title_tags(self, node): diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py index 734e8fd04..7df7ced0c 100644 --- a/docutils/docutils/writers/latex2e/__init__.py +++ b/docutils/docutils/writers/latex2e/__init__.py @@ -883,7 +883,7 @@ def set_table_style(self, node, settings): def get_latex_type(self): if self._latex_type == 'longtable' and not self.caption: # do not advance the "table" counter (requires "ltcaption" package) - return('longtable*') + return 'longtable*' return self._latex_type def set(self, attr, value): @@ -1055,7 +1055,7 @@ def depart_row(self): res = [' \\\\\n'] self._cell_in_row = None # remove cell counter for i in range(len(self._rowspan)): - if (self._rowspan[i]>0): + if self._rowspan[i]>0: self._rowspan[i] -= 1 if self.borders == 'standard': @@ -1659,7 +1659,7 @@ def term_postfix(self, node): return '' if isinstance(child, (nodes.container, nodes.compound)): return self.term_postfix(child) - if isinstance(child, (nodes.image)): + if isinstance(child, nodes.image): return '\\leavevmode\n' # Images get an additional newline. if not isinstance(child, (nodes.paragraph, nodes.math_block)): return '\\leavevmode' @@ -3111,7 +3111,7 @@ def visit_title(self, node): % roman.toRoman(level)) # System messages heading in red: - if ('system-messages' in node.parent['classes']): + if 'system-messages' in node.parent['classes']: self.requirements['color'] = PreambleCmds.color section_title = self.encode(node.astext()) self.out.append(r'\%s[%s]{\color{red}' % ( diff --git a/docutils/docutils/writers/odf_odt/__init__.py b/docutils/docutils/writers/odf_odt/__init__.py index 61eab6f1b..c3da54356 100644 --- a/docutils/docutils/writers/odf_odt/__init__.py +++ b/docutils/docutils/writers/odf_odt/__init__.py @@ -1433,14 +1433,14 @@ def split_field_specifiers_iter(self, text): if mo: pos2 = mo.start() if pos2 > pos1: - yield (ODFTranslator.code_text, text[pos1:pos2]) - yield (ODFTranslator.code_field, mo.group(1)) + yield ODFTranslator.code_text, text[pos1:pos2] + yield ODFTranslator.code_field, mo.group(1) pos1 = mo.end() else: break trailing = text[pos1:] if trailing: - yield (ODFTranslator.code_text, trailing) + yield ODFTranslator.code_text, trailing def astext(self): root = self.content_tree.getroot() diff --git a/docutils/test/test_error_reporting.py b/docutils/test/test_error_reporting.py index d5c7935da..f8971093b 100644 --- a/docutils/test/test_error_reporting.py +++ b/docutils/test/test_error_reporting.py @@ -241,7 +241,7 @@ class ErrorReportingTests(unittest.TestCase): document = utils.new_document('test data', settings) def test_include(self): - source = ('.. include:: bogus.txt') + source = '.. include:: bogus.txt' self.assertRaises(utils.SystemMessage, self.parser.parse, source, self.document) diff --git a/docutils/test/test_io.py b/docutils/test/test_io.py index 725d29a0d..b094cac5b 100755 --- a/docutils/test/test_io.py +++ b/docutils/test/test_io.py @@ -215,7 +215,7 @@ def test_encoding_clash_resolved(self): self.udata.encode('latin1')) def test_encoding_clash_nonresolvable(self): - del(self.mock_stdout.buffer) + del self.mock_stdout.buffer fo = io.FileOutput(destination=self.mock_stdout, encoding='latin1', autoclose=False) self.assertRaises(ValueError, fo.write, self.udata) diff --git a/docutils/test/test_language.py b/docutils/test/test_language.py index ac3266953..5b1368b79 100755 --- a/docutils/test/test_language.py +++ b/docutils/test/test_language.py @@ -102,7 +102,7 @@ def _xor(self, ref_dict, l_dict): for label in l_dict.keys(): if label not in ref_dict: too_much.append(label) - return (missing, too_much) + return missing, too_much def _invert(self, adict): """Return an inverted (keys & values swapped) dictionary.""" diff --git a/docutils/test/test_writers/test_html4css1_misc.py b/docutils/test/test_writers/test_html4css1_misc.py index b13b680b2..69b1f2509 100755 --- a/docutils/test/test_writers/test_html4css1_misc.py +++ b/docutils/test/test_writers/test_html4css1_misc.py @@ -143,7 +143,7 @@ class MathTestCase(DocutilsTestSupport.StandardTestCase): mathjax_script = '<script type="text/javascript" src="%s">' default_mathjax_url = ('file:/usr/share/javascript/mathjax/MathJax.js' '?config=TeX-AMS_CHTML') - custom_mathjax_url = ('/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML') + custom_mathjax_url = '/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML' data = ':math:`42`' def test_math_output_default(self): diff --git a/docutils/test/test_writers/test_html5_polyglot_misc.py b/docutils/test/test_writers/test_html5_polyglot_misc.py index bee9a1ebd..1c029743c 100644 --- a/docutils/test/test_writers/test_html5_polyglot_misc.py +++ b/docutils/test/test_writers/test_html5_polyglot_misc.py @@ -158,7 +158,7 @@ class MathTestCase(DocutilsTestSupport.StandardTestCase): mathjax_script = '<script type="text/javascript" src="%s">' default_mathjax_url = ('file:/usr/share/javascript/mathjax/MathJax.js' '?config=TeX-AMS_CHTML') - custom_mathjax_url = ('/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML') + custom_mathjax_url = '/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML' data = ':math:`42`' def test_math_output_default(self): diff --git a/docutils/test/test_writers/test_html5_polyglot_parts.py b/docutils/test/test_writers/test_html5_polyglot_parts.py index 13a88dd5f..575c5485b 100644 --- a/docutils/test/test_writers/test_html5_polyglot_parts.py +++ b/docutils/test/test_writers/test_html5_polyglot_parts.py @@ -27,7 +27,7 @@ class Html5WriterPublishPartsTestCase(HtmlWriterPublishPartsTestCase): settings_default_overrides = HtmlWriterPublishPartsTestCase.settings_default_overrides.copy() settings_default_overrides['section_self_link'] = True - standard_content_type_template = ('<meta charset="%s"/>\n') + standard_content_type_template = '<meta charset="%s"/>\n' standard_generator_template = ('<meta name="generator"' ' content="Docutils %s: https://docutils.sourceforge.io/" />\n') standard_viewport_template = ('<meta name="viewport"' diff --git a/docutils/tools/test/test_buildhtml.py b/docutils/tools/test/test_buildhtml.py index b362239ec..53e6791ef 100644 --- a/docutils/tools/test/test_buildhtml.py +++ b/docutils/tools/test/test_buildhtml.py @@ -54,7 +54,7 @@ def process_and_return_filelist(options): cin.close() cout.close() p.wait() - return (dirs, files) + return dirs, files class BuildHtmlTests(unittest.TestCase): tree = ( "_tmp_test_tree", From da274e2e6f17df07014e10401ceccf6e54a8dced Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Tue, 25 Jan 2022 21:56:38 +0000 Subject: [PATCH 32/36] Fix seemingly no-op statements --- docutils/test/test_language.py | 3 +-- docutils/test/test_writers/test_html5_polyglot_parts.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docutils/test/test_language.py b/docutils/test/test_language.py index 5b1368b79..7e2654ba1 100755 --- a/docutils/test/test_language.py +++ b/docutils/test/test_language.py @@ -175,11 +175,10 @@ def test_roles(self): self.language) if not module: raise ImportError - module.roles except ImportError: self.fail('No docutils.parsers.rst.languages.%s module.' % self.language) - except AttributeError: + if not hasattr(module, "roles"): self.fail('No "roles" mapping in docutils.parsers.rst.languages.' '%s module.' % self.language) failures = [] diff --git a/docutils/test/test_writers/test_html5_polyglot_parts.py b/docutils/test/test_writers/test_html5_polyglot_parts.py index 575c5485b..bbcbac59d 100644 --- a/docutils/test/test_writers/test_html5_polyglot_parts.py +++ b/docutils/test/test_writers/test_html5_polyglot_parts.py @@ -599,7 +599,6 @@ def suite(): </main>\\n''', 'html_head': '''...<title><string>\\n'''} """], -]) ["""\ .. figure:: dummy.png @@ -620,6 +619,7 @@ def suite(): \\n''', 'html_head': '''...<string>\\n'''} """], +]) totest['lazy loading'] = ({'image_loading': 'lazy', From 863b86c8046a48a765ced98ff44d1aa3ef1ddc33 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Tue, 25 Jan 2022 21:58:00 +0000 Subject: [PATCH 33/36] Use "is" to check for None --- docutils/docutils/nodes.py | 8 ++++---- docutils/docutils/utils/__init__.py | 2 +- docutils/docutils/utils/math/math2html.py | 2 +- docutils/docutils/writers/_html_base.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docutils/docutils/nodes.py b/docutils/docutils/nodes.py index e8b51157e..d7ca41bd7 100644 --- a/docutils/docutils/nodes.py +++ b/docutils/docutils/nodes.py @@ -1362,7 +1362,7 @@ def set_id(self, node, msgnode=None, suggested_prefix=''): self.ids.setdefault(id, node) if self.ids[id] is not node: msg = self.reporter.severe('Duplicate ID: "%s".' % id) - if msgnode != None: + if msgnode is not None: msgnode += msg return id # generate and set id @@ -1461,7 +1461,7 @@ def set_duplicate_name_id(self, node, id, name, msgnode, explicit): msg = self.reporter.system_message( level, 'Duplicate explicit target name: "%s".' % name, backrefs=[id], base_node=node) - if msgnode != None: + if msgnode is not None: msgnode += msg dupname(node, name) else: @@ -1479,7 +1479,7 @@ def set_duplicate_name_id(self, node, id, name, msgnode, explicit): msg = self.reporter.info( 'Duplicate implicit target name: "%s".' % name, backrefs=[id], base_node=node) - if msgnode != None: + if msgnode is not None: msgnode += msg def has_name(self, name): @@ -1547,7 +1547,7 @@ def note_substitution_def(self, subdef, def_name, msgnode=None): msg = self.reporter.error( 'Duplicate substitution definition name: "%s".' % name, base_node=subdef) - if msgnode != None: + if msgnode is not None: msgnode += msg oldnode = self.substitution_defs[name] dupname(oldnode, name) diff --git a/docutils/docutils/utils/__init__.py b/docutils/docutils/utils/__init__.py index a756d0033..040edf455 100644 --- a/docutils/docutils/utils/__init__.py +++ b/docutils/docutils/utils/__init__.py @@ -494,7 +494,7 @@ def get_stylesheet_reference(settings, relative_to=None): if settings.stylesheet_path: assert not settings.stylesheet, ( 'stylesheet and stylesheet_path are mutually exclusive.') - if relative_to == None: + if relative_to is None: relative_to = settings._destination return relative_path(relative_to, settings.stylesheet_path) else: diff --git a/docutils/docutils/utils/math/math2html.py b/docutils/docutils/utils/math/math2html.py index a4caaa52f..68fac706d 100755 --- a/docutils/docutils/utils/math/math2html.py +++ b/docutils/docutils/utils/math/math2html.py @@ -899,7 +899,7 @@ class ContentsOutput(ContainerOutput): def gethtml(self, container): "Return the HTML code" html = [] - if container.contents == None: + if container.contents is None: return html for element in container.contents: if not hasattr(element, 'gethtml'): diff --git a/docutils/docutils/writers/_html_base.py b/docutils/docutils/writers/_html_base.py index 414c7d896..ff45d2b79 100644 --- a/docutils/docutils/writers/_html_base.py +++ b/docutils/docutils/writers/_html_base.py @@ -308,13 +308,13 @@ def __init__(self, document): warnings.warn('The configuration setting "embed_images" ' 'will be removed in Docutils 1.2. Use "image_loading: embed".', FutureWarning, stacklevel=8) - if self.image_loading == None: + if self.image_loading is None: self.image_loading = 'embed' if getattr(settings, 'embed_images', None) is False: warnings.warn('The configuration setting "embed_images" ' 'will be removed in Docutils 1.2. Use "image_loading: link".', FutureWarning, stacklevel=8) - if self.image_loading == None: + if self.image_loading is None: self.image_loading = 'link' # default self.math_output = settings.math_output.split() self.math_output_options = self.math_output[1:] From c974b9fadc0f2886abc4092f4b3c193d6df8409e Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Tue, 25 Jan 2022 22:10:11 +0000 Subject: [PATCH 34/36] Use "x not in y" over "not x in y" --- docutils/docutils/nodes.py | 2 +- .../parsers/rst/directives/admonitions.py | 2 +- docutils/docutils/utils/__init__.py | 6 +++--- docutils/docutils/utils/math/math2html.py | 18 +++++++++--------- docutils/docutils/writers/_html_base.py | 7 ++++--- .../docutils/writers/html4css1/__init__.py | 2 +- docutils/docutils/writers/latex2e/__init__.py | 4 ++-- docutils/docutils/writers/manpage.py | 2 +- docutils/docutils/writers/odf_odt/__init__.py | 6 +++--- docutils/tools/test/test_buildhtml.py | 4 ++-- 10 files changed, 27 insertions(+), 26 deletions(-) diff --git a/docutils/docutils/nodes.py b/docutils/docutils/nodes.py index d7ca41bd7..4eb75c96b 100644 --- a/docutils/docutils/nodes.py +++ b/docutils/docutils/nodes.py @@ -765,7 +765,7 @@ def append_attr_list(self, attr, values): """ # List Concatenation for value in values: - if not value in self[attr]: + if value not in self[attr]: self[attr].append(value) def coerce_append_attr_list(self, attr, value): diff --git a/docutils/docutils/parsers/rst/directives/admonitions.py b/docutils/docutils/parsers/rst/directives/admonitions.py index fade06b79..8d04f4f2d 100644 --- a/docutils/docutils/parsers/rst/directives/admonitions.py +++ b/docutils/docutils/parsers/rst/directives/admonitions.py @@ -40,7 +40,7 @@ def run(self): self.state_machine.get_source_and_line(self.lineno)) admonition_node += title admonition_node += messages - if not 'classes' in self.options: + if 'classes' not in self.options: admonition_node['classes'] += ['admonition-' + nodes.make_id(title_text)] self.state.nested_parse(self.content, self.content_offset, diff --git a/docutils/docutils/utils/__init__.py b/docutils/docutils/utils/__init__.py index 040edf455..90ad0c261 100644 --- a/docutils/docutils/utils/__init__.py +++ b/docutils/docutils/utils/__init__.py @@ -168,7 +168,7 @@ def system_message(self, level, message, *children, **kwargs): if line is not None: attributes.setdefault('line', line) # assert source is not None, "node has line- but no source-argument" - if not 'source' in attributes: # 'line' is absolute line number + if 'source' not in attributes: # 'line' is absolute line number try: # look up (source, line-in-source) source, line = self.get_source_and_line(attributes.get('line')) except AttributeError: @@ -648,7 +648,7 @@ def column_width(text): def uniq(L): r = [] for item in L: - if not item in r: + if item not in r: r.append(item) return r @@ -727,7 +727,7 @@ def add(self, *filenames): is not None. """ for filename in filenames: - if not filename in self.list: + if filename not in self.list: self.list.append(filename) if self.file is not None: self.file.write(filename+'\n') diff --git a/docutils/docutils/utils/math/math2html.py b/docutils/docutils/utils/math/math2html.py index 68fac706d..1c94b39a8 100755 --- a/docutils/docutils/utils/math/math2html.py +++ b/docutils/docutils/utils/math/math2html.py @@ -753,7 +753,7 @@ def parseparameter(self, reader): if len(split) == 1: self.parameters[key] = True return - if not '"' in split[1]: + if '"' not in split[1]: self.parameters[key] = split[1].strip() return doublesplit = split[1].split('"') @@ -1414,7 +1414,7 @@ def tree(self, level = 0): def getparameter(self, name): "Get the value of a parameter, if present." - if not name in self.parameters: + if name not in self.parameters: return None return self.parameters[name] @@ -1591,7 +1591,7 @@ def parseformula(self, reader): def parsesingleliner(self, reader, start, ending): "Parse a formula in one line" line = reader.currentline().strip() - if not start in line: + if start not in line: Trace.error('Line ' + line + ' does not contain formula start ' + start) return '' if not line.endswith(ending): @@ -1606,7 +1606,7 @@ def parsemultiliner(self, reader, start, ending): "Parse a formula in multiple lines" formula = '' line = reader.currentline() - if not start in line: + if start not in line: Trace.error('Line ' + line.strip() + ' does not contain formula start ' + start) return '' index = line.index(start) @@ -2051,7 +2051,7 @@ def detecttype(self, type, pos): def instance(self, type): "Get an instance of the given type." - if not type in self.instances or not self.instances[type]: + if type not in self.instances or not self.instances[type]: self.instances[type] = self.create(type) return self.instances[type] @@ -2947,7 +2947,7 @@ def paramdefs(self, readtemplate): def getparam(self, name): "Get a parameter as parsed." - if not name in self.params: + if name not in self.params: return None return self.params[name] @@ -3018,7 +3018,7 @@ def writepos(self, pos): def writeparam(self, pos): "Write a single param of the form $0, $x..." name = '$' + pos.skipcurrent() - if not name in self.params: + if name not in self.params: Trace.error('Unknown parameter ' + name) return None if not self.params[name]: @@ -3055,7 +3055,7 @@ def readtag(self, pos): Trace.error('Function f' + str(index) + ' is not defined') return None tag = self.translated[2 + index] - if not '$' in tag: + if '$' not in tag: return tag for variable in self.params: if variable in tag: @@ -3076,7 +3076,7 @@ def writebracket(self, direction, character): def computehybridsize(self): "Compute the size of the hybrid function." - if not self.command in HybridSize.configsizes: + if self.command not in HybridSize.configsizes: self.computesize() return self.size = HybridSize().getsize(self) diff --git a/docutils/docutils/writers/_html_base.py b/docutils/docutils/writers/_html_base.py index ff45d2b79..e998cfb74 100644 --- a/docutils/docutils/writers/_html_base.py +++ b/docutils/docutils/writers/_html_base.py @@ -996,7 +996,7 @@ def visit_image(self, node): if 'height' in node: atts['height'] = node['height'] if 'scale' in node: - if (PIL and not ('width' in node and 'height' in node) + if (PIL and ('width' not in node or 'height' not in node) and self.settings.file_insertion_enabled): imagepath = url2pathname(uri) try: @@ -1568,8 +1568,9 @@ def depart_table(self, node): self.body.append('
\n') def visit_target(self, node): - if not ('refuri' in node or 'refid' in node - or 'refname' in node): + if ('refuri' not in node + and 'refid' not in node + and 'refname' not in node): self.body.append(self.starttag(node, 'span', '', CLASS='target')) self.context.append('') else: diff --git a/docutils/docutils/writers/html4css1/__init__.py b/docutils/docutils/writers/html4css1/__init__.py index 235b275bd..5054d6f24 100644 --- a/docutils/docutils/writers/html4css1/__init__.py +++ b/docutils/docutils/writers/html4css1/__init__.py @@ -560,7 +560,7 @@ def visit_image(self, node): if 'height' in node: atts['height'] = node['height'] if 'scale' in node: - if (PIL and not ('width' in node and 'height' in node) + if (PIL and ('width' not in node or 'height' not in node) and self.settings.file_insertion_enabled): imagepath = url2pathname(uri) try: diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py index 7df7ced0c..06cc2e47c 100644 --- a/docutils/docutils/writers/latex2e/__init__.py +++ b/docutils/docutils/writers/latex2e/__init__.py @@ -2383,7 +2383,7 @@ def visit_image(self, node): # Convert image URI to a local file path imagepath = url2pathname(attrs['uri']).replace('\\', '/') # alignment defaults: - if not 'align' in attrs: + if 'align' not in attrs: # Set default align of image in a figure to 'center' if isinstance(node.parent, nodes.figure): attrs['align'] = 'center' @@ -2761,7 +2761,7 @@ def depart_problematic(self, node): self.out.append('}}') def visit_raw(self, node): - if not 'latex' in node.get('format', '').split(): + if 'latex' not in node.get('format', '').split(): raise nodes.SkipNode if not (self.is_inline(node) or isinstance(node.parent, nodes.compound)): diff --git a/docutils/docutils/writers/manpage.py b/docutils/docutils/writers/manpage.py index f4d9f8564..90a5160b5 100644 --- a/docutils/docutils/writers/manpage.py +++ b/docutils/docutils/writers/manpage.py @@ -599,7 +599,7 @@ def depart_document(self, node): self._docinfo[name], self.defs['indent'][1], self.defs['indent'][1])) - elif not name in skip: + elif name not in skip: if name in self._docinfo_names: label = self._docinfo_names[name] else: diff --git a/docutils/docutils/writers/odf_odt/__init__.py b/docutils/docutils/writers/odf_odt/__init__.py index c3da54356..6f574aaf2 100644 --- a/docutils/docutils/writers/odf_odt/__init__.py +++ b/docutils/docutils/writers/odf_odt/__init__.py @@ -3175,9 +3175,9 @@ def visit_target(self, node): # # I don't know how to implement targets in ODF. # How do we create a target in oowriter? A cross-reference? - if not ('refuri' in node or - 'refid' in node or - 'refname' in node): + if ('refuri' not in node + and 'refid' not in node + and 'refname' not in node): pass else: pass diff --git a/docutils/tools/test/test_buildhtml.py b/docutils/tools/test/test_buildhtml.py index 53e6791ef..808d02720 100644 --- a/docutils/tools/test/test_buildhtml.py +++ b/docutils/tools/test/test_buildhtml.py @@ -76,7 +76,7 @@ def setUp(self): for s in self.tree: s = os.path.join(self.root, s) - if not "." in s: + if "." not in s: os.mkdir(s) else: fd_s = open(s, "w") @@ -86,7 +86,7 @@ def setUp(self): def tearDown(self): for i in range(len(self.tree) - 1, -1, -1): s = os.path.join(self.root, self.tree[i]) - if not "." in s: + if "." not in s: os.rmdir(s) else: os.remove(s) From b765d94f5ef0a5385df860e249c72369af594d6f Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Tue, 25 Jan 2022 23:00:30 +0000 Subject: [PATCH 35/36] Skip assigning to a variable when immediately returning --- docutils/docutils/nodes.py | 3 +- .../parsers/rst/directives/__init__.py | 6 +-- docutils/docutils/parsers/rst/states.py | 3 +- docutils/docutils/parsers/rst/tableparser.py | 6 +-- docutils/docutils/readers/__init__.py | 3 +- docutils/docutils/statemachine.py | 3 +- docutils/docutils/transforms/frontmatter.py | 3 +- docutils/docutils/utils/__init__.py | 3 +- docutils/docutils/utils/math/math2html.py | 3 +- .../docutils/utils/math/tex2mathml_extern.py | 3 +- docutils/docutils/utils/smartquotes.py | 18 +++------ docutils/docutils/writers/__init__.py | 3 +- docutils/docutils/writers/_html_base.py | 3 +- docutils/docutils/writers/latex2e/__init__.py | 3 +- docutils/docutils/writers/manpage.py | 3 +- docutils/docutils/writers/odf_odt/__init__.py | 39 +++++++------------ docutils/setup.py | 3 +- docutils/test/test_writers/test_odt.py | 3 +- docutils/tools/quicktest.py | 3 +- 19 files changed, 38 insertions(+), 76 deletions(-) diff --git a/docutils/docutils/nodes.py b/docutils/docutils/nodes.py index 4eb75c96b..4f2114e15 100644 --- a/docutils/docutils/nodes.py +++ b/docutils/docutils/nodes.py @@ -682,8 +682,7 @@ def non_default_attributes(self): return atts def attlist(self): - attlist = sorted(self.non_default_attributes().items()) - return attlist + return sorted(self.non_default_attributes().items()) def get(self, key, failobj=None): return self.attributes.get(key, failobj) diff --git a/docutils/docutils/parsers/rst/directives/__init__.py b/docutils/docutils/parsers/rst/directives/__init__.py index 2c2bbe7c2..3385d62e5 100644 --- a/docutils/docutils/parsers/rst/directives/__init__.py +++ b/docutils/docutils/parsers/rst/directives/__init__.py @@ -184,8 +184,7 @@ def path(argument): if argument is None: raise ValueError('argument required but none supplied') else: - path = ''.join(s.strip() for s in argument.splitlines()) - return path + return ''.join(s.strip() for s in argument.splitlines()) def uri(argument): """ @@ -198,8 +197,7 @@ def uri(argument): raise ValueError('argument required but none supplied') else: parts = split_escaped_whitespace(escape2null(argument)) - uri = ' '.join(''.join(unescape(part).split()) for part in parts) - return uri + return ' '.join(''.join(unescape(part).split()) for part in parts) def nonnegative_int(argument): """ diff --git a/docutils/docutils/parsers/rst/states.py b/docutils/docutils/parsers/rst/states.py index b202d1456..b1db3f138 100644 --- a/docutils/docutils/parsers/rst/states.py +++ b/docutils/docutils/parsers/rst/states.py @@ -1487,8 +1487,7 @@ def field(self, match): def parse_field_marker(self, match): """Extract & return field name from a field marker match.""" field = match.group()[1:] # strip off leading ':' - field = field[:field.rfind(':')] # strip off trailing ':' etc. - return field + return field[:field.rfind(':')] # strip off trailing ':' etc. def parse_field_body(self, indented, offset, node): self.nested_parse(indented, input_offset=offset, node=node) diff --git a/docutils/docutils/parsers/rst/tableparser.py b/docutils/docutils/parsers/rst/tableparser.py index d2b1cde0c..f6a7e95c5 100644 --- a/docutils/docutils/parsers/rst/tableparser.py +++ b/docutils/docutils/parsers/rst/tableparser.py @@ -65,8 +65,7 @@ def parse(self, block): self.setup(block) self.find_head_body_sep() self.parse_table() - structure = self.structure_from_cells() - return structure + return self.structure_from_cells() def find_head_body_sep(self): """Look for a head/body row separator line; store the line index.""" @@ -209,8 +208,7 @@ def check_parse_complete(self): def scan_cell(self, top, left): """Starting at the top-left corner, start tracing out a cell.""" assert self.block[top][left] == '+' - result = self.scan_right(top, left) - return result + return self.scan_right(top, left) def scan_right(self, top, left): """ diff --git a/docutils/docutils/readers/__init__.py b/docutils/docutils/readers/__init__.py index 366cfebe9..77e95169b 100644 --- a/docutils/docutils/readers/__init__.py +++ b/docutils/docutils/readers/__init__.py @@ -80,8 +80,7 @@ def parse(self): def new_document(self): """Create and return a new empty document tree (root node).""" - document = utils.new_document(self.source.source_path, self.settings) - return document + return utils.new_document(self.source.source_path, self.settings) class ReReader(Reader): diff --git a/docutils/docutils/statemachine.py b/docutils/docutils/statemachine.py index 5785b099c..94ab44d33 100644 --- a/docutils/docutils/statemachine.py +++ b/docutils/docutils/statemachine.py @@ -1498,8 +1498,7 @@ def string2lines(astring, tab_width=8, convert_whitespace=False, """ if convert_whitespace: astring = whitespace.sub(' ', astring) - lines = [s.expandtabs(tab_width).rstrip() for s in astring.splitlines()] - return lines + return [s.expandtabs(tab_width).rstrip() for s in astring.splitlines()] def _exception_data(): """ diff --git a/docutils/docutils/transforms/frontmatter.py b/docutils/docutils/transforms/frontmatter.py index cdd1d8676..0180da380 100644 --- a/docutils/docutils/transforms/frontmatter.py +++ b/docutils/docutils/transforms/frontmatter.py @@ -520,8 +520,7 @@ def authors_from_one_paragraph(self, field): if len(authornames) > 1: break authornames = (name.strip() for name in authornames) - authors = [[nodes.Text(name)] for name in authornames if name] - return authors + return [[nodes.Text(name)] for name in authornames if name] def authors_from_bullet_list(self, field): authors = [] diff --git a/docutils/docutils/utils/__init__.py b/docutils/docutils/utils/__init__.py index 90ad0c261..69b82e3fe 100644 --- a/docutils/docutils/utils/__init__.py +++ b/docutils/docutils/utils/__init__.py @@ -262,8 +262,7 @@ def extract_extension_options(field_list, options_spec): missing data, bad quotes, etc.). """ option_list = extract_options(field_list) - option_dict = assemble_option_dict(option_list, options_spec) - return option_dict + return assemble_option_dict(option_list, options_spec) def extract_options(field_list): """ diff --git a/docutils/docutils/utils/math/math2html.py b/docutils/docutils/utils/math/math2html.py index 1c94b39a8..0c7b62303 100755 --- a/docutils/docutils/utils/math/math2html.py +++ b/docutils/docutils/utils/math/math2html.py @@ -1479,8 +1479,7 @@ def replacespecial(self, line): return replaced def changeline(self, line): - line = self.escape(line, EscapeConfig.chars) - return line + return self.escape(line, EscapeConfig.chars) def extracttext(self): "Return all text." diff --git a/docutils/docutils/utils/math/tex2mathml_extern.py b/docutils/docutils/utils/math/tex2mathml_extern.py index f2fd95b23..ee759fe87 100644 --- a/docutils/docutils/utils/math/tex2mathml_extern.py +++ b/docutils/docutils/utils/math/tex2mathml_extern.py @@ -96,8 +96,7 @@ def ttm(math_code, reporter=None): if reporter and err.find('**** Error') >= 0 or not result: reporter.error(err) start, end = result.find('')+7 - result = result[start:end] - return result + return result[start:end] def blahtexml(math_code, inline=True, reporter=None): """Convert LaTeX math code to MathML with blahtexml_ diff --git a/docutils/docutils/utils/smartquotes.py b/docutils/docutils/utils/smartquotes.py index 8bff85880..f975c83db 100644 --- a/docutils/docutils/utils/smartquotes.py +++ b/docutils/docutils/utils/smartquotes.py @@ -728,8 +728,7 @@ def educateBackticks(text, language='en'): smart = smartchars(language) text = re.sub(r"""``""", smart.opquote, text) - text = re.sub(r"""''""", smart.cpquote, text) - return text + return re.sub(r"""''""", smart.cpquote, text) def educateSingleBackticks(text, language='en'): @@ -744,8 +743,7 @@ def educateSingleBackticks(text, language='en'): smart = smartchars(language) text = re.sub(r"""`""", smart.osquote, text) - text = re.sub(r"""'""", smart.csquote, text) - return text + return re.sub(r"""'""", smart.csquote, text) def educateDashes(text): @@ -756,8 +754,7 @@ def educateDashes(text): """ text = re.sub(r"""---""", smartchars.endash, text) # en (yes, backwards) - text = re.sub(r"""--""", smartchars.emdash, text) # em (yes, backwards) - return text + return re.sub(r"""--""", smartchars.emdash, text) # em (yes, backwards) def educateDashesOldSchool(text): @@ -769,8 +766,7 @@ def educateDashesOldSchool(text): """ text = re.sub(r"""---""", smartchars.emdash, text) - text = re.sub(r"""--""", smartchars.endash, text) - return text + return re.sub(r"""--""", smartchars.endash, text) def educateDashesOldSchoolInverted(text): @@ -788,8 +784,7 @@ def educateDashesOldSchoolInverted(text): Swartz for the idea.) """ text = re.sub(r"""---""", smartchars.endash, text) # em - text = re.sub(r"""--""", smartchars.emdash, text) # en - return text + return re.sub(r"""--""", smartchars.emdash, text) # en @@ -804,8 +799,7 @@ def educateEllipses(text): """ text = re.sub(r"""\.\.\.""", smartchars.ellipsis, text) - text = re.sub(r"""\. \. \.""", smartchars.ellipsis, text) - return text + return re.sub(r"""\. \. \.""", smartchars.ellipsis, text) def stupefyEntities(text, language='en'): diff --git a/docutils/docutils/writers/__init__.py b/docutils/docutils/writers/__init__.py index 7045dba1e..48e22fb0a 100644 --- a/docutils/docutils/writers/__init__.py +++ b/docutils/docutils/writers/__init__.py @@ -76,8 +76,7 @@ def write(self, document, destination): document.reporter) self.destination = destination self.translate() - output = self.destination.write(self.output) - return output + return self.destination.write(self.output) def translate(self): """ diff --git a/docutils/docutils/writers/_html_base.py b/docutils/docutils/writers/_html_base.py index e998cfb74..7327f73c3 100644 --- a/docutils/docutils/writers/_html_base.py +++ b/docutils/docutils/writers/_html_base.py @@ -371,8 +371,7 @@ def cloak_email(self, addr): # Surround at-signs and periods with tags. ("@" has # already been encoded to "@" by the `encode` method.) addr = addr.replace('@', '@') - addr = addr.replace('.', '.') - return addr + return addr.replace('.', '.') def attval(self, text, whitespace=re.compile('[\n\r\t\v\f]')): diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py index 06cc2e47c..217e12867 100644 --- a/docutils/docutils/writers/latex2e/__init__.py +++ b/docutils/docutils/writers/latex2e/__init__.py @@ -481,8 +481,7 @@ class SortableDict(dict): """ def sortedkeys(self): """Return sorted list of keys""" - keys = sorted(self.keys()) - return keys + return sorted(self.keys()) def sortedvalues(self): """Return list of values sorted by keys""" diff --git a/docutils/docutils/writers/manpage.py b/docutils/docutils/writers/manpage.py index 90a5160b5..fc1a7302f 100644 --- a/docutils/docutils/writers/manpage.py +++ b/docutils/docutils/writers/manpage.py @@ -275,8 +275,7 @@ def astext(self): def deunicode(self, text): text = text.replace('\xa0', '\\ ') - text = text.replace('\u2020', '\\(dg') - return text + return text.replace('\u2020', '\\(dg') def visit_Text(self, node): text = node.astext() diff --git a/docutils/docutils/writers/odf_odt/__init__.py b/docutils/docutils/writers/odf_odt/__init__.py index 6f574aaf2..81bf4b588 100644 --- a/docutils/docutils/writers/odf_odt/__init__.py +++ b/docutils/docutils/writers/odf_odt/__init__.py @@ -254,8 +254,7 @@ def Element(tag, attrib=None, nsmap=None, nsdict=CNSD): if attrib is None: attrib = {} tag, attrib = fix_ns(tag, attrib, nsdict) - el = _ElementInterfaceWrapper(tag, attrib) - return el + return _ElementInterfaceWrapper(tag, attrib) def SubElement(parent, tag, attrib=None, nsmap=None, nsdict=CNSD): @@ -679,8 +678,7 @@ def get_stylesheet(self): """Get the stylesheet from the visitor. Ask the visitor to setup the page. """ - s1 = self.visitor.setup_page() - return s1 + return self.visitor.setup_page() def copy_from_stylesheet(self, outzipfile): """Copy images, settings, etc from the stylesheet doc into target doc. @@ -730,8 +728,7 @@ def create_manifest(self): }, nsdict=MANNSD) s1 = ToString(doc) doc = minidom.parseString(s1) - s1 = doc.toprettyxml(' ') - return s1 + return doc.toprettyxml(' ') def create_meta(self): root = Element( @@ -1050,8 +1047,7 @@ def rststyle(self, name, parameters=()): the value. """ name1 = name % parameters - stylename = self.format_map.get(name1, 'rststyle-%s' % name1) - return stylename + return self.format_map.get(name1, 'rststyle-%s' % name1) def generate_content_element(self, root): return SubElement(root, 'office:text') @@ -1063,8 +1059,7 @@ def setup_page(self): self.settings.custom_header or self.settings.custom_footer): self.add_header_footer(self.dom_stylesheet) - new_content = etree.tostring(self.dom_stylesheet) - return new_content + return etree.tostring(self.dom_stylesheet) def get_dom_stylesheet(self): return self.dom_stylesheet @@ -1445,8 +1440,7 @@ def split_field_specifiers_iter(self, text): def astext(self): root = self.content_tree.getroot() et = etree.ElementTree(root) - s1 = ToString(et) - return s1 + return ToString(et) def content_astext(self): return self.astext() @@ -1507,8 +1501,7 @@ def process_footnotes(self): def append_child(self, tag, attrib=None, parent=None): if parent is None: parent = self.current_element - el = SubElement(parent, tag, attrib) - return el + return SubElement(parent, tag, attrib) def append_p(self, style, text=None): result = self.append_child('text:p', attrib={ @@ -1538,8 +1531,7 @@ def generate_labeled_block(self, node, label): el, 'text:span', attrib={'text:style-name': self.rststyle('strong')}) el1.text = label - el = self.append_p('blockindent') - return el + return self.append_p('blockindent') def generate_labeled_line(self, node, label): label = '%s:' % (self.language.labels[label], ) @@ -1552,8 +1544,7 @@ def generate_labeled_line(self, node, label): return el def encode(self, text): - text = text.replace('\n', " ") - return text + return text.replace('\n', " ") # # Visitor functions @@ -2603,23 +2594,19 @@ def _add_syntax_highlighting(self, insource, language): lambda name, parameters=(): self.rststyle(name, parameters), escape_function=escape_cdata) - outsource = pygments.highlight(insource, lexer, fmtr) - return outsource + return pygments.highlight(insource, lexer, fmtr) def fill_line(self, line): line = FILL_PAT1.sub(self.fill_func1, line) - line = FILL_PAT2.sub(self.fill_func2, line) - return line + return FILL_PAT2.sub(self.fill_func2, line) def fill_func1(self, matchobj): spaces = matchobj.group(0) - repl = '' % (len(spaces), ) - return repl + return '' % (len(spaces), ) def fill_func2(self, matchobj): spaces = matchobj.group(0) - repl = ' ' % (len(spaces) - 1, ) - return repl + return ' ' % (len(spaces) - 1, ) def visit_literal_block(self, node): if len(self.paragraph_style_stack) > 1: diff --git a/docutils/setup.py b/docutils/setup.py index 32127cced..627a3e586 100755 --- a/docutils/setup.py +++ b/docutils/setup.py @@ -137,8 +137,7 @@ def do_setup(): # Install data files properly. - dist = setup(**package_data) - return dist + return setup(**package_data) if __name__ == '__main__': diff --git a/docutils/test/test_writers/test_odt.py b/docutils/test/test_writers/test_odt.py index 0e5f688a7..bc7dc8afc 100755 --- a/docutils/test/test_writers/test_odt.py +++ b/docutils/test/test_writers/test_odt.py @@ -106,8 +106,7 @@ def extract_file(self, payload, filename): doc = etree.fromstring(content1) self.reorder_attributes(doc) #content2 = doc.toprettyxml(indent=' ') - content2 = etree.tostring(doc) - return content2 + return etree.tostring(doc) def assertEqual(self, first, second, msg=None): if msg is None: diff --git a/docutils/tools/quicktest.py b/docutils/tools/quicktest.py index 5294cc9ce..ddac20053 100755 --- a/docutils/tools/quicktest.py +++ b/docutils/tools/quicktest.py @@ -104,8 +104,7 @@ def escape(text): """ text = text.replace('\\', '\\\\') # escape backslashes text = text.replace('"""', '""\\"') # break up triple-double-quotes - text = text.replace(' \n', ' \\n\\\n') # protect trailing whitespace - return text + return text.replace(' \n', ' \\n\\\n') # protect trailing whitespace _outputFormatters = { 'rawxml': _rawxml, From 27adf89291eeadaa7097346db8e5e3195633b69b Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Wed, 26 Jan 2022 00:07:19 +0000 Subject: [PATCH 36/36] Remove unused imports --- docutils/docutils/__init__.py | 1 - docutils/docutils/languages/__init__.py | 1 - docutils/docutils/nodes.py | 9 --------- docutils/docutils/parsers/__init__.py | 1 - docutils/docutils/parsers/rst/directives/__init__.py | 1 - docutils/docutils/parsers/rst/directives/images.py | 1 - docutils/docutils/parsers/rst/directives/misc.py | 1 - docutils/docutils/parsers/rst/directives/tables.py | 1 - docutils/docutils/parsers/rst/languages/__init__.py | 1 - docutils/docutils/parsers/rst/roles.py | 1 - docutils/docutils/parsers/rst/states.py | 1 - docutils/docutils/readers/__init__.py | 1 - docutils/docutils/readers/standalone.py | 1 - docutils/docutils/transforms/components.py | 4 ---- docutils/docutils/transforms/frontmatter.py | 1 - docutils/docutils/transforms/parts.py | 1 - docutils/docutils/transforms/peps.py | 1 - docutils/docutils/transforms/references.py | 2 -- docutils/docutils/transforms/universal.py | 1 - docutils/docutils/utils/math/latex2mathml.py | 2 -- docutils/docutils/utils/punctuation_chars.py | 2 +- docutils/docutils/writers/__init__.py | 1 - docutils/docutils/writers/_html_base.py | 1 - docutils/docutils/writers/docutils_xml.py | 1 - docutils/docutils/writers/html4css1/__init__.py | 1 - docutils/docutils/writers/latex2e/__init__.py | 1 - docutils/docutils/writers/manpage.py | 1 - docutils/docutils/writers/odf_odt/__init__.py | 2 -- docutils/docutils/writers/pep_html/__init__.py | 1 - docutils/docutils/writers/xetex/__init__.py | 2 -- docutils/setup.py | 2 -- docutils/test/DocutilsTestSupport.py | 1 - docutils/test/package_unittest.py | 1 - docutils/test/test__init__.py | 1 - docutils/test/test_dependencies.py | 1 - docutils/test/test_nodes.py | 1 - docutils/test/test_parsers/test_parser.py | 1 - docutils/test/test_parsers/test_recommonmark/__init__.py | 1 - .../test/test_parsers/test_recommonmark/test_misc.py | 2 -- .../test_rst/test_directives/test_include.py | 1 - .../test_parsers/test_rst/test_directives/test_raw.py | 1 - .../test_parsers/test_rst/test_directives/test_tables.py | 1 - .../test_rst/test_directives/test_unicode.py | 1 - docutils/test/test_publisher.py | 1 - docutils/test/test_writers/test_docutils_xml.py | 1 - docutils/tools/buildhtml.py | 1 - docutils/tools/rst2odt.py | 1 - 47 files changed, 1 insertion(+), 64 deletions(-) diff --git a/docutils/docutils/__init__.py b/docutils/docutils/__init__.py index 0ba21d499..be1804473 100644 --- a/docutils/docutils/__init__.py +++ b/docutils/docutils/__init__.py @@ -70,7 +70,6 @@ from collections import namedtuple -import sys class VersionInfo(namedtuple('VersionInfo', diff --git a/docutils/docutils/languages/__init__.py b/docutils/docutils/languages/__init__.py index 2c6cfb40d..524fc0e2e 100644 --- a/docutils/docutils/languages/__init__.py +++ b/docutils/docutils/languages/__init__.py @@ -11,7 +11,6 @@ __docformat__ = 'reStructuredText' -import sys from importlib import import_module from docutils.utils import normalize_language_tag diff --git a/docutils/docutils/nodes.py b/docutils/docutils/nodes.py index 4f2114e15..8aad20503 100644 --- a/docutils/docutils/nodes.py +++ b/docutils/docutils/nodes.py @@ -23,7 +23,6 @@ __docformat__ = 'reStructuredText' from collections import Counter -import os import re import sys import warnings @@ -1879,7 +1878,6 @@ class raw(Special, Inline, PreBibliographic, FixedTextElement): Raw data that is to be passed untouched to the Writer. """ - pass # ================= @@ -2132,7 +2130,6 @@ class TreePruningException(Exception): the tree traversed. """ - pass class SkipChildren(TreePruningException): @@ -2142,7 +2139,6 @@ class SkipChildren(TreePruningException): siblings and ``depart_...`` method are not affected. """ - pass class SkipSiblings(TreePruningException): @@ -2152,7 +2148,6 @@ class SkipSiblings(TreePruningException): current node's children and its ``depart_...`` method are not affected. """ - pass class SkipNode(TreePruningException): @@ -2162,7 +2157,6 @@ class SkipNode(TreePruningException): node's ``depart_...`` method. """ - pass class SkipDeparture(TreePruningException): @@ -2172,7 +2166,6 @@ class SkipDeparture(TreePruningException): children and siblings are not affected. """ - pass class NodeFound(TreePruningException): @@ -2183,7 +2176,6 @@ class NodeFound(TreePruningException): code. """ - pass class StopTraversal(TreePruningException): @@ -2196,7 +2188,6 @@ class StopTraversal(TreePruningException): caller. """ - pass def make_id(string): diff --git a/docutils/docutils/parsers/__init__.py b/docutils/docutils/parsers/__init__.py index 1f2a01633..657b540ff 100644 --- a/docutils/docutils/parsers/__init__.py +++ b/docutils/docutils/parsers/__init__.py @@ -8,7 +8,6 @@ __docformat__ = 'reStructuredText' -import sys from importlib import import_module from docutils import Component, frontend diff --git a/docutils/docutils/parsers/rst/directives/__init__.py b/docutils/docutils/parsers/rst/directives/__init__.py index 3385d62e5..994002db6 100644 --- a/docutils/docutils/parsers/rst/directives/__init__.py +++ b/docutils/docutils/parsers/rst/directives/__init__.py @@ -10,7 +10,6 @@ import re import codecs -import sys from importlib import import_module from docutils import nodes, parsers diff --git a/docutils/docutils/parsers/rst/directives/images.py b/docutils/docutils/parsers/rst/directives/images.py index 75d34893a..6122d2fda 100644 --- a/docutils/docutils/parsers/rst/directives/images.py +++ b/docutils/docutils/parsers/rst/directives/images.py @@ -8,7 +8,6 @@ __docformat__ = 'reStructuredText' -import sys from urllib.request import url2pathname try: # check for the Python Imaging Library diff --git a/docutils/docutils/parsers/rst/directives/misc.py b/docutils/docutils/parsers/rst/directives/misc.py index e25e838cc..5d67ce222 100644 --- a/docutils/docutils/parsers/rst/directives/misc.py +++ b/docutils/docutils/parsers/rst/directives/misc.py @@ -6,7 +6,6 @@ __docformat__ = 'reStructuredText' -import sys import os.path import re import time diff --git a/docutils/docutils/parsers/rst/directives/tables.py b/docutils/docutils/parsers/rst/directives/tables.py index 749a4b6f3..62eb73733 100644 --- a/docutils/docutils/parsers/rst/directives/tables.py +++ b/docutils/docutils/parsers/rst/directives/tables.py @@ -11,7 +11,6 @@ import csv import os.path -import sys import warnings from docutils import io, nodes, statemachine, utils diff --git a/docutils/docutils/parsers/rst/languages/__init__.py b/docutils/docutils/parsers/rst/languages/__init__.py index 35aed8543..bd57cfb29 100644 --- a/docutils/docutils/parsers/rst/languages/__init__.py +++ b/docutils/docutils/parsers/rst/languages/__init__.py @@ -12,7 +12,6 @@ __docformat__ = 'reStructuredText' -import sys from docutils.languages import LanguageImporter diff --git a/docutils/docutils/parsers/rst/roles.py b/docutils/docutils/parsers/rst/roles.py index 6fcbb2557..bdb0980b5 100644 --- a/docutils/docutils/parsers/rst/roles.py +++ b/docutils/docutils/parsers/rst/roles.py @@ -76,7 +76,6 @@ def role_fn(name, rawtext, text, lineno, inliner, __docformat__ = 'reStructuredText' -import warnings from docutils import nodes, utils from docutils.parsers.rst import directives diff --git a/docutils/docutils/parsers/rst/states.py b/docutils/docutils/parsers/rst/states.py index b1db3f138..5fe6e5037 100644 --- a/docutils/docutils/parsers/rst/states.py +++ b/docutils/docutils/parsers/rst/states.py @@ -103,7 +103,6 @@ __docformat__ = 'reStructuredText' -import sys import re from types import FunctionType, MethodType diff --git a/docutils/docutils/readers/__init__.py b/docutils/docutils/readers/__init__.py index 77e95169b..3b7e2adae 100644 --- a/docutils/docutils/readers/__init__.py +++ b/docutils/docutils/readers/__init__.py @@ -8,7 +8,6 @@ __docformat__ = 'reStructuredText' -import sys from importlib import import_module from docutils import utils, parsers, Component diff --git a/docutils/docutils/readers/standalone.py b/docutils/docutils/readers/standalone.py index 4996b49ce..9b698476d 100644 --- a/docutils/docutils/readers/standalone.py +++ b/docutils/docutils/readers/standalone.py @@ -9,7 +9,6 @@ __docformat__ = 'reStructuredText' -import sys from docutils import frontend, readers from docutils.transforms import frontmatter, references, misc diff --git a/docutils/docutils/transforms/components.py b/docutils/docutils/transforms/components.py index 70a7b5f94..99061d404 100644 --- a/docutils/docutils/transforms/components.py +++ b/docutils/docutils/transforms/components.py @@ -8,10 +8,6 @@ __docformat__ = 'reStructuredText' -import sys -import os -import re -import time from docutils import nodes, utils from docutils import ApplicationError, DataError from docutils.transforms import Transform, TransformError diff --git a/docutils/docutils/transforms/frontmatter.py b/docutils/docutils/transforms/frontmatter.py index 0180da380..9575277d0 100644 --- a/docutils/docutils/transforms/frontmatter.py +++ b/docutils/docutils/transforms/frontmatter.py @@ -22,7 +22,6 @@ __docformat__ = 'reStructuredText' import re -import sys from docutils import nodes, utils from docutils.transforms import TransformError, Transform diff --git a/docutils/docutils/transforms/parts.py b/docutils/docutils/transforms/parts.py index 670010e9e..c2c8ab3c4 100644 --- a/docutils/docutils/transforms/parts.py +++ b/docutils/docutils/transforms/parts.py @@ -9,7 +9,6 @@ __docformat__ = 'reStructuredText' -import re import sys from docutils import nodes, utils from docutils.transforms import TransformError, Transform diff --git a/docutils/docutils/transforms/peps.py b/docutils/docutils/transforms/peps.py index e1b12aae4..1204e5257 100644 --- a/docutils/docutils/transforms/peps.py +++ b/docutils/docutils/transforms/peps.py @@ -13,7 +13,6 @@ __docformat__ = 'reStructuredText' -import sys import os import re import time diff --git a/docutils/docutils/transforms/references.py b/docutils/docutils/transforms/references.py index 116b9543a..1d3b81c78 100644 --- a/docutils/docutils/transforms/references.py +++ b/docutils/docutils/transforms/references.py @@ -8,8 +8,6 @@ __docformat__ = 'reStructuredText' -import sys -import re from docutils import nodes, utils from docutils.transforms import TransformError, Transform diff --git a/docutils/docutils/transforms/universal.py b/docutils/docutils/transforms/universal.py index e5c478bdc..7f9173ab6 100644 --- a/docutils/docutils/transforms/universal.py +++ b/docutils/docutils/transforms/universal.py @@ -21,7 +21,6 @@ __docformat__ = 'reStructuredText' import re -import sys import time from docutils import nodes, utils from docutils.transforms import TransformError, Transform diff --git a/docutils/docutils/utils/math/latex2mathml.py b/docutils/docutils/utils/math/latex2mathml.py index 83a78633a..0e4b8e776 100644 --- a/docutils/docutils/utils/math/latex2mathml.py +++ b/docutils/docutils/utils/math/latex2mathml.py @@ -24,9 +24,7 @@ # # >>> from latex2mathml import * -import copy import re -import sys import unicodedata from docutils.utils.math import tex2unichar, toplevel_code diff --git a/docutils/docutils/utils/punctuation_chars.py b/docutils/docutils/utils/punctuation_chars.py index 46aa85eda..c77e2a034 100644 --- a/docutils/docutils/utils/punctuation_chars.py +++ b/docutils/docutils/utils/punctuation_chars.py @@ -14,7 +14,7 @@ # ``docutils/tools/dev/generate_punctuation_chars.py``. # :: -import sys, re +import sys import unicodedata """Docutils character category patterns. diff --git a/docutils/docutils/writers/__init__.py b/docutils/docutils/writers/__init__.py index 48e22fb0a..c2221412b 100644 --- a/docutils/docutils/writers/__init__.py +++ b/docutils/docutils/writers/__init__.py @@ -9,7 +9,6 @@ __docformat__ = 'reStructuredText' import os.path -import sys from importlib import import_module import docutils diff --git a/docutils/docutils/writers/_html_base.py b/docutils/docutils/writers/_html_base.py index 7327f73c3..9b161688b 100644 --- a/docutils/docutils/writers/_html_base.py +++ b/docutils/docutils/writers/_html_base.py @@ -20,7 +20,6 @@ import mimetypes import os, os.path import re -import sys from urllib.request import url2pathname import warnings diff --git a/docutils/docutils/writers/docutils_xml.py b/docutils/docutils/writers/docutils_xml.py index 188b3fe57..7acc3956e 100644 --- a/docutils/docutils/writers/docutils_xml.py +++ b/docutils/docutils/writers/docutils_xml.py @@ -11,7 +11,6 @@ __docformat__ = 'reStructuredText' from io import StringIO -import sys import xml.sax.saxutils import docutils diff --git a/docutils/docutils/writers/html4css1/__init__.py b/docutils/docutils/writers/html4css1/__init__.py index 5054d6f24..864739aa6 100644 --- a/docutils/docutils/writers/html4css1/__init__.py +++ b/docutils/docutils/writers/html4css1/__init__.py @@ -16,7 +16,6 @@ import os.path import re -import sys import docutils from docutils import frontend, nodes, writers, io from docutils.transforms import writer_aux diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py index 217e12867..eab742af2 100644 --- a/docutils/docutils/writers/latex2e/__init__.py +++ b/docutils/docutils/writers/latex2e/__init__.py @@ -15,7 +15,6 @@ import os import re import string -import sys from urllib.request import url2pathname import warnings diff --git a/docutils/docutils/writers/manpage.py b/docutils/docutils/writers/manpage.py index fc1a7302f..a849b6fb1 100644 --- a/docutils/docutils/writers/manpage.py +++ b/docutils/docutils/writers/manpage.py @@ -44,7 +44,6 @@ __docformat__ = 'reStructuredText' import re -import sys import docutils from docutils import nodes, writers, languages diff --git a/docutils/docutils/writers/odf_odt/__init__.py b/docutils/docutils/writers/odf_odt/__init__.py index 81bf4b588..5fce817c8 100644 --- a/docutils/docutils/writers/odf_odt/__init__.py +++ b/docutils/docutils/writers/odf_odt/__init__.py @@ -21,7 +21,6 @@ import os.path import re import subprocess -import sys import tempfile import time from urllib.request import urlopen @@ -1750,7 +1749,6 @@ def depart_bullet_list(self, node): def visit_caption(self, node): raise nodes.SkipChildren() - pass def depart_caption(self, node): pass diff --git a/docutils/docutils/writers/pep_html/__init__.py b/docutils/docutils/writers/pep_html/__init__.py index d48cb29c9..935ed1adc 100644 --- a/docutils/docutils/writers/pep_html/__init__.py +++ b/docutils/docutils/writers/pep_html/__init__.py @@ -9,7 +9,6 @@ __docformat__ = 'reStructuredText' -import sys import os import os.path import docutils diff --git a/docutils/docutils/writers/xetex/__init__.py b/docutils/docutils/writers/xetex/__init__.py index dab643b77..83aae23d5 100644 --- a/docutils/docutils/writers/xetex/__init__.py +++ b/docutils/docutils/writers/xetex/__init__.py @@ -22,9 +22,7 @@ __docformat__ = 'reStructuredText' -import os import os.path -import re import docutils from docutils import frontend, nodes, utils, writers, languages diff --git a/docutils/setup.py b/docutils/setup.py index 627a3e586..b941773c8 100755 --- a/docutils/setup.py +++ b/docutils/setup.py @@ -2,8 +2,6 @@ # $Id$ # Copyright: This file has been placed in the public domain. -import glob -import os import sys try: diff --git a/docutils/test/DocutilsTestSupport.py b/docutils/test/DocutilsTestSupport.py index aedd636d1..9f1f1b1be 100644 --- a/docutils/test/DocutilsTestSupport.py +++ b/docutils/test/DocutilsTestSupport.py @@ -46,7 +46,6 @@ import re import inspect import traceback -import warnings from pprint import pformat testroot = os.path.abspath(os.path.dirname(__file__) or os.curdir) diff --git a/docutils/test/package_unittest.py b/docutils/test/package_unittest.py index 2d2272bd1..1d02f304c 100644 --- a/docutils/test/package_unittest.py +++ b/docutils/test/package_unittest.py @@ -15,7 +15,6 @@ import getopt import types import unittest -import re # So that individual test modules can share a bit of state, diff --git a/docutils/test/test__init__.py b/docutils/test/test__init__.py index d5304ac99..3da7bc49a 100644 --- a/docutils/test/test__init__.py +++ b/docutils/test/test__init__.py @@ -9,7 +9,6 @@ """ import unittest -import sys import DocutilsTestSupport # must be imported before docutils import docutils import docutils.utils diff --git a/docutils/test/test_dependencies.py b/docutils/test/test_dependencies.py index ff14ae167..628116d86 100755 --- a/docutils/test/test_dependencies.py +++ b/docutils/test/test_dependencies.py @@ -8,7 +8,6 @@ Test module for the --record-dependencies option. """ -import csv import os.path import unittest import DocutilsTestSupport # must be imported before docutils diff --git a/docutils/test/test_nodes.py b/docutils/test/test_nodes.py index e09f8cd09..e477760fd 100755 --- a/docutils/test/test_nodes.py +++ b/docutils/test/test_nodes.py @@ -7,7 +7,6 @@ Test module for nodes.py. """ -import sys import unittest import warnings diff --git a/docutils/test/test_parsers/test_parser.py b/docutils/test/test_parsers/test_parser.py index 3a9ca9630..cfd80d01c 100644 --- a/docutils/test/test_parsers/test_parser.py +++ b/docutils/test/test_parsers/test_parser.py @@ -7,7 +7,6 @@ Tests for basic functionality of parser classes. """ -import sys import unittest if __name__ == '__main__': diff --git a/docutils/test/test_parsers/test_recommonmark/__init__.py b/docutils/test/test_parsers/test_recommonmark/__init__.py index 0338a1f88..46fc50e06 100644 --- a/docutils/test/test_parsers/test_recommonmark/__init__.py +++ b/docutils/test/test_parsers/test_recommonmark/__init__.py @@ -1,7 +1,6 @@ import os import os.path import sys -import unittest sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) prev = '' diff --git a/docutils/test/test_parsers/test_recommonmark/test_misc.py b/docutils/test/test_parsers/test_recommonmark/test_misc.py index 5c35cf998..4c7052c7a 100644 --- a/docutils/test/test_parsers/test_recommonmark/test_misc.py +++ b/docutils/test/test_parsers/test_recommonmark/test_misc.py @@ -13,9 +13,7 @@ Various tests for the recommonmark parser. """ -import sys import unittest -import warnings if __name__ == '__main__': import __init__ diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_include.py b/docutils/test/test_parsers/test_rst/test_directives/test_include.py index 5b9ee0551..97eec14e1 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_include.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_include.py @@ -8,7 +8,6 @@ """ import os.path -import sys if __name__ == '__main__': import __init__ from test_parsers import DocutilsTestSupport diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_raw.py b/docutils/test/test_parsers/test_rst/test_directives/test_raw.py index 02cae30e6..d0cae5d29 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_raw.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_raw.py @@ -9,7 +9,6 @@ """ import os.path -import sys if __name__ == '__main__': import __init__ diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_tables.py b/docutils/test/test_parsers/test_rst/test_directives/test_tables.py index f1ce50f50..47891ffc1 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_tables.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_tables.py @@ -9,7 +9,6 @@ """ import os -import sys import csv import platform diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_unicode.py b/docutils/test/test_parsers/test_rst/test_directives/test_unicode.py index 73a8a26cb..3a31f436e 100755 --- a/docutils/test/test_parsers/test_rst/test_directives/test_unicode.py +++ b/docutils/test/test_parsers/test_rst/test_directives/test_unicode.py @@ -8,7 +8,6 @@ Tests for misc.py "unicode" directive. """ -import sys if __name__ == '__main__': import __init__ diff --git a/docutils/test/test_publisher.py b/docutils/test/test_publisher.py index dca54bf37..57b8e5cd8 100755 --- a/docutils/test/test_publisher.py +++ b/docutils/test/test_publisher.py @@ -9,7 +9,6 @@ """ import pickle -import sys import DocutilsTestSupport # must be imported before docutils import docutils diff --git a/docutils/test/test_writers/test_docutils_xml.py b/docutils/test/test_writers/test_docutils_xml.py index dc56dc847..524df6105 100755 --- a/docutils/test/test_writers/test_docutils_xml.py +++ b/docutils/test/test_writers/test_docutils_xml.py @@ -14,7 +14,6 @@ module mirrors the current behaviour of the docutils_xml writer. """ -import sys if __name__ == '__main__': import __init__ diff --git a/docutils/tools/buildhtml.py b/docutils/tools/buildhtml.py index 32f6031e5..faa76dceb 100755 --- a/docutils/tools/buildhtml.py +++ b/docutils/tools/buildhtml.py @@ -21,7 +21,6 @@ except: pass -import copy from fnmatch import fnmatch import os import os.path diff --git a/docutils/tools/rst2odt.py b/docutils/tools/rst2odt.py index 3c5ec896b..b067dab54 100755 --- a/docutils/tools/rst2odt.py +++ b/docutils/tools/rst2odt.py @@ -8,7 +8,6 @@ A front end to the Docutils Publisher, producing OpenOffice documents. """ -import sys try: import locale locale.setlocale(locale.LC_ALL, '')