3 # Call $0 <file with a list of component file paths>
4 # Dumps all the implementing constructors to stdout
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
)
27 print("\n".join(constructors
))