summaryrefslogtreecommitdiff
path: root/docutils/tools/dev/generate_punctuation_chars.py
Commit message (Collapse)AuthorAgeFilesLines
* Simplify/update utils.punctuation_chars and generating script.milde2022-11-241-83/+86
| | | | | | | | | | | Since Python 3.3 (PEP 393), all Python builds have support for the full range of Unicode, and hence there are no longer "wide" and "narrow" builds. Patch by Adam Turner. Review/refactoring of ``generate_punctuation_chars.py`` including fixup for r9253: add quote pair for Old Hungarian. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9270 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use a simpler algorithm to generate char listsaa-turner2022-11-161-17/+8
| | | | | | | | | | | | | The current algorithm checks each codepoint at least once, and when ``cp_max`` is ``None``, it checks all used characters twice. This combines the two loops and stores the results of the call to ``unicodedata``. Also remove the text about "wide" builds of Python, since PEP 393 and Python 3.3, all builds of Python carry support for the full Unicode space. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9254 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix ``punctuation_chars`` regeneration for testsaa-turner2022-11-161-0/+7
| | | | | | | | | | | | | | | Unicode version 7.0 introduced U+2E42, "DOUBLE LOW-REVERSED-9 QUOTATION MARK", in the Ps category. This codepoint doesn't have a pair corresponding to it in the Pe category, breaking the assumptions in the ``openers`` and ``closers`` strings. The only usages I have been able to identify are in Old Hungarian, where the character does not seem to have been used as a quotation mark, so the concept of an opening character and corresponding closing character do not easily fit. As the simplest fix to allow tests to pass following regeneration of the ``punctuation_chars`` file without manual editing, we remove the U+2E42 character from the Ps category. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9253 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update `utils.punctuation_chars` (keeping backwards compatibility).milde2022-11-161-26/+27
| | | | | | | | | | Update/harmonize the formatting/layout in both, the generated file and the generating script. Remaining differences between the current module and a re-generation result are due to different versions of Python's `unicodedata` module. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9251 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update ``generate_punctuation_chars`` templatesaa-turner2022-11-161-26/+28
| | | | | | | | | This changes the templates to match changes made to ``punctuation_chars``, making updating the file easier. It also changes the string wrapping algorithm, leaving less space blank on each line. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9246 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Unify naming of the "utf-8" codec.milde2022-06-131-6/+6
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9068 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused imports.milde2022-03-051-2/+2
| | | | | | flake8 rule F401 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9037 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid ambiguous variable name l (may be mixed up with 1).milde2022-03-051-13/+13
| | | | | | flake8 rule E741 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9034 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid too long lines.milde2022-03-051-2/+4
| | | | | | flake8 rule E501: line too long (N > 79 characters) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9030 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure 2 blank lines around top-level functions and classes.milde2022-03-041-0/+4
| | | | | | | | flake8 rules E302: expected 2 blank lines, found 1 E305: expected 2 blank lines after class or function definition git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9026 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure at least two spaces before inline comment.milde2022-03-041-8/+8
| | | | | | | | | flake 8 rule E261 Exceptions for modules sheduled for removal or with 3rd-party origin and for data collections. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9021 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix unexpected spaces around equals indicating keyword arguments.milde2022-03-031-1/+1
| | | | | | flake8 rule E251 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9020 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix missing whitespace around operator.milde2022-03-031-3/+3
| | | | | | | | | | | | | | flake8 rules E225: missing whitespace around operator E226: missing whitespace around arithmetic operator E228: missing whitespace around modulo operator Keep ignoring the latter two rules: PEP8 limits the recommendation to "operators with lowest priority" "if operators with different priorities are used". flake8 also flags top level operators. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9017 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix code indentationmilde2022-01-291-11/+9
| | | | | | | | | | | | | | | | | | | | Check conformance to our coding policies with flake8. Fix the following problems: E111 indentation is not a multiple of four E114 indentation is not a multiple of four (comment) E115 expected an indented block (comment) E116 unexpected indentation (comment) E117 over-indented E121 continuation line under-indented for hanging indent E122 continuation line missing indentation or outdented E124 closing bracked does not match visual indentaion E127 continuation line over-indented for visual indent E128 continuation line under-indented for visual indent E131 continuation line unaligned for hanging indent git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8994 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Modernise helper script generating `punctuation_chars.py`.milde2022-01-261-39/+37
| | | | | | | | Update/clean code after droping Python 2.7 support. Based on patch-set by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8968 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update URLs in the docs.milde2022-01-211-1/+1
| | | | | | | | Mostly http: -> https:, based on a patch by Adam Turner Remove/update some dead links. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8959 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Change http://docutils.sf.net -> https://docutils.sourceforge.iomilde2022-01-201-1/+1
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8954 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop special-casing for Python 2.x in tests and tools.milde2022-01-031-22/+7
| | | | | | | Use "python3" in the shebang line (cf. PEP 394 -- The "python" Command on Unix-Like Systems). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8927 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove "coding:" slugmilde2022-01-031-2/+0
| | | | | | Only required with Python 2.x. Encoding in Py3k is utf8 by default. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8926 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove 2.7-compatibility __future__ imports.milde2022-01-031-4/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8925 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix spellingmilde2021-10-221-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8860 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix link to 2-Clause BSD license.milde2020-09-041-2/+2
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8554 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Formatting changes to facilitate integration of "py3" patchset.milde2019-08-271-2/+2
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8367 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Replace 'ur' prefixmilde2019-08-271-2/+8
| | | | | | | | | | While the 'u' prefix was backported to Python 3.3 or thereabouts, 'ur' remains invalid in Python 3. Just escape all backslashes and use plain old 'u'. Based on patch by Stephen Finucane <stephen@that.guru> git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8366 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Consistent Python 3 checks.milde2019-08-261-2/+2
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8360 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Use 'sorted(foo)' instead of 'foo.sort()'milde2019-08-261-2/+1
| | | | | | | | This works with iterators also (like 'dict.keys()' in Python 3) Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8357 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Resolve some additional undefined symbolsmilde2019-08-261-11/+0
| | | | | | | | Found with flake8 Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8352 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* py3: Switch to print functionsmilde2019-08-261-45/+3
| | | | | | | | | | Remove all uses of print as a statement. This includes comments, many of which are simply removed as noise (they're in version control and can be re-added later, if necessary). Signed-off-by: Stephen Finucane <stephen@that.guru> git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8346 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Generate the complete punctuation_chars module with the corresponding tool.milde2017-01-171-60/+190
| | | | git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8016 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* "Outsourcing" of development code from utils.punctuation_chars.milde2017-01-051-0/+334
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8014 929543f6-e4f2-0310-98a6-ba3bd3dd1d04