Changeset 2183 for pykota

Show
Ignore:
Timestamp:
03/24/05 11:13:30 (20 years ago)
Author:
jerome
Message:

Reported the SNMP warmup fix into PJL handling code as well.

Files:
1 modified

Legend:

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

    r2182 r2183  
    224224    def waitPrinting(self) : 
    225225        """Waits for printer status being 'printing'.""" 
     226        firstvalue = None 
    226227        while 1: 
    227228            self.retrievePJLValues() 
    228             if self.printerStatus in ('10023',) : 
     229            if self.printerStatus in ('10023', '10003') : 
    229230                break 
     231            if self.printerInternalPageCounter is not None :     
     232                if firstvalue is None : 
     233                    # first time we retrieved a page counter, save it 
     234                    firstvalue = self.printerInternalPageCounter 
     235                else :      
     236                    # second time (or later) 
     237                    if firstvalue < self.printerInternalPageCounter : 
     238                        # Here we have a printer which lies : 
     239                        # it says it is not printing or warming up 
     240                        # BUT the page counter increases !!! 
     241                        # So we can probably quit being sure it is printing. 
     242                        self.parent.filter.printInfo("Printer %s is lying to us !!!" % self.parent.filter.printername, "warn") 
     243                        break 
    230244            self.parent.filter.logdebug(_("Waiting for printer %s to be printing...") % self.parent.filter.printername) 
    231245            time.sleep(ITERATIONDELAY)