vdf icon indicating copy to clipboard operation
vdf copied to clipboard

Add acf dump support

Open rejedai opened this issue 2 years ago • 0 comments

Added ability to dump to acf format.

vdf.dumps(__test_acf, pretty=True, acf=True)

No modification is required for read, parser reads correctly, test code:

    with open("appmanifest_2348590.acf", "r") as read_acf:
        __manifest_orig = read_acf.read()

        read_acf.seek(0)
        __manifest_dict = vdf.load(read_acf)
        __manifest_dump = vdf.dumps(__manifest_dict, pretty=True, acf=True)
        with open("appmanifest_test.acf", "w") as write_acf:
            vdf.dump(__manifest_dict, write_acf, pretty=True, acf=True)

        print(f"Result: {__manifest_orig == __manifest_dump}")

output:

Result: True

md5sum:

❯ md5sum ./appmanifest_2348590.acf 
ffbafff6611f9be6bd95ff4b30d49f37  ./appmanifest_2348590.acf
❯ md5sum ./appmanifest_test.acf 
ffbafff6611f9be6bd95ff4b30d49f37  ./appmanifest_test.acf

rejedai avatar Oct 31 '23 17:10 rejedai