From 7989b29d7a1fb2e25def689b640a445a94fb4e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Bar=C4=87?= Date: Wed, 16 Sep 2020 14:59:12 +0200 Subject: [PATCH] maintainers: new script --- src/maintainers | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 src/maintainers diff --git a/src/maintainers b/src/maintainers new file mode 100755 index 0000000..ddf87c2 --- /dev/null +++ b/src/maintainers @@ -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