From d79d962ed7046a7fc6a53bdfe472d68f273f3b68 Mon Sep 17 00:00:00 2001 From: milde Date: Sat, 29 Jan 2022 16:28:17 +0000 Subject: Fix code indentation Check conformance to our coding policies with flake8. Fix the following problems: E111 indentation is not a multiple of four E114 indentation is not a multiple of four (comment) E115 expected an indented block (comment) E116 unexpected indentation (comment) E117 over-indented E121 continuation line under-indented for hanging indent E122 continuation line missing indentation or outdented E124 closing bracked does not match visual indentaion E127 continuation line over-indented for visual indent E128 continuation line under-indented for visual indent E131 continuation line unaligned for hanging indent git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8994 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- docutils/tools/dev/generate_punctuation_chars.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'docutils/tools/dev/generate_punctuation_chars.py') diff --git a/docutils/tools/dev/generate_punctuation_chars.py b/docutils/tools/dev/generate_punctuation_chars.py index 352ee0c86..b97dd8362 100644 --- a/docutils/tools/dev/generate_punctuation_chars.py +++ b/docutils/tools/dev/generate_punctuation_chars.py @@ -166,12 +166,12 @@ def unicode_charlists(categories, cp_min=0, cp_max=None): # categories with not too high characters): if cp_max is None: cp_max = max(x for x in range(sys.maxunicode+1) - if unicodedata.category(chr(x)) in categories) + if unicodedata.category(chr(x)) in categories) # print(cp_max) # => 74867 for unicode_punctuation_categories charlists = {} for cat in categories: charlists[cat] = [chr(x) for x in range(cp_min, cp_max+1) - if unicodedata.category(chr(x)) == cat] + if unicodedata.category(chr(x)) == cat] return charlists @@ -242,7 +242,7 @@ def character_category_patterns(): closing_delimiters = [r'\\.,;!?'] return [''.join(chars) for chars in (openers, closers, delimiters, - closing_delimiters)] + closing_delimiters)] def separate_wide_chars(s): """Return (s1,s2) with characters above 0xFFFF in s2""" @@ -276,8 +276,7 @@ def mark_intervals(s): return ''.join(l2) -def wrap_string(s, startstring= "('", - endstring = "')", wrap=67): +def wrap_string(s, startstring= "('", endstring = "')", wrap=67): """Line-wrap a unicode string literal definition.""" c = len(startstring) contstring = "'\n" + ' ' * (len(startstring)-2) + "'" @@ -342,17 +341,16 @@ if __name__ == '__main__': # Test: compare module content with re-generated definitions # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# :: - - if args.test: - +# # Import the punctuation_chars module from the source # or Py3k build path for local Python modules:: + if args.test: + sys.path.insert(0, '../../docutils') - from docutils.utils.punctuation_chars import (openers, closers, - delimiters, closing_delimiters) + from docutils.utils.punctuation_chars import ( + openers, closers, delimiters, closing_delimiters) print('Check for differences between the current `punctuation_chars`' ' module\n and a regeneration based on Unicode version %s:' -- cgit v1.2.1