(path, node)
| 55 | json.dump(j, f, indent=2) |
| 56 | |
| 57 | def add_node(path, node): |
| 58 | _validate(path) |
| 59 | with open(path, "r") as f: |
| 60 | j = json.load(f) |
| 61 | if node not in j["V"]: |
| 62 | j["V"].append(node) |
| 63 | with open(path, "w") as f: |
| 64 | json.dump(j, f, indent=2) |
| 65 | |
| 66 | def remove_node(path, node): |
| 67 | _validate(path) |