summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-05-30 00:23:32 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-05-30 00:23:46 +0300
commita8e7c03171c6d17bb871e132294690f1e8b7602c (patch)
tree6560764066e9d92c485747d6e003374fa93f28fc
parentf5ae384d4f0ce2a401a57cf4266be3ce70a9c51d (diff)
downloadmicropython-a8e7c03171c6d17bb871e132294690f1e8b7602c.tar.gz
micropython-a8e7c03171c6d17bb871e132294690f1e8b7602c.zip
tools/make-frozen.py: Preserve directory hierarchy.
Currently, frozen packages are not supported, but eventually they should be, so make sure to store complete directory hierarchy.
-rwxr-xr-xtools/make-frozen.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/make-frozen.py b/tools/make-frozen.py
index b053afa08e..c3dfe591c9 100755
--- a/tools/make-frozen.py
+++ b/tools/make-frozen.py
@@ -26,10 +26,16 @@ def module_name(f):
modules = []
-for dirpath, dirnames, filenames in os.walk(sys.argv[1]):
+root = sys.argv[1]
+root_len = len(root)
+if root[-1] != "/":
+ root_len += 1
+
+for dirpath, dirnames, filenames in os.walk(root):
for f in filenames:
- st = os.stat(dirpath + "/" + f)
- modules.append((f, st))
+ fullpath = dirpath + "/" + f
+ st = os.stat(fullpath)
+ modules.append((fullpath[root_len:], st))
print("#include <stdint.h>")
print("const uint16_t mp_frozen_sizes[] = {")