Changeset 2353
- Timestamp:
- 07/11/05 14:54:07 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/accounters/pjl.py
r2302 r2353 77 77 self.parent.filter.printInfo(_("Problem during connection to %s:%s : %s") % (self.printerHostname, port, msg), "warn") 78 78 else : 79 self.parent.filter.logdebug("Connected to printer %s" % self.printerHostname) 79 80 try : 80 81 sock.send(pjlMessage) … … 82 83 self.parent.filter.printInfo(_("Problem while sending PJL query to %s:%s : %s") % (self.printerHostname, port, msg), "warn") 83 84 else : 85 self.parent.filter.logdebug("Query sent to %s : %s" % (self.printerHostname, repr(pjlMessage))) 84 86 actualpagecount = self.printerStatus = None 85 87 self.timedout = 0 … … 90 92 answer = sock.recv(1024) 91 93 except IOError, msg : 94 self.parent.filter.logdebug("I/O Error [%s] : alarm handler probably called" % msg) 92 95 break # our alarm handler was launched, probably 93 96 else : … … 97 100 if line.startswith("CODE=") : 98 101 self.printerStatus = line.split("=")[1] 102 self.parent.filter.logdebug("Found status : %s" % self.printerStatus) 99 103 elif line.startswith("PAGECOUNT") : 100 104 readnext = 1 # page counter is on next line 101 105 elif readnext : 102 106 actualpagecount = int(line.strip()) 107 self.parent.filter.logdebug("Found pages counter : %s" % actualpagecount) 103 108 readnext = 0 104 109 signal.alarm(0) 105 110 self.printerInternalPageCounter = max(actualpagecount, self.printerInternalPageCounter) 106 111 sock.close() 112 self.parent.filter.logdebug("Connection to %s is now closed." % self.printerHostname) 107 113 108 114 def waitPrinting(self) :