mirror of
https://github.com/sileht/bird-lg.git
synced 2024-11-21 22:44:43 +01:00
Basic python reformatting
Transform all tabs to spaces and remove trailing spaces.
This commit is contained in:
parent
ca4550ae74
commit
a45ae45408
3
bird.py
3
bird.py
|
@ -172,6 +172,3 @@ class BirdSocket:
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['BirdSocketSingleton', 'BirdSocket']
|
__all__ = ['BirdSocketSingleton', 'BirdSocket']
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
2
lg.py
2
lg.py
|
@ -461,7 +461,6 @@ def show_bgpmap():
|
||||||
if "%s*" % label_without_star not in labels:
|
if "%s*" % label_without_star not in labels:
|
||||||
labels = [ kwargs["label"] ] + [ l for l in labels if not l.startswith(label_without_star) ]
|
labels = [ kwargs["label"] ] + [ l for l in labels if not l.startswith(label_without_star) ]
|
||||||
labels = sorted(labels, cmp=lambda x,y: x.endswith("*") and -1 or 1)
|
labels = sorted(labels, cmp=lambda x,y: x.endswith("*") and -1 or 1)
|
||||||
|
|
||||||
label = escape("\r".join(labels))
|
label = escape("\r".join(labels))
|
||||||
e.set_label(label)
|
e.set_label(label)
|
||||||
return edges[edge_tuple]
|
return edges[edge_tuple]
|
||||||
|
@ -511,7 +510,6 @@ def show_bgpmap():
|
||||||
else:
|
else:
|
||||||
hop_label = ""
|
hop_label = ""
|
||||||
|
|
||||||
|
|
||||||
if _as == asmap[-1]:
|
if _as == asmap[-1]:
|
||||||
add_node(_as, fillcolor="#F5A9A9", shape="box", )
|
add_node(_as, fillcolor="#F5A9A9", shape="box", )
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -80,7 +80,6 @@ def traceroute():
|
||||||
traceroute = traceroute6
|
traceroute = traceroute6
|
||||||
if app.config.get("IPV6_SOURCE", ""):
|
if app.config.get("IPV6_SOURCE", ""):
|
||||||
src = [ "-s", app.config.get("IPV6_SOURCE") ]
|
src = [ "-s", app.config.get("IPV6_SOURCE") ]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
traceroute = traceroute4
|
traceroute = traceroute4
|
||||||
if app.config.get("IPV4_SOURCE",""):
|
if app.config.get("IPV4_SOURCE",""):
|
||||||
|
@ -97,11 +96,9 @@ def traceroute():
|
||||||
options = [ '-A', '-q1', '-N32', '-w1', '-m15' ]
|
options = [ '-A', '-q1', '-N32', '-w1', '-m15' ]
|
||||||
command = traceroute + src + options + [ query ]
|
command = traceroute + src + options + [ query ]
|
||||||
result = subprocess.Popen( command , stdout=subprocess.PIPE).communicate()[0].decode('utf-8', 'ignore').replace("\n","<br>")
|
result = subprocess.Popen( command , stdout=subprocess.PIPE).communicate()[0].decode('utf-8', 'ignore').replace("\n","<br>")
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@app.route("/bird")
|
@app.route("/bird")
|
||||||
@app.route("/bird6")
|
@app.route("/bird6")
|
||||||
def bird():
|
def bird():
|
||||||
|
|
Loading…
Reference in a new issue