Skip to content

Add acf dump support - #55

Open
rejedai wants to merge 1 commit into
ValvePython:masterfrom
rejedai:master
Open

Add acf dump support#55
rejedai wants to merge 1 commit into
ValvePython:masterfrom
rejedai:master

Conversation

@rejedai

Copy link
Copy Markdown

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:

withopen("appmanifest_2348590.acf", "r") asread_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)
withopen("appmanifest_test.acf", "w") aswrite_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 freeto 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

@rejedai