Hello community, here is the log from the commit of package speedtest-cli for openSUSE:Factory checked in at 2019-03-28 22:49:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/speedtest-cli (Old) and /work/SRC/openSUSE:Factory/.speedtest-cli.new.25356 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "speedtest-cli" Thu Mar 28 22:49:04 2019 rev:10 rq:689271 version:2.1.1 Changes: -------- --- /work/SRC/openSUSE:Factory/speedtest-cli/speedtest-cli.changes 2019-03-06 15:52:12.696426079 +0100 +++ /work/SRC/openSUSE:Factory/.speedtest-cli.new.25356/speedtest-cli.changes 2019-03-28 22:49:04.915050445 +0100 @@ -1,0 +2,16 @@ +Tue Mar 26 17:14:55 UTC 2019 - Michal Svec <[email protected]> + +- Update to version 2.1.1: + * Fix SSL support on Python2.4 and Python2.5 +- Update to version 2.1.0: + * Automatically resolve .best property + * Pass Content-Length header with POST requests + * Fix install instructions with git clone + * Add functionality for single threaded testing + * Add debug support to show if a URL request resulted in a redirect + * Add the python version to the version output + * Switch from platform.system to platform.platform when building the User-Agent header + * Don't pass server_hostname to ssl.wrap_socket + * ensure ERROR doesn't print an empty string + +------------------------------------------------------------------- Old: ---- speedtest-cli-2.0.2.tar.gz New: ---- speedtest-cli-2.1.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ speedtest-cli.spec ++++++ --- /var/tmp/diff_new_pack.JMMlGc/_old 2019-03-28 22:49:05.307050374 +0100 +++ /var/tmp/diff_new_pack.JMMlGc/_new 2019-03-28 22:49:05.307050374 +0100 @@ -18,7 +18,7 @@ %define oname speedtest_cli Name: speedtest-cli -Version: 2.0.2 +Version: 2.1.1 Release: 0 Summary: Command line interface for testing internet bandwidth License: Apache-2.0 ++++++ speedtest-cli-2.0.2.tar.gz -> speedtest-cli-2.1.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/speedtest-cli-2.0.2/README.rst new/speedtest-cli-2.1.1/README.rst --- old/speedtest-cli-2.0.2/README.rst 2018-05-24 18:06:29.000000000 +0200 +++ new/speedtest-cli-2.1.1/README.rst 2019-03-12 17:01:31.000000000 +0100 @@ -51,7 +51,8 @@ :: git clone https://github.com/sivel/speedtest-cli.git - python speedtest-cli/setup.py install + cd speedtest-cli + python setup.py install Just download (Like the way it used to be) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -74,21 +75,23 @@ :: $ speedtest-cli -h - usage: speedtest-cli [-h] [--no-download] [--no-upload] [--bytes] [--share] - [--simple] [--csv] [--csv-delimiter CSV_DELIMITER] - [--csv-header] [--json] [--list] [--server SERVER] - [--exclude EXCLUDE] [--mini MINI] [--source SOURCE] - [--timeout TIMEOUT] [--secure] [--no-pre-allocate] - [--version] - + usage: speedtest-cli [-h] [--no-download] [--no-upload] [--single] [--bytes] + [--share] [--simple] [--csv] + [--csv-delimiter CSV_DELIMITER] [--csv-header] [--json] + [--list] [--server SERVER] [--exclude EXCLUDE] + [--mini MINI] [--source SOURCE] [--timeout TIMEOUT] + [--secure] [--no-pre-allocate] [--version] + Command line interface for testing internet bandwidth using speedtest.net. -------------------------------------------------------------------------- https://github.com/sivel/speedtest-cli - + optional arguments: -h, --help show this help message and exit --no-download Do not perform download test --no-upload Do not perform upload test + --single Only use a single connection instead of multiple. This + simulates a typical file transfer. --bytes Display values in bytes instead of bits. Does not affect the image generated by --share, nor output from --json or --csv diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/speedtest-cli-2.0.2/setup.py new/speedtest-cli-2.1.1/setup.py --- old/speedtest-cli-2.0.2/setup.py 2018-05-24 18:06:29.000000000 +0200 +++ new/speedtest-cli-2.1.1/setup.py 2019-03-12 17:01:31.000000000 +0100 @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright 2012-2018 Matt Martz +# Copyright 2012 Matt Martz # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/speedtest-cli-2.0.2/speedtest-cli.1 new/speedtest-cli-2.1.1/speedtest-cli.1 --- old/speedtest-cli-2.0.2/speedtest-cli.1 2018-05-24 18:06:29.000000000 +0200 +++ new/speedtest-cli-2.1.1/speedtest-cli.1 2019-03-12 17:01:31.000000000 +0100 @@ -33,6 +33,11 @@ Do not perform upload test .RE +\fB\-\-single\fR +.RS +Only use a single connection instead of multiple. This simulates a typical file transfer. +.RE + \fB\-\-bytes\fR .RS Display values in bytes instead of bits. Does not affect the image generated by \-\-share, nor output from \-\-json or \-\-csv diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/speedtest-cli-2.0.2/speedtest.py new/speedtest-cli-2.1.1/speedtest.py --- old/speedtest-cli-2.0.2/speedtest.py 2018-05-24 18:06:29.000000000 +0200 +++ new/speedtest-cli-2.1.1/speedtest.py 2019-03-12 17:01:31.000000000 +0100 @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright 2012-2018 Matt Martz +# Copyright 2012 Matt Martz # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -36,7 +36,7 @@ gzip = None GZIP_BASE = object -__version__ = '2.0.2' +__version__ = '2.1.1' class FakeShutdownEvent(object): @@ -98,6 +98,11 @@ HTTPSConnection = None try: + from httplib import FakeSocket +except ImportError: + FakeSocket = None + +try: from Queue import Queue except ImportError: from queue import Queue @@ -435,14 +440,32 @@ SpeedtestHTTPConnection.connect(self) - kwargs = {} if ssl: - if hasattr(ssl, 'SSLContext'): - kwargs['server_hostname'] = self.host try: + kwargs = {} + if hasattr(ssl, 'SSLContext'): + kwargs['server_hostname'] = self.host self.sock = self._context.wrap_socket(self.sock, **kwargs) except AttributeError: - self.sock = ssl.wrap_socket(self.sock, **kwargs) + self.sock = ssl.wrap_socket(self.sock) + try: + self.sock.server_hostname = self.host + except AttributeError: + pass + elif FakeSocket: + # Python 2.4/2.5 support + try: + self.sock = FakeSocket(self.sock, socket.ssl(self.sock)) + except AttributeError: + raise SpeedtestException( + 'This version of Python does not support HTTPS/SSL ' + 'functionality' + ) + else: + raise SpeedtestException( + 'This version of Python does not support HTTPS/SSL ' + 'functionality' + ) def _build_connection(connection, source_address, timeout, context=None): @@ -607,7 +630,8 @@ ua_tuple = ( 'Mozilla/5.0', - '(%s; U; %s; en-us)' % (platform.system(), platform.architecture()[0]), + '(%s; U; %s; en-us)' % (platform.platform(), + platform.architecture()[0]), 'Python/%s' % platform.python_version(), '(KHTML, like Gecko)', 'speedtest-cli/%s' % __version__ @@ -666,6 +690,8 @@ try: uh = _open(request) + if request.get_full_url() != uh.geturl(): + printer('Redirected to %s' % uh.geturl(), debug=True) return uh, False except HTTP_ERRORS: e = get_exception() @@ -1041,10 +1067,7 @@ @property def best(self): if not self._best: - raise SpeedtestMissingBestServer( - 'get_best_server not called or not able to determine best ' - 'server' - ) + self.get_best_server() return self._best def get_config(self): @@ -1439,8 +1462,12 @@ printer('Best Server:\n%r' % best, debug=True) return best - def download(self, callback=do_nothing): - """Test download speed against speedtest.net""" + def download(self, callback=do_nothing, threads=None): + """Test download speed against speedtest.net + + A ``threads`` value of ``None`` will fall back to those dictated + by the speedtest.net configuration + """ urls = [] for size in self.config['sizes']['download']: @@ -1479,7 +1506,7 @@ finished.append(sum(thread.result)) callback(thread.i, request_count, end=True) - q = Queue(self.config['threads']['download']) + q = Queue(threads or self.config['threads']['download']) prod_thread = threading.Thread(target=producer, args=(q, requests, request_count)) cons_thread = threading.Thread(target=consumer, @@ -1501,8 +1528,12 @@ self.config['threads']['upload'] = 8 return self.results.download - def upload(self, callback=do_nothing, pre_allocate=True): - """Test upload speed against speedtest.net""" + def upload(self, callback=do_nothing, pre_allocate=True, threads=None): + """Test upload speed against speedtest.net + + A ``threads`` value of ``None`` will fall back to those dictated + by the speedtest.net configuration + """ sizes = [] @@ -1525,9 +1556,12 @@ ) if pre_allocate: data.pre_allocate() + + headers = {'Content-length': size} requests.append( ( - build_request(self.best['url'], data, secure=self._secure), + build_request(self.best['url'], data, secure=self._secure, + headers=headers), size ) ) @@ -1557,7 +1591,7 @@ finished.append(thread.result) callback(thread.i, request_count, end=True) - q = Queue(self.config['threads']['upload']) + q = Queue(threads or self.config['threads']['upload']) prod_thread = threading.Thread(target=producer, args=(q, requests, request_count)) cons_thread = threading.Thread(target=consumer, @@ -1592,7 +1626,8 @@ def version(): """Print the version""" - printer(__version__) + printer('speedtest-cli %s' % __version__) + printer('Python %s' % sys.version.replace('\n', '')) sys.exit(0) @@ -1625,6 +1660,10 @@ parser.add_argument('--no-upload', dest='upload', default=True, action='store_const', const=False, help='Do not perform upload test') + parser.add_argument('--single', default=False, action='store_true', + help='Only use a single connection instead of ' + 'multiple. This simulates a typical file ' + 'transfer.') parser.add_argument('--bytes', dest='units', action='store_const', const=('byte', 8), default=('bit', 1), help='Display values in bytes instead of bits. Does ' @@ -1839,7 +1878,10 @@ if args.download: printer('Testing download speed', quiet, end=('', '\n')[bool(debug)]) - speedtest.download(callback=callback) + speedtest.download( + callback=callback, + threads=(None, 1)[args.single] + ) printer('Download: %0.2f M%s/s' % ((results.download / 1000.0 / 1000.0) / args.units[1], args.units[0]), @@ -1850,7 +1892,11 @@ if args.upload: printer('Testing upload speed', quiet, end=('', '\n')[bool(debug)]) - speedtest.upload(callback=callback, pre_allocate=args.pre_allocate) + speedtest.upload( + callback=callback, + pre_allocate=args.pre_allocate, + threads=(None, 1)[args.single] + ) printer('Upload: %0.2f M%s/s' % ((results.upload / 1000.0 / 1000.0) / args.units[1], args.units[0]), @@ -1888,7 +1934,10 @@ e = get_exception() # Ignore a successful exit, or argparse exit if getattr(e, 'code', 1) not in (0, 2): - raise SystemExit('ERROR: %s' % e) + msg = '%s' % e + if not msg: + msg = '%r' % e + raise SystemExit('ERROR: %s' % msg) if __name__ == '__main__':
