Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Commit

Permalink
Add argument to format JSON output (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ComicIronic authored May 21, 2020
1 parent cb81119 commit fcce567
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rsi/rsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def new_state(self, directions: int, name: str) -> State:
self.set_state(newstate, name)
return newstate

def write(self, path: Union[str, Path], make_parent_dirs: bool = True) -> None:
def write(self, path: Union[str, Path], make_parent_dirs: bool = True, indent: Optional[int] = None) -> None:
if isinstance(path, str):
path = Path(path)

Expand Down Expand Up @@ -67,7 +67,7 @@ def write(self, path: Union[str, Path], make_parent_dirs: bool = True) -> None:
metajson["states"] = states

with metapath.open("w") as f:
f.write(json.dumps(metajson))
f.write(json.dumps(metajson, indent=indent))

# Write PNG files.
for state in self.states.values():
Expand Down

0 comments on commit fcce567

Please sign in to comment.