Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- import kconfiglib
- import sys
- def write_kconfig_html():
- kconf = kconfiglib.Kconfig(sys.argv[1])
- output = sys.argv[2]
- for sym in sorted(kconf.unique_defined_syms, key=lambda x: x.name):
- for node in sym.nodes:
- if node.help is not None:
- with open(
- '{}/CONFIG_{}.html'.format(output, sym.name),
- mode='wt'
- ) as f:
- f.write('\n'.join([
- '<details>',
- '<summary>CONFIG_{}</summary><p>'.format(sym.name),
- '<br>\n'.join(node.help.split('\n')),
- '</p></details>'
- ]))
- if __name__ == '__main__':
- write_kconfig_html()
Advertisement