Basic python reformatting

Transform all tabs to spaces and remove trailing spaces.
This commit is contained in:
Baptiste Jonglez 2020-06-15 22:34:25 +02:00
parent ca4550ae74
commit a45ae45408
4 changed files with 156 additions and 164 deletions

View File

@ -171,7 +171,4 @@ class BirdSocket:
return True, parsed_string
__all__ = ['BirdSocketSingleton' , 'BirdSocket' ]
__all__ = ['BirdSocketSingleton', 'BirdSocket']

2
lg.py
View File

@ -461,7 +461,6 @@ def show_bgpmap():
if "%s*" % label_without_star not in labels:
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)
label = escape("\r".join(labels))
e.set_label(label)
return edges[edge_tuple]
@ -511,7 +510,6 @@ def show_bgpmap():
else:
hop_label = ""
if _as == asmap[-1]:
add_node(_as, fillcolor="#F5A9A9", shape="box", )
else:

View File

@ -78,9 +78,8 @@ def traceroute():
src = []
if request.path == '/traceroute6':
traceroute = traceroute6
if app.config.get("IPV6_SOURCE",""):
if app.config.get("IPV6_SOURCE", ""):
src = [ "-s", app.config.get("IPV6_SOURCE") ]
else:
traceroute = traceroute4
if app.config.get("IPV4_SOURCE",""):
@ -97,11 +96,9 @@ def traceroute():
options = [ '-A', '-q1', '-N32', '-w1', '-m15' ]
command = traceroute + src + options + [ query ]
result = subprocess.Popen( command , stdout=subprocess.PIPE).communicate()[0].decode('utf-8', 'ignore').replace("\n","<br>")
return result
@app.route("/bird")
@app.route("/bird6")
def bird():