diff options
author | marcelofg55 <marcelofg55@gmail.com> | 2016-06-02 18:56:28 -0300 |
---|---|---|
committer | marcelofg55 <marcelofg55@gmail.com> | 2016-06-02 18:56:28 -0300 |
commit | 4e0f2389c3a79f1e558ee13e6d51e7dbe531368e (patch) | |
tree | a8bd2b831ae005a614d2a5c8a56ea4bccec3d59e /tools/SCsub | |
parent | bb223869e0d016d372d8f3d98b3d5680cc069368 (diff) | |
parent | bc25492e636a82a30d77aa1b37edede0a2a9182f (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'tools/SCsub')
-rw-r--r-- | tools/SCsub | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/SCsub b/tools/SCsub index 7a0feb6e3d..f6c14a13fb 100644 --- a/tools/SCsub +++ b/tools/SCsub @@ -21,17 +21,20 @@ def make_translations_header(target,source,env): g.write("#ifndef _EDITOR_TRANSLATIONS_H\n") g.write("#define _EDITOR_TRANSLATIONS_H\n") + import zlib + import os.path + + paths = [node.srcnode().abspath for node in source] + sorted_paths = sorted(paths, key=lambda path: os.path.splitext(os.path.basename(path))[0]) + xl_names=[] - for i in range(len(source)): - print("Appending translation: "+source[i].srcnode().abspath) - f = open(source[i].srcnode().abspath,"rb") + for i in range(len(sorted_paths)): + print("Appending translation: "+sorted_paths[i]) + f = open(sorted_paths[i],"rb") buf = f.read() decomp_size = len(buf) - import zlib - import os.path buf = zlib.compress(buf) - - name = os.path.splitext(os.path.basename(source[i].srcnode().abspath))[0] + name = os.path.splitext(os.path.basename(sorted_paths[i]))[0] #g.write("static const int _translation_"+name+"_compressed_size="+str(len(buf))+";\n") #g.write("static const int _translation_"+name+"_uncompressed_size="+str(decomp_size)+";\n") |