Commit 86d60379 by Bach Dániel

fix flake8 warnings

parent 77c2960d
......@@ -33,7 +33,7 @@ class ProxyClientProtocol(protocol.Protocol):
self.cli_queue.get().addCallback(self.serverDataReceived)
def serverDataReceived(self, chunk):
if chunk is False:
if not chunk:
self.cli_queue = None
logger.info("Client(%s): disconnecting from qemu (%s)",
self.factory.src, self.dst)
......@@ -105,7 +105,7 @@ class VNCWebSocketHandler(Protocol):
reactor.connectTCP(host, int(port), factory)
def clientDataReceived(self, chunk):
if chunk is False:
if not chunk:
self.transport.loseConnection()
else:
logger.debug("Server(%s): writing %d bytes to original client",
......
......@@ -12,10 +12,6 @@ factory.
@since: 13.2
"""
__all__ = ["WebSocketsResource", "IWebSocketsFrameReceiver",
"lookupProtocolForFactory", "WebSocketsProtocol",
"WebSocketsProtocolWrapper", "CONTROLS", "STATUSES"]
import base64
from hashlib import sha1
......@@ -31,6 +27,11 @@ from twisted.web.resource import IResource
from twisted.web.server import NOT_DONE_YET
__all__ = ["WebSocketsResource", "IWebSocketsFrameReceiver",
"lookupProtocolForFactory", "WebSocketsProtocol",
"WebSocketsProtocolWrapper", "CONTROLS", "STATUSES"]
class _WSException(Exception):
"""
Internal exception for control flow inside the WebSockets frame parser.
......@@ -457,7 +458,7 @@ class _WebSocketsProtocolWrapperReceiver():
@type fin: C{bool}
@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
self._messages.append(data)
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