Changeset 2619

Show
Ignore:
Timestamp:
01/13/06 21:53:44 (19 years ago)
Author:
jerome
Message:

Just like for SNMP, we don't want to exit too early
if printer is not idle.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/accounters/pjl.py

    r2615 r2619  
    153153                    elif (time.time() - timebefore) > NOPRINTINGMAXDELAY : 
    154154                        # 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") 
    164                         break 
     155                        # We can safely assume this won't change if printer is now 'idle' 
     156                        if self.printerStatus in ('10000', '10001', '35078', '40000') : 
     157                            if self.printerInternalPageCounter == previousValue : 
     158                                # Here the job won't be printed, because probably 
     159                                # the printer rejected it for some reason. 
     160                                self.parent.filter.printInfo("Printer %s probably won't print this job !!!" % self.parent.filter.PrinterName, "warn") 
     161                            else :      
     162                                # Here the job has already been entirely printed, and 
     163                                # the printer has already passed from 'idle' to 'printing' to 'idle' again. 
     164                                self.parent.filter.printInfo("Printer %s has probably already printed this job !!!" % self.parent.filter.PrinterName, "warn") 
     165                            break 
    165166            self.parent.filter.logdebug(_("Waiting for printer %s to be printing...") % self.parent.filter.PrinterName) 
    166167            time.sleep(ITERATIONDELAY) 
     
    186187    def retrieveInternalPageCounter(self) : 
    187188        """Returns the page counter from the printer via internal PJL handling.""" 
     189        self.waitPrinting() 
    188190        try : 
    189191            if (os.environ.get("PYKOTASTATUS") != "CANCELLED") and \