Sign in Sign up
Branches
master
11 lines (10 loc) · 613 Bytes Raw
"""Fuse's combine step in Python: sticker layer from A, effect layer from B, files copied byte for byte.
usage: mix.py A.was B.was OUT.was"""
import sys, zipfile

a, b, out = (zipfile.ZipFile(sys.argv[1]), zipfile.ZipFile(sys.argv[2]), sys.argv[3])
M, E, T, META = "animation/animation.json", "animation/animation_secondary.json", ".trust_token", "animation/animation.json.overridden_metadata"
with zipfile.ZipFile(out, "w", zipfile.ZIP_DEFLATED) as z:
    z.writestr("animation/", b"")
    for name, src in [(M, a), (E, b), (M + T, a), (E + T, b), (META, a)]:
        z.writestr(name, src.read(name))
print(out)