1
0
Fork 0
mirror of https://github.com/sileht/bird-lg.git synced 2024-11-25 08:14:42 +01:00

Merge pull request #51 from tamihiro/new-pr-batch-3

Correctly display each of multiple destination prefixes with a box shape.
This commit is contained in:
zorun 2020-03-02 12:04:27 +01:00 committed by GitHub
commit b448784a0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

13
lg.py
View file

@ -491,7 +491,10 @@ def show_bgpmap():
hop_label = "" hop_label = ""
add_node(_as, fillcolor=(first and "#F5A9A9" or "white")) if _as == asmap[-1]:
add_node(_as, fillcolor="#F5A9A9", shape="box", )
else:
add_node(_as, fillcolor=(first and "#F5A9A9" or "white"), )
if hop_label: if hop_label:
edge = add_edge(nodes[previous_as], nodes[_as], label=hop_label, fontsize="7") edge = add_edge(nodes[previous_as], nodes[_as], label=hop_label, fontsize="7")
else: else:
@ -499,20 +502,16 @@ def show_bgpmap():
hop_label = "" hop_label = ""
if first: if first or _as == asmap[-1]:
edge.set_style("bold") edge.set_style("bold")
edge.set_color("red") edge.set_color("red")
elif edge.get_color() != "red": elif edge.get_style() != "bold":
edge.set_style("dashed") edge.set_style("dashed")
edge.set_color(color) edge.set_color(color)
previous_as = _as previous_as = _as
first = False first = False
if previous_as:
node = add_node(previous_as)
node.set_shape("box")
for _as in prepend_as: for _as in prepend_as:
graph.add_edge(pydot.Edge(*(_as, _as), label=" %dx" % prepend_as[_as], color="grey", fontcolor="grey")) graph.add_edge(pydot.Edge(*(_as, _as), label=" %dx" % prepend_as[_as], color="grey", fontcolor="grey"))