maintainers: new script

This commit is contained in:
Maciej Barć 2020-09-16 14:59:12 +02:00
parent 1d20c1222b
commit 7989b29d7a
No known key found for this signature in database
GPG Key ID: 031C9FE65BED714A

30
src/maintainers Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env python
import os
import os.path
import xml.etree.ElementTree as ET
metadatas = [
os.path.join(dp, f)
for dp, _, filenames in os.walk(".")
for f in filenames if os.path.splitext(f)[1] == '.xml'
]
if __name__ == '__main__':
for metadata in metadatas:
try:
_, cat, pkg, _ = metadata.split("/")
print("Package: %s/%s" % (cat, pkg))
maints = []
with open(metadata) as m:
tree = ET.parse(m)
root = tree.getroot()
for item in root.findall('./maintainer'):
for child in item:
print(4 * " ", child.tag, ":", child.text)
except ValueError:
continue