Changeset 3194 for pykota/trunk
- Timestamp:
- 06/27/07 18:16:02 (17 years ago)
- Location:
- pykota/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pksetup
r3185 r3194 197 197 198 198 otherpackages = [ { "name" : "pkpgcounter", 199 "version" : "2.1 6",199 "version" : "2.17", 200 200 "url" : "http://www.pykota.com/software/%(name)s/download/tarballs/%(name)s-%(version)s.tar.gz", 201 201 "commands" : [ "tar -zxf %(name)s-%(version)s.tar.gz", … … 213 213 }, 214 214 { "name" : "ghostpcl", 215 "version" : "1.41 ",215 "version" : "1.41p1", 216 216 "url" : "ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/GhostPCL/%(name)s_%(version)s.tar.bz2", 217 217 "commands" : [ "bunzip2 <%(name)s_%(version)s.tar.bz2 | tar -xf -", -
pykota/trunk/pykota/accounters/pjl.py
r3193 r3194 78 78 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 79 79 try : 80 sock.settimeout(2.0) 80 81 sock.connect((self.printerHostname, self.port)) 81 82 except socket.error, msg : … … 83 84 return False 84 85 else : 85 sock.setblocking(False)86 86 self.sock = sock 87 87 self.closed = False … … 90 90 self.readthread = threading.Thread(target=self.readloop) 91 91 self.readthread.start() 92 time.sleep(1) 92 93 self.parent.filter.logdebug("Connected to printer %s:%s" % (self.printerHostname, self.port)) 93 94 return True … … 113 114 while not self.quitEvent.isSet() : 114 115 try : 115 answer = self.sock.recv(4096) 116 answer = self.sock.recv(1) 117 except socket.timeout : 118 self.parent.filter.logdebug("Timed out when reading answer from %s:%s" \ 119 % (self.printerHostname, self.port)) 116 120 except socket.error, (err, msg) : 117 time.sleep(0.1) # We will try again later in all cases 118 if err != errno.EAGAIN : 119 self.parent.filter.printInfo(_("Problem while receiving PJL answer from %s:%s : %s") % (self.printerHostname, self.port, str(msg)), "warn") 121 self.parent.filter.printInfo(_("Problem while receiving PJL answer from %s:%s : %s") % (self.printerHostname, self.port, str(msg)), "warn") 120 122 else : 121 123 if answer : … … 131 133 """Retrieves a printer's internal page counter and status via PJL.""" 132 134 try : 133 self.sock.sendall(pjlMessage) 135 nbsent = self.sock.send(pjlMessage) 136 if nbsent != len(pjlMessage) : 137 raise socket.error, "Short write" 134 138 except socket.error, msg : 135 139 self.parent.filter.printInfo(_("Problem while sending PJL query to %s:%s : %s") % (self.printerHostname, self.port, str(msg)), "warn")