Restored the selection of the best server for searching by name
This commit is contained in:
parent
a0ccd6a166
commit
f72c77ee1b
|
@ -1432,14 +1432,10 @@ def shell():
|
||||||
print_('Cannot retrieve speedtest server list')
|
print_('Cannot retrieve speedtest server list')
|
||||||
raise SpeedtestCLIError(get_exception())
|
raise SpeedtestCLIError(get_exception())
|
||||||
|
|
||||||
for _, items in sorted(speedtest.servers.items()):
|
for _, items in speedtest.servers.items():
|
||||||
for server in items:
|
for server in items:
|
||||||
if (server['name'].lower() == args.server.lower()):
|
if (server['name'].lower() == args.server.lower()):
|
||||||
servers.append(int(server['id']))
|
servers.append(int(server['id']))
|
||||||
break
|
|
||||||
else:
|
|
||||||
continue
|
|
||||||
break
|
|
||||||
|
|
||||||
if not servers:
|
if not servers:
|
||||||
raise SpeedtestCLIError('Server was not found: '
|
raise SpeedtestCLIError('Server was not found: '
|
||||||
|
|
Loading…
Reference in New Issue