Added the ability for the application to return the results as part of another programs run process
This commit is contained in:
parent
7b09d8759f
commit
942f551188
|
@ -547,7 +547,7 @@ def version():
|
|||
raise SystemExit(__version__)
|
||||
|
||||
|
||||
def speedtest():
|
||||
def speedtest(**kwargs):
|
||||
"""Run the full speedtest.net test"""
|
||||
|
||||
global shutdown_event, source, scheme
|
||||
|
@ -715,7 +715,7 @@ def speedtest():
|
|||
urls.append('%s/random%sx%s.jpg' %
|
||||
(os.path.dirname(best['url']), size, size))
|
||||
if not args.simple:
|
||||
print_('Testing download speed', end='')
|
||||
print_('Testing download speed PJW', end='')
|
||||
dlspeed = downloadSpeed(urls, args.simple)
|
||||
if not args.simple:
|
||||
print_()
|
||||
|
@ -784,6 +784,13 @@ def speedtest():
|
|||
print_('Share results: %s://www.speedtest.net/result/%s.png' %
|
||||
(scheme, resultid[0]))
|
||||
|
||||
speeds = {
|
||||
'DL': (dlspeed / 1000 / 1000) * args.units[1],
|
||||
'UL': (ulspeed / 1000 / 1000) * args.units[1]
|
||||
}
|
||||
|
||||
return speeds
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue