Created
July 13, 2012 20:29
-
-
Save ushis/3107240 to your computer and use it in GitHub Desktop.
systemd man index
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from xml.etree import ElementTree as ETree | |
from glob import glob | |
PATH = './refsynopsisdiv/funcsynopsis/funcprototype/funcdef/function' | |
index = {} | |
for p in glob('systemd/man/*.xml'): | |
index[p] = [f.text for f in ETree.parse(p).findall(PATH)] | |
print(index) | |
# { | |
# 'sd_id128_randomize.xml': [ | |
# 'sd_id128_randomize', | |
# 'sd_id128_get_machine', | |
# 'sd_id128_get_boot' | |
# ], | |
# 'systemd/man/sd-journal.xml': [] | |
# } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment