summaryrefslogtreecommitdiffstats
path: root/solenv/bin/constructors.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
commited5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch)
tree7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /solenv/bin/constructors.py
parentInitial commit. (diff)
downloadlibreoffice-upstream/4%7.4.7.tar.xz
libreoffice-upstream/4%7.4.7.zip
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'solenv/bin/constructors.py')
-rwxr-xr-xsolenv/bin/constructors.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/solenv/bin/constructors.py b/solenv/bin/constructors.py
new file mode 100755
index 000000000..1237da171
--- /dev/null
+++ b/solenv/bin/constructors.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python3
+
+# Call $0 <file with a list of component file paths>
+# Dumps all the implementing constructors to stdout
+
+import xml.sax
+import os.path
+import sys
+
+constructors = list()
+
+class ComponentHandler(xml.sax.ContentHandler):
+ def startElement(self, tag, attributes):
+ if tag == "implementation" and "constructor" in attributes:
+ constructors.append(attributes["constructor"])
+
+if __name__ == "__main__":
+ parser = xml.sax.make_parser()
+ parser.setFeature(xml.sax.handler.feature_namespaces, 0)
+ parser.setContentHandler(ComponentHandler())
+ for filename in sys.argv[1:]:
+ with open(filename, "r") as components_listfile:
+ for line in components_listfile:
+ for component_filename in line.strip().split():
+ parser.parse(component_filename)
+ constructors.sort()
+ print("\n".join(constructors))