Changeset View
Changeset View
Standalone View
Standalone View
swh/graph/client.py
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | def neighbors(self, src, edges="*", direction="forward"): | ||||
) | ) | ||||
def visit_nodes(self, src, edges="*", direction="forward"): | def visit_nodes(self, src, edges="*", direction="forward"): | ||||
return self.get_lines( | return self.get_lines( | ||||
"visit/nodes/{}".format(src), | "visit/nodes/{}".format(src), | ||||
params={"edges": edges, "direction": direction}, | params={"edges": edges, "direction": direction}, | ||||
) | ) | ||||
def visit_edges(self, src, edges="*", direction="forward"): | |||||
for edge in self.get_lines( | |||||
douardda: no fstring? | |||||
Done Inline ActionsYes, it's consistent with the rest of the file seirl: Yes, it's consistent with the rest of the file | |||||
"visit/edges/{}".format(src), | |||||
params={"edges": edges, "direction": direction}, | |||||
): | |||||
Done Inline Actionsis this print statement supposed to live here? douardda: is this print statement supposed to live here? | |||||
yield tuple(edge.split()) | |||||
def visit_paths(self, src, edges="*", direction="forward"): | def visit_paths(self, src, edges="*", direction="forward"): | ||||
def decode_path_wrapper(it): | def decode_path_wrapper(it): | ||||
for e in it: | for e in it: | ||||
yield json.loads(e) | yield json.loads(e) | ||||
return decode_path_wrapper( | return decode_path_wrapper( | ||||
self.get_lines( | self.get_lines( | ||||
"visit/paths/{}".format(src), | "visit/paths/{}".format(src), | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |
no fstring?