Commit bad669e8 authored by m417z's avatar m417z
Browse files

Add new file

parents
import urllib.request
import re
response = urllib.request.urlopen('https://githomelab.ru/pykd/pykd/-/raw/0.3.2/pykd/pymod.cpp')
cpp = response.read().decode().replace('\r\n', '\n')
pykd_init = re.search(r'\nvoid pykd_init\(\)\n\{\n([\s\S]*?)\n\}', cpp).group(1)
first = True
for chunk in re.split(r'\n\s*//\s*(?=\w)', pykd_init):
if first:
title = 'Initialization'
rest = chunk
first = False
else:
title, _, rest = chunk.partition('\n')
functions = re.findall(r'python::def\s*\(\s*"(.*?)",', rest)
assert(len(functions) == chunk.count('python::def'))
if len(functions) > 0:
print(f'## {title}')
func_unique = list(dict.fromkeys(functions))
print('\n'.join([f'* [{f}](https://githomelab.ru/pykd/pykd/-/wikis/API%20Reference#{f})' for f in func_unique]))
print()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment