Page MenuHomeSoftware Heritage
Paste P1436

(An Untitled Masterwork)
ActivePublic

Authored by douardda on Aug 29 2022, 6:06 PM.
import time
import grpc
from swh.graph.rpc import swhgraph_pb2, swhgraph_pb2_grpc
with grpc.insecure_channel("granet.internal.softwareheritage.org:50091") as c:
stub = swhgraph_pb2_grpc.TraversalServiceStub(c)
r = stub.Traverse(swhgraph_pb2.TraversalRequest(
src=("swh:1:rev:085ded6431384d07a8fa1fbaedcc74d8cd6676d5",),
edges="rev:rev",
max_edges=10,
max_depth=10,
))
while not r.done():
time.sleep(1)
print('.', sep='', end='', flush=True)
print()
print(r.result())