Add no-upload option
This commit is contained in:
parent
756f04da76
commit
ce8cef35fa
|
@ -464,6 +464,7 @@ def speedtest():
|
||||||
parser.add_argument('--source', help='Source IP address to bind to')
|
parser.add_argument('--source', help='Source IP address to bind to')
|
||||||
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('--no-upload', action='store_true', help='no upload speed test')
|
||||||
|
|
||||||
options = parser.parse_args()
|
options = parser.parse_args()
|
||||||
if isinstance(options, tuple):
|
if isinstance(options, tuple):
|
||||||
|
@ -523,7 +524,7 @@ def speedtest():
|
||||||
except IndexError:
|
except IndexError:
|
||||||
print_('Invalid server ID')
|
print_('Invalid server ID')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
elif args.mini:
|
elif not args.no_upload and args.mini:
|
||||||
name, ext = os.path.splitext(args.mini)
|
name, ext = os.path.splitext(args.mini)
|
||||||
if ext:
|
if ext:
|
||||||
url = os.path.dirname(args.mini)
|
url = os.path.dirname(args.mini)
|
||||||
|
@ -591,12 +592,13 @@ def speedtest():
|
||||||
for size in sizesizes:
|
for size in sizesizes:
|
||||||
for i in range(0, 25):
|
for i in range(0, 25):
|
||||||
sizes.append(size)
|
sizes.append(size)
|
||||||
if not args.simple:
|
if not args.no_upload:
|
||||||
print_('Testing upload speed', end='')
|
if not args.simple:
|
||||||
ulspeed = uploadSpeed(best['url'], sizes, args.simple)
|
print_('Testing upload speed', end='')
|
||||||
if not args.simple:
|
ulspeed = uploadSpeed(best['url'], sizes, args.simple)
|
||||||
print_()
|
if not args.simple:
|
||||||
print_('Upload: %0.2f Mbit/s' % ((ulspeed / 1000 / 1000) * 8))
|
print_()
|
||||||
|
print_('Upload: %0.2f Mbit/s' % ((ulspeed / 1000 / 1000) * 8))
|
||||||
|
|
||||||
if args.share and args.mini:
|
if args.share and args.mini:
|
||||||
print_('Cannot generate a speedtest.net share results image while '
|
print_('Cannot generate a speedtest.net share results image while '
|
||||||
|
|
Loading…
Reference in New Issue