aboutsummaryrefslogtreecommitdiff
path: root/exports.py
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2018-10-03 16:06:15 +0100
committerDavid Baker <dave@matrix.org>2018-10-03 16:06:15 +0100
commit3e775938e50bffdfcb20241d598fea74ddaaf7e0 (patch)
treeaa27cb1cac2066a9b09ab7f95960a1f278cf80eb /exports.py
parentb1beadaceeac5556c5e4932155a58c300cf1d39b (diff)
Replace the impenetrable line of perl with python
Mostly because the standard emscripten docker image does not have libjson-perl, but python always comes with json. But also because it was impenetrable.
Diffstat (limited to 'exports.py')
-rwxr-xr-xexports.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/exports.py b/exports.py
new file mode 100755
index 0000000..b37cbbb
--- /dev/null
+++ b/exports.py
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+
+import sys
+import re
+import json
+
+expr = re.compile(r"(olm_[^( ]*)\(")
+
+exports = set()
+
+for f in sys.argv[1:]:
+ with open(f) as fp:
+ for line in fp:
+ matches = expr.search(line)
+ if matches is not None:
+ exports.add('_%s' % (matches.group(1),))
+
+json.dump(sorted(exports), sys.stdout)