This commit is contained in:
Andrew Molyneux 2013-07-28 12:16:15 -07:00
commit 451e2d9219
1 changed files with 5 additions and 3 deletions

View File

@ -401,6 +401,7 @@ def speedtest():
if not args.simple: if not args.simple:
print_('Testing from %(isp)s (%(ip)s)...' % config['client']) print_('Testing from %(isp)s (%(ip)s)...' % config['client'])
best = None
if args.server: if args.server:
try: try:
best = getBestServer(filter(lambda x: x['id'] == args.server, best = getBestServer(filter(lambda x: x['id'] == args.server,
@ -440,9 +441,10 @@ def speedtest():
except: except:
best = servers[0] best = servers[0]
else: else:
if not args.simple: if best is None:
print_('Selecting best server based on ping...') if not args.simple:
best = getBestServer(servers) print_('Selecting best server based on ping...')
best = getBestServer(servers)
if not args.simple: if not args.simple:
print_('Hosted by %(sponsor)s (%(name)s) [%(d)0.2f km]: ' print_('Hosted by %(sponsor)s (%(name)s) [%(d)0.2f km]: '