From 62e365f5776cfe8e460fdd29a1d7fa89a5c9c0bc Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 19 Dec 2019 17:10:34 -0800 Subject: gen_vimdoc.py: mpack: exclude deprecated functions The `mpack` variable was a tuple, which manifests as an array in the generated msgpack structure. - Removes noise from the mpack data (deprecated functions are deprecated). - Eliminates 1 level of nesting. BEFORE: [ { "buffer.c": [ { "nvim__buf_stats": { ... }, ... }, { "buffer_del_line": { ... }, ... }, ], ... } ] AFTER: [ { "buffer.c": { "nvim__buf_stats": { ... }, ... }, ... ] --- scripts/gen_vimdoc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts/gen_vimdoc.py') diff --git a/scripts/gen_vimdoc.py b/scripts/gen_vimdoc.py index 368eaf48f1..2ca121c299 100755 --- a/scripts/gen_vimdoc.py +++ b/scripts/gen_vimdoc.py @@ -727,7 +727,7 @@ def gen_docs(config): if p.returncode: sys.exit(p.returncode) - doc_maps = {} + fn_maps = {} sections = {} intros = {} sep = '=' * text_width @@ -756,7 +756,7 @@ def gen_docs(config): filename = get_text(find_first(compound, 'name')) if filename.endswith('.c') or filename.endswith('.lua'): - mpack = extract_from_xml(os.path.join(base, '{}.xml'.format( + fn_map, _ = extract_from_xml(os.path.join(base, '{}.xml'.format( compound.getAttribute('refid'))), mode, False) functions_text, deprecated_text, fns = fmt_doxygen_xml_as_vimhelp( @@ -798,7 +798,7 @@ def gen_docs(config): title = '{} Functions'.format(name) helptag = '*api-{}*'.format(name.lower()) sections[filename] = (title, helptag, doc) - doc_maps[filename] = mpack + fn_maps[filename] = fn_map if not sections: return @@ -831,7 +831,7 @@ def gen_docs(config): fp.write(docs.encode('utf8')) with open(mpack_file, 'wb') as fp: - fp.write(msgpack.packb(doc_maps, use_bin_type=True)) + fp.write(msgpack.packb(fn_maps, use_bin_type=True)) shutil.rmtree(output_dir) -- cgit