Skip to content

Instantly share code, notes, and snippets.

@ushis
Created July 13, 2012 20:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ushis/3107240 to your computer and use it in GitHub Desktop.
Save ushis/3107240 to your computer and use it in GitHub Desktop.
systemd man index
#!/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