Skip to content

Conversation

rejedai
Copy link

@rejedai rejedai commented Oct 31, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant