From 17f324b83655e68b064f0637f5190000ea0e1f12 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 3 Jan 2016 18:08:45 +0200 Subject: py/frozenmod: Store frozen module names together, to quickly scan them. --- tools/make-frozen.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tools') 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 ") -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) -- cgit v1.2.3