Exemplo n.º 1
0
def cmd_unpack(args):
    with open(args.pack_file, 'rb') as pack_file:
        RP = ResourcePack()
        pack = RP.deserialize(pack_file)
        makedirs(args.output_directory)
        for i in range(len(pack.contents)):
            with open(os.path.join(args.output_directory, '%03d' % i), 'wb') as content_file:
                content_file.write(pack.contents[i])
Exemplo n.º 2
0
def cmd_pack(args):
    pack = ResourcePack()
    for f in args.pack_file_list:
        pack.add_resource(open(f, 'rb').read())
    with open(args.pack_file, 'wb') as pack_file:
        pack.serialize(pack_file)