summaryrefslogtreecommitdiff
path: root/docutils/utils
Commit message (Collapse)AuthorAgeFilesLines
* Rename `io.locale_encoding` to mark it as internal.milde2022-06-171-2/+1
| | | | | | | | | | The attribute was moved to "io" after the last release. Backwards compatibility is ensured via `locale_encoding` in the (deprecated) "utils.error_reporting" module. Fix HISTORY entries. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9078 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure locale_encoding is lower case.milde2022-06-151-26/+2
| | | | | | | Use `locale.getpreferredencoding(False)` since we dropped support for older Python versions with side-effects. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9074 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Unify naming of the "utf-8" codec.milde2022-06-133-13/+13
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9068 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Postpone deprecations to Docutils 2.0milde2022-05-301-1/+1
| | | | | | | Starting in 1.0, we want to move to "semantic versioning": no incompatible API changes in "minor" releases. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9062 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Prepare switch from optparse to argparse.milde2022-03-171-8/+18
| | | | | | | | | | | | | New interface function: frontend.get_default_settings() easy access to default settings for programmatic use. Add deprecation warnings. Catch them when accessing the deprecated functions from Docutils. Make docstrings conform to the Documentation Policies (first line: summary, next line empty). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9047 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused local variablesmilde2022-03-051-1/+0
| | | | | | | | flake rule F841: local variable 'foo' is assigned to but never used In test_odt.py, a no-op class definition is removed completely. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9038 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused imports.milde2022-03-053-3/+2
| | | | | | flake8 rule F401 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9037 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid line break after binary operator.milde2022-03-051-4/+4
| | | | | | | | | Breaking before binary operators is the recommended style in PEP 8 (changed in April 2016). flake8 rule W504 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9035 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid ambiguous variable name l (may be mixed up with 1).milde2022-03-051-2/+2
| | | | | | flake8 rule E741 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9034 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Do not use bare 'except'.milde2022-03-052-2/+2
| | | | | | | | | | flake8 rule E722 Exception: as catchall, if * the right thing to do does not depend on the error * any error is reported or risen again. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9033 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid multiple statements on one line. Fix redundant backslashmilde2022-03-052-9/+10
| | | | | | | | | | | | Exceptions for sets of empty class definitions and other cases where it improves comprehension. flake8 rules E502: the backslash is redundant between brackets E701: multiple statements on one line (colon) E704: multiple statements on one line (def) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9032 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid too long lines.milde2022-03-054-114/+117
| | | | | | flake8 rule E501: line too long (N > 79 characters) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9030 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Simplify code as dicts have fixed order since 3.6milde2022-03-051-8/+6
| | | | | | | We no longer need to sort a dictionary from `**kwargs` in order to have a fixed order for stable tests. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9029 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix imports.milde2022-03-051-23/+23
| | | | | | | | flake8 rules E401: multiple imports on one line E402: module level import not at top of file git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9027 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure 2 blank lines around top-level functions and classes.milde2022-03-0410-2/+108
| | | | | | | | 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/docutils@9026 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove excess blank lines.milde2022-03-044-10/+0
| | | | | | flakei rule E303: too many blank lines (N) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9025 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix (some) missing blank linesmilde2022-03-041-0/+2
| | | | | | | | flake8 rules E301: expected 1 blank line, found 0 E306: expected 1 blank line before a nested definition, found 0 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9024 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix multiple spaces after keywordmilde2022-03-041-1/+1
| | | | | | flake8 rule E271 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9023 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure comments start with '# 'milde2022-03-042-9/+9
| | | | | | | | | | | flake rules E262: inline comment should start with '# ' E265: block comment should start with '# ' E266: too many leading '#' for block comment Exception for latex2e (legacy convention to mark disabled code with ##). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9022 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure at least two spaces before inline comment.milde2022-03-046-80/+79
| | | | | | | | | 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/docutils@9021 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix unexpected spaces around equals indicating keyword arguments.milde2022-03-031-7/+7
| | | | | | flake8 rule E251 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9020 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix multiple spaces after ',' or ':'.milde2022-03-032-4/+4
| | | | | | | | | flake rule E241. Allow exception for data collections where this facilitates editing and comprehension. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9019 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix missing whitespace after ',' or ':'.milde2022-03-034-84/+84
| | | | | | | | flake8 rule E231. Mostly trailing commas in list and dictionary literals. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9018 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix missing whitespace around operator.milde2022-03-033-4/+5
| | | | | | | | | | | | | | 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/docutils@9017 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix multiple spaces before/after operatormilde2022-03-032-15/+15
| | | | | | | E221 multiple spaces before operator E222 multiple spaces after operator git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9016 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix whitespace before/after delimiters and colon.milde2022-03-031-1/+1
| | | | | | | | | | | | | | Flake rules E201 whitespace after '(' E202 whitespace before '}' E203 whitespace before ':' E211 whitespace before '(' Exception: : as binary operator in extended slices (cf. https://www.python.org/dev/peps/pep-0008/#pet-peeves). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9015 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Small fixes, mostly documentation. Test more "list" settings.milde2022-02-051-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8998 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix code indentationmilde2022-01-298-51/+58
| | | | | | | | | | | | | | | | | | | | 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/docutils@8994 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix trailing whitespace (flake warnings W293, W391).milde2022-01-291-1/+0
| | | | | | | W293 blank line contains whitespace W391 blank line at end of file git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8993 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix trailing whitespace (flake warning W291).milde2022-01-291-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8992 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Smartquotes 1.8.2: Code cleanup. Require Python 3.milde2022-01-271-50/+36
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8988 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Do not use combining Unicode characters without base in literal strings.milde2022-01-271-11/+11
| | | | | | | Add an example for LaTeX accent functions in mathematical text to the mathematics documentation. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8986 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Leftovers and fixes after the big clean-up.milde2022-01-273-16/+16
| | | | | | Patch set by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8985 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* New style classes no longer need to inherit from `object`.milde2022-01-266-29/+29
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8984 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop string prefix "u".milde2022-01-268-2024/+2024
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8983 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Skip assigning to a variable when immediately returningmilde2022-01-263-6/+3
| | | | | | Patch by Adam Turner git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8980 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused importsmilde2022-01-262-3/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8979 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use "x not in y" over "not x in y"milde2022-01-262-12/+12
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8978 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use "is" to check for Nonemilde2022-01-262-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8977 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove redundant parenthesesmilde2022-01-264-13/+13
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8976 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove re.U(NICODE), it is the default in Python 3milde2022-01-261-5/+5
| | | | | | https://docs.python.org/3/library/re.html#re.ASCII git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8975 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use yield frommilde2022-01-261-2/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8974 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Small fixes and clean-ups by Adam Turner.milde2022-01-261-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Remove duplicate definitions in language modules. Import locale_encoding from `docutils.io` Use decorator for staticmethod Use True/False over 1/0. `collections.OrderedDict` no longer required, all dictionaries are ordered from Python 3.7 Remove obsolete `__cmp__` method cf. https://docs.python.org/3/whatsnew/3.0.html#ordering-comparisons Use str instead of type(''). Zero-argument ``super()`` Simplify test support module as "u" prefix isn't used by repr in Python 3. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8973 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use generator expressions with functions expecting a sequence.milde2022-01-266-15/+15
| | | | | | Based on patches by Adam Turner git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8970 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Code modernisation. Use literals.milde2022-01-261-4/+4
| | | | | | Merger of 2 patches by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8969 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update URLs in the docs.milde2022-01-213-4/+3
| | | | | | | | 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/docutils@8959 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix flake8 warnings.milde2022-01-212-22/+5
| | | | | | | | math2html.py: remove not required class latex2mathml.py: silence warning for now frontend.py: prefix variable that moved to "io" module. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8958 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Change http://docutils.sf.net -> https://docutils.sourceforge.iomilde2022-01-202-2/+2
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8954 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Change removal warnings to "minor + 2" where appropriate.milde2022-01-142-3/+4
| | | | | | | | | | | | The version number of the next release(s) may be "1.0, 1.1, ...", "0.19, 1.0, ...", or "0.19, 0.20, ...". Lower announced removal version to "0.21 or later" for DeprecationWarnings that did not include a removal version in the last release and for DeprecationWarnings that were added after the last release. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8949 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Module "locale" is supported by Jython since version 2.7.2.milde2022-01-111-1/+1
| | | | | | | | | Cf. https://github.com/jython/jython/commit/c5509579 Jython does not support Python3 at the moment, so we don't need to care about earlier versions in Docutils >= 0.19. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8941 929543f6-e4f2-0310-98a6-ba3bd3dd1d04