update credits
[LibreOffice.git] / solenv / bin / constructors.py
blob1237da17142dad8253bc3ba4b4768795dd1b477c
1 #!/usr/bin/env python3
3 # Call $0 <file with a list of component file paths>
4 # Dumps all the implementing constructors to stdout
6 import xml.sax
7 import os.path
8 import sys
10 constructors = list()
12 class ComponentHandler(xml.sax.ContentHandler):
13 def startElement(self, tag, attributes):
14 if tag == "implementation" and "constructor" in attributes:
15 constructors.append(attributes["constructor"])
17 if __name__ == "__main__":
18 parser = xml.sax.make_parser()
19 parser.setFeature(xml.sax.handler.feature_namespaces, 0)
20 parser.setContentHandler(ComponentHandler())
21 for filename in sys.argv[1:]:
22 with open(filename, "r") as components_listfile:
23 for line in components_listfile:
24 for component_filename in line.strip().split():
25 parser.parse(component_filename)
26 constructors.sort()
27 print("\n".join(constructors))