comparison rsib.py @ 56:91b476ebc0f2

Run through 2to3
author Daniel O'Connor <doconnor@gsoft.com.au>
date Tue, 08 Dec 2020 14:00:45 +1030
parents 226ea06bc050
children 00800345fbae
comparison
equal deleted inserted replaced
55:ad5942d22f78 56:91b476ebc0f2
140 #print "Msg ID 0x%02x" % (ord(rx[4])) 140 #print "Msg ID 0x%02x" % (ord(rx[4]))
141 if False and ord(rx[4]) != MSG_CMDREP: 141 if False and ord(rx[4]) != MSG_CMDREP:
142 raise exceptions.IOError("Unexpected Msg ID 0x%02x" % (ord(rx[4]))) 142 raise exceptions.IOError("Unexpected Msg ID 0x%02x" % (ord(rx[4])))
143 143
144 if ord(rx[5]) != 0: 144 if ord(rx[5]) != 0:
145 print "Mystery byte %d != 0" % (ord(rx[5])) 145 print("Mystery byte %d != 0" % (ord(rx[5])))
146 # Fetch the actual reply now we know the length 146 # Fetch the actual reply now we know the length
147 reply = '' 147 reply = ''
148 while len(reply) < rxlen: 148 while len(reply) < rxlen:
149 rx = self.s1.recv(rxlen) 149 rx = self.s1.recv(rxlen)
150 if rx == '': 150 if rx == '':
188 if rx == '\x00\x00\x00\x00\x80\x14\x08': 188 if rx == '\x00\x00\x00\x00\x80\x14\x08':
189 return False 189 return False
190 elif rx == '\x00\x00\x00\x00\xa0\x64\x07': 190 elif rx == '\x00\x00\x00\x00\xa0\x64\x07':
191 return True 191 return True
192 else: 192 else:
193 raise exceptions.IOError("Unknown SRQ byte sequence - " + str(map(ord, rx))) 193 raise exceptions.IOError("Unknown SRQ byte sequence - " + str(list(map(ord, rx))))