Skip to content

Commit

Permalink
style: end json file dumps with a newline
Browse files Browse the repository at this point in the history
  • Loading branch information
gosuto-inzasheru committed Dec 9, 2024
1 parent ff7ebd3 commit afba66c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gen_addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ def write_addressbooks(chainlist=AddrBook.chain_ids_by_name.keys()):
flatbook = AddrBook(chain).generate_flatbook()
with open(f"outputs/{chain}.json", "w") as f:
json.dump(dict(sorted(flatbook.items())), f, indent=2)
f.write("\n")
with open(f"outputs/{chain}_reverse.json", "w") as f:
json.dump(reverse_dict(flatbook), f, indent=2)
f.write("\n")


def main():
Expand Down
1 change: 1 addition & 0 deletions gen_core_pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def main():
# dump the collected dict to json file
with open("outputs/core_pools.json", "w") as f:
json.dump(core_pools, f, indent=2)
f.write("\n")


if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions gen_current_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def generate_chain_files(chain):
permissions = build_chain_permissions_list(chain)
with open(f"outputs/permissions/active/{chain}.json", "w") as f:
json.dump(permissions, f, indent=2)
f.write("\n")


def main():
Expand Down
2 changes: 2 additions & 0 deletions gen_mono_addressbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def main():
results = {"active": active, "old": old}
with open("outputs/deployments.json", "w") as f:
json.dump(results, f, indent=2)
f.write("\n")
### Add extras
for chain in active.keys():
with open("extras/multisigs.json", "r") as f:
Expand Down Expand Up @@ -83,6 +84,7 @@ def main():
results = {"active": active, "old": old}
with open("outputs/addressbook.json", "w") as f:
json.dump(results, f, indent=2)
f.write("\n")


def process_deployments(deployments, old=False):
Expand Down
3 changes: 3 additions & 0 deletions gen_pools_and_gauges.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,13 @@ def main():
# dump all collected dicts to json files
with open(f"outputs/pools.json", "w") as f:
json.dump(pools, f, indent=2)
f.write("\n")
with open("outputs/gauges.json", "w") as f:
json.dump(gauges, f, indent=2)
f.write("\n")
with open("outputs/root_gauges.json", "w") as f:
json.dump(root_gauges, f, indent=2)
f.write("\n")


if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions gen_subgraph_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def main():
# dump the collected dict to json file
with open("outputs/subgraph_urls.json", "w") as f:
json.dump(urls, f, indent=2)
f.write("\n")


if __name__ == "__main__":
Expand Down

0 comments on commit afba66c

Please sign in to comment.