summaryrefslogtreecommitdiff
path: root/tools/make-frozen.py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-01-03 18:08:45 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-01-03 18:08:45 +0200
commit17f324b83655e68b064f0637f5190000ea0e1f12 (patch)
tree33f43d0b6bcb8fc9daf6c20a8e3e003ad945e21b /tools/make-frozen.py
parent1b0aab621baf081bf1cbeb38a29bd37fbc135cc7 (diff)
py/frozenmod: Store frozen module names together, to quickly scan them.
Diffstat (limited to 'tools/make-frozen.py')
-rwxr-xr-xtools/make-frozen.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/make-frozen.py b/tools/make-frozen.py
index 7c3865cc4..e0c807c4e 100755
--- a/tools/make-frozen.py
+++ b/tools/make-frozen.py
@@ -37,17 +37,21 @@ for dirpath, dirnames, filenames in os.walk(root):
modules.append((fullpath[root_len + 1:], st))
print("#include <stdint.h>")
-print("const uint16_t mp_frozen_sizes[] = {")
+print("const char mp_frozen_names[] = {")
+for f, st in modules:
+ m = module_name(f)
+ print('"%s\\0"' % m)
+print('"\\0"};')
+
+print("const uint32_t mp_frozen_sizes[] = {")
for f, st in modules:
print("%d," % st.st_size)
-print("0};")
+print("};")
print("const char mp_frozen_content[] = {")
for f, st in modules:
- m = module_name(f)
- print('"%s\\0"' % m)
data = open(sys.argv[1] + "/" + f, "rb").read()
# Python2 vs Python3 tricks
data = repr(data)