Commit 86d60379 by Bach Dániel

fix flake8 warnings

parent 77c2960d
...@@ -33,7 +33,7 @@ class ProxyClientProtocol(protocol.Protocol): ...@@ -33,7 +33,7 @@ class ProxyClientProtocol(protocol.Protocol):
self.cli_queue.get().addCallback(self.serverDataReceived) self.cli_queue.get().addCallback(self.serverDataReceived)
def serverDataReceived(self, chunk): def serverDataReceived(self, chunk):
if chunk is False: if not chunk:
self.cli_queue = None self.cli_queue = None
logger.info("Client(%s): disconnecting from qemu (%s)", logger.info("Client(%s): disconnecting from qemu (%s)",
self.factory.src, self.dst) self.factory.src, self.dst)
...@@ -105,7 +105,7 @@ class VNCWebSocketHandler(Protocol): ...@@ -105,7 +105,7 @@ class VNCWebSocketHandler(Protocol):
reactor.connectTCP(host, int(port), factory) reactor.connectTCP(host, int(port), factory)
def clientDataReceived(self, chunk): def clientDataReceived(self, chunk):
if chunk is False: if not chunk:
self.transport.loseConnection() self.transport.loseConnection()
else: else:
logger.debug("Server(%s): writing %d bytes to original client", logger.debug("Server(%s): writing %d bytes to original client",
......
...@@ -12,10 +12,6 @@ factory. ...@@ -12,10 +12,6 @@ factory.
@since: 13.2 @since: 13.2
""" """
__all__ = ["WebSocketsResource", "IWebSocketsFrameReceiver",
"lookupProtocolForFactory", "WebSocketsProtocol",
"WebSocketsProtocolWrapper", "CONTROLS", "STATUSES"]
import base64 import base64
from hashlib import sha1 from hashlib import sha1
...@@ -31,6 +27,11 @@ from twisted.web.resource import IResource ...@@ -31,6 +27,11 @@ from twisted.web.resource import IResource
from twisted.web.server import NOT_DONE_YET from twisted.web.server import NOT_DONE_YET
__all__ = ["WebSocketsResource", "IWebSocketsFrameReceiver",
"lookupProtocolForFactory", "WebSocketsProtocol",
"WebSocketsProtocolWrapper", "CONTROLS", "STATUSES"]
class _WSException(Exception): class _WSException(Exception):
""" """
Internal exception for control flow inside the WebSockets frame parser. Internal exception for control flow inside the WebSockets frame parser.
...@@ -457,7 +458,7 @@ class _WebSocketsProtocolWrapperReceiver(): ...@@ -457,7 +458,7 @@ class _WebSocketsProtocolWrapperReceiver():
@type fin: C{bool} @type fin: C{bool}
@param fin: Whether or not the frame is final. @param fin: Whether or not the frame is final.
""" """
if not opcode in (CONTROLS.BINARY, CONTROLS.TEXT, CONTROLS.CONTINUE): if opcode not in (CONTROLS.BINARY, CONTROLS.TEXT, CONTROLS.CONTINUE):
return return
self._messages.append(data) self._messages.append(data)
if fin: if fin:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment