Bugfix speedtest()

This commit is contained in:
2Shirt 2019-10-02 22:44:36 -07:00
parent cc483abd29
commit 187a29ff6f
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -54,7 +54,7 @@ def speedtest():
"""Run a network speedtest using speedtest-cli."""
cmd = ['speedtest-cli', '--simple']
proc = run_program(cmd, check=False)
output = [line.strip() for line in proc.stdout.splitlines()]
output = [line.strip() for line in proc.stdout.splitlines() if line.strip()]
output = [line.split() for line in output]
output = [(a, float(b), c) for a, b, c in output]
return [f'{a:<10}{b:6.2f} {c}' for a, b, c in output]