Changeset 2615 for pykota/trunk/pykota/accounters/pjl.py
- Timestamp:
- 01/13/06 21:33:33 (18 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/accounters/pjl.py
r2584 r2615 33 33 ITERATIONDELAY = 1 # 1 Second 34 34 STABILIZATIONDELAY = 3 # We must read three times the same value to consider it to be stable 35 NOPRINTINGMAXDELAY = 30 # The printer must begin to print within 30 seconds. 35 36 36 37 # Here's the real thing : … … 130 131 def waitPrinting(self) : 131 132 """Waits for printer status being 'printing'.""" 133 previousValue = self.parent.getLastPageCounter() 134 timebefore = time.time() 132 135 firstvalue = None 133 136 while 1: … … 147 150 # So we can probably quit being sure it is printing. 148 151 self.parent.filter.printInfo("Printer %s is lying to us !!!" % self.parent.filter.PrinterName, "warn") 152 break 153 elif (time.time() - timebefore) > NOPRINTINGMAXDELAY : 154 # More than X seconds without the printer being in 'printing' mode 155 # We can safely assume this won't change 156 if self.printerInternalPageCounter == previousValue : 157 # Here the job won't be printed, because probably 158 # the printer rejected it for some reason. 159 self.parent.filter.printInfo("Printer %s probably won't print this job !!!" % self.parent.filter.PrinterName, "warn") 160 else : 161 # Here the job has already been entirely printed, and 162 # the printer has already passed from 'idle' to 'printing' to 'idle' again. 163 self.parent.filter.printInfo("Printer %s has probably already printed this job !!!" % self.parent.filter.PrinterName, "warn") 149 164 break 150 165 self.parent.filter.logdebug(_("Waiting for printer %s to be printing...") % self.parent.filter.PrinterName) … … 204 219 self.filter = fakeFilter() 205 220 self.protocolHandler = Handler(self, sys.argv[1]) 221 222 def getLastPageCounter(self) : 223 return 0 206 224 207 225 acc = fakeAccounter()