commit python-websocket-client for openSUSE:Factory
Hello community, here is the log from the commit of package python-websocket-client for openSUSE:Factory checked in at 2015-10-30 13:43:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-websocket-client (Old) and /work/SRC/openSUSE:Factory/.python-websocket-client.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-websocket-client" Changes: -------- --- /work/SRC/openSUSE:Factory/python-websocket-client/python-websocket-client.changes 2015-08-01 11:36:57.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-websocket-client.new/python-websocket-client.changes 2015-10-30 13:43:30.000000000 +0100 @@ -1,0 +2,11 @@ +Wed Oct 21 16:56:55 UTC 2015 - dmueller@suse.com + +- update to 0.32.0: + - fix http proxy bug (#189) + - Avoid deprecated BaseException.message (#180) + - Add travis builds (#182) + - fixed wsdump to work with piped input (#183) + - fixed output of wsdump.py with python3 (#185) + - add raw mode to wsdump.py (#186) + +------------------------------------------------------------------- Old: ---- websocket_client-0.30.0.tar.gz New: ---- websocket_client-0.32.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-websocket-client.spec ++++++ --- /var/tmp/diff_new_pack.zqe9R7/_old 2015-10-30 13:43:32.000000000 +0100 +++ /var/tmp/diff_new_pack.zqe9R7/_new 2015-10-30 13:43:32.000000000 +0100 @@ -24,7 +24,7 @@ %endif Name: python-websocket-client -Version: 0.30.0 +Version: 0.32.0 Release: 0 Summary: WebSocket client implementation License: LGPL-2.1 ++++++ websocket_client-0.30.0.tar.gz -> websocket_client-0.32.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.30.0/ChangeLog new/websocket_client-0.32.0/ChangeLog --- old/websocket_client-0.30.0/ChangeLog 2015-04-28 02:10:55.000000000 +0200 +++ new/websocket_client-0.32.0/ChangeLog 2015-06-03 02:44:39.000000000 +0200 @@ -1,6 +1,18 @@ ChangeLog ============ +- 0.32.0 + + - fix http proxy bug (#189) + +- 0.31.0 + + - Avoid deprecated BaseException.message (#180) + - Add travis builds (#182) + - fixed wsdump to work with piped input (#183) + - fixed output of wsdump.py with python3 (#185) + - add raw mode to wsdump.py (#186) + - 0.30.0 - fixed if client is behind proxy (#169) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.30.0/PKG-INFO new/websocket_client-0.32.0/PKG-INFO --- old/websocket_client-0.30.0/PKG-INFO 2015-04-28 02:13:24.000000000 +0200 +++ new/websocket_client-0.32.0/PKG-INFO 2015-06-03 02:45:15.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: websocket_client -Version: 0.30.0 +Version: 0.32.0 Summary: WebSocket client for python. hybi13 is supported. Home-page: https://github.com/liris/websocket-client Author: liris diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.30.0/bin/wsdump.py new/websocket_client-0.32.0/bin/wsdump.py --- old/websocket_client-0.30.0/bin/wsdump.py 2015-03-10 07:36:38.000000000 +0100 +++ new/websocket_client-0.32.0/bin/wsdump.py 2015-05-22 04:01:33.000000000 +0200 @@ -5,6 +5,7 @@ import six import sys import threading +import time import websocket try: import readline @@ -12,8 +13,17 @@ pass +def get_encoding(): + encoding = getattr(sys.stdin, "encoding", "") + if not encoding: + return "utf-8" + else: + return encoding.lower() + + OPCODE_DATA = (websocket.ABNF.OPCODE_TEXT, websocket.ABNF.OPCODE_BINARY) -ENCODING = getattr(sys.stdin, "encoding", "").lower() +ENCODING = get_encoding() + class VAction(argparse.Action): def __call__(self, parser, args, values, option_string=None): @@ -35,24 +45,20 @@ "If set to 2, enable to trace websocket module") parser.add_argument("-n", "--nocert", action='store_true', help="Ignore invalid SSL cert") + parser.add_argument("-r", "--raw", action="store_true", + help="raw output") parser.add_argument("-s", "--subprotocols", nargs='*', help="Set subprotocols") parser.add_argument("-o", "--origin", help="Set origin") + parser.add_argument("--eof-wait", default=0, type=int, + help="wait time(second) after 'EOF' recieved.") parser.add_argument("-t", "--text", help="Send initial text") return parser.parse_args() - -class InteractiveConsole(code.InteractiveConsole): - def write(self, data): - sys.stdout.write("\033[2K\033[E") - # sys.stdout.write("\n") - sys.stdout.write("\033[34m" + data + "\033[39m") - sys.stdout.write("\n> ") - sys.stdout.flush() - +class RawInput(): def raw_input(self, prompt): if six.PY3: line = input(prompt) @@ -66,10 +72,28 @@ return line +class InteractiveConsole(RawInput, code.InteractiveConsole): + def write(self, data): + sys.stdout.write("\033[2K\033[E") + # sys.stdout.write("\n") + sys.stdout.write("\033[34m< " + data + "\033[39m") + sys.stdout.write("\n> ") + sys.stdout.flush() + + def read(self): + return self.raw_input("> ") + +class NonInteractive(RawInput): + def write(self, data): + sys.stdout.write(data) + sys.stdout.write("\n") + sys.stdout.flush() + + def read(self): + return self.raw_input("") def main(): args = parse_args() - console = InteractiveConsole() if args.verbose > 1: websocket.enableTrace(True) options = {} @@ -81,7 +105,11 @@ if (args.nocert): opts = { "cert_reqs": websocket.ssl.CERT_NONE, "check_hostname": False } ws = websocket.create_connection(args.url, sslopt=opts, **options) - print("Press Ctrl+C to quit") + if args.raw: + console = NonInteractive() + else: + console = InteractiveConsole() + print("Press Ctrl+C to quit") def recv(): try: @@ -106,12 +134,14 @@ while True: opcode, data = recv() msg = None + if six.PY3 and opcode == websocket.ABNF.OPCODE_TEXT and isinstance(data, bytes): + data = str(data, "utf-8") if not args.verbose and opcode in OPCODE_DATA: - msg = "< %s" % data + msg = data elif args.verbose: - msg = "< %s: %s" % (websocket.ABNF.OPCODE_MAP.get(opcode), data) + msg = "%s: %s" % (websocket.ABNF.OPCODE_MAP.get(opcode), data) - if msg: + if msg is not None: console.write(msg) if opcode == websocket.ABNF.OPCODE_CLOSE: @@ -126,11 +156,12 @@ while True: try: - message = console.raw_input("> ") + message = console.read() ws.send(message) except KeyboardInterrupt: return except EOFError: + time.sleep(args.eof_wait) return diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.30.0/setup.py new/websocket_client-0.32.0/setup.py --- old/websocket_client-0.30.0/setup.py 2015-04-28 02:10:55.000000000 +0200 +++ new/websocket_client-0.32.0/setup.py 2015-06-03 02:44:39.000000000 +0200 @@ -1,7 +1,7 @@ from setuptools import setup import sys -VERSION = "0.30.0" +VERSION = "0.32.0" NAME="websocket_client" install_requires = ["six"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.30.0/websocket/__init__.py new/websocket_client-0.32.0/websocket/__init__.py --- old/websocket_client-0.30.0/websocket/__init__.py 2015-04-28 02:10:55.000000000 +0200 +++ new/websocket_client-0.32.0/websocket/__init__.py 2015-06-03 02:44:39.000000000 +0200 @@ -22,4 +22,4 @@ from ._core import * from ._app import WebSocketApp -__version__ = "0.30.0" +__version__ = "0.32.0" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.30.0/websocket/_handshake.py new/websocket_client-0.32.0/websocket/_handshake.py --- old/websocket_client-0.30.0/websocket/_handshake.py 2015-04-28 02:10:55.000000000 +0200 +++ new/websocket_client-0.32.0/websocket/_handshake.py 2015-05-22 04:01:33.000000000 +0200 @@ -47,6 +47,7 @@ self.headers = headers self.subprotocol = subprotocol + def handshake(sock, hostname, port, resource, **options): headers, key = _get_handshake_headers(resource, hostname, port, options) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.30.0/websocket/_http.py new/websocket_client-0.32.0/websocket/_http.py --- old/websocket_client-0.30.0/websocket/_http.py 2015-04-28 02:10:55.000000000 +0200 +++ new/websocket_client-0.32.0/websocket/_http.py 2015-06-03 02:44:39.000000000 +0200 @@ -184,7 +184,8 @@ if status != 200: raise WebSocketProxyException( "failed CONNECT via proxy status: %r" + status) - + + return sock def read_headers(sock): status = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.30.0/websocket/_utils.py new/websocket_client-0.32.0/websocket/_utils.py --- old/websocket_client-0.30.0/websocket/_utils.py 2015-04-01 00:47:57.000000000 +0200 +++ new/websocket_client-0.32.0/websocket/_utils.py 2015-05-22 04:01:33.000000000 +0200 @@ -85,8 +85,4 @@ def extract_err_message(exception): - message = getattr(exception, 'strerror', '') - if not message: - message = getattr(exception, 'message', '') - - return message + return getattr(exception, 'strerror', str(exception)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.30.0/websocket/tests/test_websocket.py new/websocket_client-0.32.0/websocket/tests/test_websocket.py --- old/websocket_client-0.30.0/websocket/tests/test_websocket.py 2015-04-28 02:10:55.000000000 +0200 +++ new/websocket_client-0.32.0/websocket/tests/test_websocket.py 2015-05-22 04:01:33.000000000 +0200 @@ -23,6 +23,12 @@ import uuid +if six.PY3: + from base64 import decodebytes as base64decode +else: + from base64 import decodestring as base64decode + + # websocket-client import websocket as ws from websocket._handshake import _create_sec_websocket_key @@ -33,8 +39,7 @@ # Skip test to access the internet. -TEST_WITH_INTERNET = False -# TEST_WITH_INTERNET = True +TEST_WITH_INTERNET = os.environ.get('TEST_WITH_INTERNET', '0') == '1' # Skip Secure WebSocket test. TEST_SECURE_WS = True @@ -463,7 +468,7 @@ """ WebSocket key should be a UUID4. """ key = _create_sec_websocket_key() - u = uuid.UUID(bytes=base64.b64decode(key)) + u = uuid.UUID(bytes=base64decode(key.encode("utf-8"))) self.assertEqual(4, u.version) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/websocket_client-0.30.0/websocket_client.egg-info/PKG-INFO new/websocket_client-0.32.0/websocket_client.egg-info/PKG-INFO --- old/websocket_client-0.30.0/websocket_client.egg-info/PKG-INFO 2015-04-28 02:13:22.000000000 +0200 +++ new/websocket_client-0.32.0/websocket_client.egg-info/PKG-INFO 2015-06-03 02:45:13.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: websocket-client -Version: 0.30.0 +Version: 0.32.0 Summary: WebSocket client for python. hybi13 is supported. Home-page: https://github.com/liris/websocket-client Author: liris
participants (1)
-
root@hilbert.suse.de