Skip to content

Conversation

patrickelectric
Copy link
Member

Fix #882

@@ -92,7 +92,7 @@ def save(self, file_path: pathlib.Path) -> None:

with open(file_path, "w", encoding="utf-8") as settings_file:
logger.debug(f"Saving settings on: {file_path}")
settings_file.write(Pykson().to_json(self))
settings_file.write(Pykson().to_json(self, base_indent=4))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhg, maybe our version doesn't have base_indent? Also, what is the difference between base_indent and indent?

Copy link
Member Author

@patrickelectric patrickelectric Jun 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! But we have a fork of pykson (that does not include this feature) that is full of changes that are not merged and the project appears to be dead at the moment. We are moving to pydantic, and we should move all projects, removing pykson in the end. This just adds a minor quality for us when checking logs.

sinarezaei/pykson#19

@patrickelectric patrickelectric merged commit 6356521 into bluerobotics:master Jun 23, 2024
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.

core: commonwealth: Save json pretty
3 participants