Fixed connection
@@ -152,15 +152,13 @@ class Connection(object):
:param newline_seq: Sequence of chars to send as new line char(s)
:return: Nothing
"""
- stro = ""
- strn = ""
- for l in self.newline:
- o = ord(l)
- stro = "{}'{}'".format(stro, o)
- for l in newline_seq:
- o = ord(l)
- strn = "{}'{}'".format(strn, o)
- self._log(logging.DEBUG, "changing newline seq old '{}' -> new '{}'".format(stro, strn))
+
+ characters = [ord(char) for char in self.newline]
+ newline_old = "0x" + ''.join("'{:02X}'".format(a) for a in characters)
+ characters = [ord(char) for char in newline_seq]
+ newline_new = "0x" + ''.join("'{:02X}'".format(a) for a in characters)
+ # 11 15:30:32.855 DEBUG moler.connection.UnixRemote1 |changing newline seq old '0x'0D''0A'' -> new '0x'0A''
+ self._log(logging.DEBUG, "changing newline seq old '{}' -> new '{}'".format(newline_old, newline_new))
self.newline = newline_seq
def sendline(self, data, timeout=30, encrypt=False):
