File: symbols-parse-json.py

package info (click to toggle)
vim-vimtex 2.16-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,660 kB
  • sloc: makefile: 367; python: 103
file content (15 lines) | stat: -rwxr-xr-x 508 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env python3
"""Blahrg."""
import json


with open('symbols.json') as fin:
    with open('symbols-json', 'w') as fout:
        for vals in json.load(fin).values():
            if 'commands' in vals:
                for k, v in vals['commands'].items():
                    if (v['symbol'] is not None
                            and len(k) > 3
                            and len(v['symbol']) == 1):
                        fout.write(
                            k[1:] + ' ' + v['symbol'] + "\n")