MCPcopy Create free account
hub / github.com/CyberPoint/libpgm / add_node

Function add_node

utils/bntextutils.py:57–64  ·  view source on GitHub ↗
(path, node)

Source from the content-addressed store, hash-verified

55 json.dump(j, f, indent=2)
56
57def 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
66def remove_node(path, node):
67 _validate(path)

Callers

nothing calls this directly

Calls 2

_validateFunction · 0.85
loadMethod · 0.45

Tested by

no test coverage detected