Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-05-19 13:46:56 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-05-19 14:12:36 +0200
commitaf83219d8a6e7ac1c0c8776f61b99ee37f30ef04 (patch)
tree51fa216a02cefef75aef77313a048bf879c91a32 /examples/webchannel/standalone/websocketclientwrapper.py
parent8cd50636102be2e1178c8c602a3e374891398e3e (diff)
Polish the QtWebChannel example
- Rename according to snake case conventions - Connect sending to QLineEdit.returnPressed Task-number: PYSIDE-1112 Change-Id: Ia0e1b81309985219688739a4cead8a252acd8dcc Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'examples/webchannel/standalone/websocketclientwrapper.py')
-rw-r--r--examples/webchannel/standalone/websocketclientwrapper.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/webchannel/standalone/websocketclientwrapper.py b/examples/webchannel/standalone/websocketclientwrapper.py
index 96aa79a08..f8a196b49 100644
--- a/examples/webchannel/standalone/websocketclientwrapper.py
+++ b/examples/webchannel/standalone/websocketclientwrapper.py
@@ -1,7 +1,7 @@
#############################################################################
##
## Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.com>
-## Copyright (C) 2020 The Qt Company Ltd.
+## Copyright (C) 2021 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/
##
## This file is part of the Qt for Python examples of the Qt Toolkit.
@@ -51,7 +51,7 @@ class WebSocketClientWrapper(QObject):
the WebChannel. Any kind of remote JavaScript client that supports
WebSockets can thus receive messages and access the published objects.
"""
- clientConnected = Signal(WebSocketTransport)
+ client_connected = Signal(WebSocketTransport)
def __init__(self, server, parent=None):
"""Construct the client wrapper with the given parent. All clients
@@ -59,14 +59,14 @@ class WebSocketClientWrapper(QObject):
in WebSocketTransport objects."""
super().__init__(parent)
self._server = server
- self._server.newConnection.connect(self.handleNewConnection)
+ self._server.newConnection.connect(self.handle_new_connection)
self._transports = []
@Slot()
- def handleNewConnection(self):
+ def handle_new_connection(self):
"""Wrap an incoming WebSocket connection in a WebSocketTransport
object."""
socket = self._server.nextPendingConnection()
transport = WebSocketTransport(socket)
self._transports.append(transport)
- self.clientConnected.emit(transport)
+ self.client_connected.emit(transport)