From: Vladimír Vondruš Date: Wed, 17 Jul 2019 16:39:25 +0000 (+0200) Subject: documentation: ensure the extra arguments are always passed as keywords. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=a8c86f3b884d9afacc383ac1464738adf5ff11e2;p=blog.git documentation: ensure the extra arguments are always passed as keywords. --- diff --git a/documentation/_search.py b/documentation/_search.py index fb48e7f2..1e58b4a0 100644 --- a/documentation/_search.py +++ b/documentation/_search.py @@ -372,7 +372,7 @@ def base85encode_search_data(data: bytearray) -> bytearray: return (b"/* Generated by https://mcss.mosra.cz/documentation/doxygen/. Do not edit. */\n" + b"Search.load('" + base64.b85encode(data, True) + b"');\n") -def _pretty_print_trie(serialized: bytearray, hashtable, stats, base_offset, indent, show_merged, show_lookahead_barriers, color_map) -> str: +def _pretty_print_trie(serialized: bytearray, hashtable, stats, base_offset, indent, *, show_merged, show_lookahead_barriers, color_map) -> str: # Visualize where the trees were merged if show_merged and base_offset in hashtable: return color_map['red'] + '#' + color_map['reset'] @@ -435,7 +435,7 @@ color_map_dummy = {'blue': '', 'yellow': '', 'reset': ''} -def pretty_print_trie(serialized: bytes, show_merged=False, show_lookahead_barriers=True, colors=False): +def pretty_print_trie(serialized: bytes, *, show_merged=False, show_lookahead_barriers=True, colors=False): color_map = color_map_colors if colors else color_map_dummy hashtable = {} diff --git a/documentation/doxygen.py b/documentation/doxygen.py index 9d56e271..e2c73dc3 100755 --- a/documentation/doxygen.py +++ b/documentation/doxygen.py @@ -3429,7 +3429,7 @@ default_index_pages = ['pages', 'files', 'namespaces', 'modules', 'annotated'] default_wildcard = '*.xml' default_templates = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'templates/doxygen/') -def run(doxyfile, templates=default_templates, wildcard=default_wildcard, index_pages=default_index_pages, search_add_lookahead_barriers=True, search_merge_subtrees=True, search_merge_prefixes=True, sort_globbed_files=False): +def run(doxyfile, *, templates=default_templates, wildcard=default_wildcard, index_pages=default_index_pages, search_add_lookahead_barriers=True, search_merge_subtrees=True, search_merge_prefixes=True, sort_globbed_files=False): state = State() state.basedir = os.path.dirname(doxyfile) @@ -3628,4 +3628,4 @@ if __name__ == '__main__': # pragma: no cover logging.debug("running Doxygen on {}".format(args.doxyfile)) subprocess.run(["doxygen", doxyfile], cwd=os.path.dirname(doxyfile)) - run(doxyfile, os.path.abspath(args.templates), args.wildcard, args.index_pages, search_merge_subtrees=not args.search_no_subtree_merging, search_add_lookahead_barriers=not args.search_no_lookahead_barriers, search_merge_prefixes=not args.search_no_prefix_merging) + run(doxyfile, templates=os.path.abspath(args.templates), wildcard=args.wildcard, index_pages=args.index_pages, search_merge_subtrees=not args.search_no_subtree_merging, search_add_lookahead_barriers=not args.search_no_lookahead_barriers, search_merge_prefixes=not args.search_no_prefix_merging)