Merge 4be797d5cd
into d712f947d9
This commit is contained in:
commit
7bbd1b6f55
34
speedtest.py
34
speedtest.py
|
@ -1228,6 +1228,10 @@ def parse_args():
|
||||||
parser.add_argument('--secure', action='store_true',
|
parser.add_argument('--secure', action='store_true',
|
||||||
help='Use HTTPS instead of HTTP when communicating '
|
help='Use HTTPS instead of HTTP when communicating '
|
||||||
'with speedtest.net operated servers')
|
'with speedtest.net operated servers')
|
||||||
|
parser.add_argument('--no-download', action='store_true', default=False,
|
||||||
|
help='Skip the download test')
|
||||||
|
parser.add_argument('--no-upload', action='store_true', default=False,
|
||||||
|
help='Skip the upload test')
|
||||||
parser.add_argument('--version', action='store_true',
|
parser.add_argument('--version', action='store_true',
|
||||||
help='Show the version number and exit')
|
help='Show the version number and exit')
|
||||||
parser.add_argument('--debug', action='store_true',
|
parser.add_argument('--debug', action='store_true',
|
||||||
|
@ -1388,21 +1392,23 @@ def shell():
|
||||||
printer('Hosted by %(sponsor)s (%(name)s) [%(d)0.2f km]: '
|
printer('Hosted by %(sponsor)s (%(name)s) [%(d)0.2f km]: '
|
||||||
'%(latency)s ms' % results.server, quiet)
|
'%(latency)s ms' % results.server, quiet)
|
||||||
|
|
||||||
printer('Testing download speed', quiet,
|
if not args.no_download:
|
||||||
end=('', '\n')[bool(debug)])
|
printer('Testing download speed', quiet,
|
||||||
speedtest.download(callback=callback)
|
end=('', '\n')[bool(debug)])
|
||||||
printer('Download: %0.2f M%s/s' %
|
speedtest.download(callback=callback)
|
||||||
((results.download / 1000.0 / 1000.0) / args.units[1],
|
printer('Download: %0.2f M%s/s' %
|
||||||
args.units[0]),
|
((results.download / 1000.0 / 1000.0) / args.units[1],
|
||||||
quiet)
|
args.units[0]),
|
||||||
|
quiet)
|
||||||
|
|
||||||
printer('Testing upload speed', quiet,
|
if not args.no_upload:
|
||||||
end=('', '\n')[bool(debug)])
|
printer('Testing upload speed', quiet,
|
||||||
speedtest.upload(callback=callback)
|
end=('', '\n')[bool(debug)])
|
||||||
printer('Upload: %0.2f M%s/s' %
|
speedtest.upload(callback=callback)
|
||||||
((results.upload / 1000.0 / 1000.0) / args.units[1],
|
printer('Upload: %0.2f M%s/s' %
|
||||||
args.units[0]),
|
((results.upload / 1000.0 / 1000.0) / args.units[1],
|
||||||
quiet)
|
args.units[0]),
|
||||||
|
quiet)
|
||||||
|
|
||||||
if args.simple:
|
if args.simple:
|
||||||
print_('Ping: %s ms\nDownload: %0.2f M%s/s\nUpload: %0.2f M%s/s' %
|
print_('Ping: %s ms\nDownload: %0.2f M%s/s\nUpload: %0.2f M%s/s' %
|
||||||
|
|
Loading…
Reference in New Issue