if ord(cmd) == LATCP_CMD_ERRORMSG:
raise LATClientException(msg)
- r = select([self.sock], [], [], 2.0)[0]
+ self.rfh = self.sock.makefile('r')
+ self.wfh = self.sock.makefile('w')
+
+ r = select([self.rfh], [], [], 2.0)[0]
if r:
- l = self.sock.readline()
+ l = self.rfh.readline()
if l.find('Service in use') >= 0:
print "Service in use, apparently: restarting DEC server"
self.reboot_server()
mop.write(self.priv_password+'\n')
mop.write('init del 0\n')
mop.close()
+ print
print "Waiting 10 seconds for DEC server to come back to life..."
sleep(10)
+ print "Rightyo, back to vending!"
+ print
def read_reply(self):
head = self.sock.recv(3)
return (cmd, msg)
def get_fh(self):
- return (self.sock.makefile('r'), self.sock.makefile('w'))
+ return (self.rfh, self.wfh)