Commit 364b9fc6 authored by Alexander Korolkov's avatar Alexander Korolkov

Fix some typos in messages

parent ff14843a
...@@ -85,7 +85,7 @@ class UASocketClient(object): ...@@ -85,7 +85,7 @@ class UASocketClient(object):
self.logger.debug("reading body of message (%s bytes)", size) self.logger.debug("reading body of message (%s bytes)", size)
data = self._socket.read(size) data = self._socket.read(size)
if size != len(data): if size != len(data):
raise Exception("Error, did not received expected number of bytes, got {}, asked for {}".format(len(data), size)) raise Exception("Error, did not receive expected number of bytes, got {}, asked for {}".format(len(data), size))
return utils.Buffer(data) return utils.Buffer(data)
def _receive(self): def _receive(self):
...@@ -99,7 +99,7 @@ class UASocketClient(object): ...@@ -99,7 +99,7 @@ class UASocketClient(object):
body.data = body_chunk + body.data body.data = body_chunk + body.data
break break
elif hdr.ChunkType == b"C": elif hdr.ChunkType == b"C":
self.logger.debug("Received a an intermediate message with header %s, waiting for next message", hdr) self.logger.debug("Received an intermediate message with header %s, waiting for next message", hdr)
body_chunk += body.data body_chunk += body.data
else: else:
self.logger.warning("Received a message with unknown ChunkType %s, in header %s", hdr.ChunkType, hdr) self.logger.warning("Received a message with unknown ChunkType %s, in header %s", hdr.ChunkType, hdr)
......
...@@ -87,7 +87,7 @@ class BinaryServer(object): ...@@ -87,7 +87,7 @@ class BinaryServer(object):
coro = self.loop.create_server(OPCUAProtocol, self.hostname, self.port) coro = self.loop.create_server(OPCUAProtocol, self.hostname, self.port)
self._server = self.loop.run_coro_and_wait(coro) self._server = self.loop.run_coro_and_wait(coro)
print('Listening on %s:%s', self._server.sockets[0].getsockname(), self.port) print('Listening on {}:{}'.format(self.hostname, self.port))
def stop(self): def stop(self):
print("Closing asyncio socket server") print("Closing asyncio socket server")
......
...@@ -368,6 +368,6 @@ class UAProcessor(object): ...@@ -368,6 +368,6 @@ class UAProcessor(object):
to be called when client has disconnected to ensure we really close to be called when client has disconnected to ensure we really close
everything we should everything we should
""" """
print("Cleanup up client connection: ", self.name) print("Cleanup client connection: ", self.name)
if self.session: if self.session:
self.session.close_session(True) self.session.close_session(True)
...@@ -869,7 +869,7 @@ class DataValue(FrozenClass): ...@@ -869,7 +869,7 @@ class DataValue(FrozenClass):
return obj return obj
def __str__(self): def __str__(self):
s = 'DataValue(Value:{})'.format(self.Value) s = 'DataValue(Value:{}'.format(self.Value)
if self.StatusCode is not None: if self.StatusCode is not None:
s += ', StatusCode:{}'.format(self.StatusCode) s += ', StatusCode:{}'.format(self.StatusCode)
if self.SourceTimestamp is not None: if self.SourceTimestamp is not None:
......
...@@ -36,7 +36,7 @@ class Buffer(object): ...@@ -36,7 +36,7 @@ class Buffer(object):
read and pop number of bytes for buffer read and pop number of bytes for buffer
""" """
if size > len(self.data): if size > len(self.data):
raise Exception("No enough data left in buffer, request for {}, we have {}".format(size, self)) raise Exception("Not enough data left in buffer, request for {}, we have {}".format(size, self))
#self.logger.debug("Request for %s bytes, from %s", size, self) #self.logger.debug("Request for %s bytes, from %s", size, self)
data = self.data[:size] data = self.data[:size]
self.data = self.data[size:] self.data = self.data[size:]
...@@ -57,7 +57,7 @@ class Buffer(object): ...@@ -57,7 +57,7 @@ class Buffer(object):
read 'size' bytes from buffer, without removing them from buffer read 'size' bytes from buffer, without removing them from buffer
""" """
if size > len(self.data): if size > len(self.data):
raise Exception("No enough data left in buffer, request for {}, we have {}".format(size, self)) raise Exception("Not enough data left in buffer, request for {}, we have {}".format(size, self))
return self.data[:size] return self.data[:size]
class SocketClosedException(Exception): class SocketClosedException(Exception):
......
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 to comment