Changeset 3163 for pykota/trunk

Show
Ignore:
Timestamp:
04/15/07 17:18:31 (18 years ago)
Author:
jerome
Message:

If skipinitialwait is set to 'yes' in pykota.conf, don't take it into
account unless the printer really is in 'idle' state. This doesn't cost
anything since we've already retrieved the page counter and idle status
a single time before the test, but will now correctly loop until the printer
is idle if it is not already for some strange reason (no paper, and
so on).

Location:
pykota/trunk/pykota/accounters
Files:
2 modified

Legend:

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

    r3162 r3163  
    179179    def waitIdle(self) : 
    180180        """Waits for printer status being 'idle'.""" 
    181         idle_num = idle_flag = 0 
     181        idle_num = 0 
    182182        while 1 : 
    183183            self.retrievePJLValues() 
    184             if (self.printerInternalPageCounter is not None) \ 
    185                and self.skipinitialwait \ 
    186                and (os.environ.get("PYKOTAPHASE") == "BEFORE") : 
    187                 self.parent.filter.logdebug("No need to wait for the printer to be idle, this should be the case already.") 
    188                 return  
    189             idle_flag = 0 
    190184            if self.printerStatus in ('10000', '10001', '35078', '40000') : 
    191                 idle_flag = 1 
    192             if idle_flag :     
     185                if (self.printerInternalPageCounter is not None) \ 
     186                   and self.skipinitialwait \ 
     187                   and (os.environ.get("PYKOTAPHASE") == "BEFORE") : 
     188                    self.parent.filter.logdebug("No need to wait for the printer to be idle, it is the case already.") 
     189                    return  
    193190                idle_num += 1 
    194191                if idle_num >= STABILIZATIONDELAY : 
  • pykota/trunk/pykota/accounters/snmp.py

    r3162 r3163  
    211211        while 1 : 
    212212            self.retrieveSNMPValues() 
    213             if (self.printerInternalPageCounter is not None) \ 
    214                and self.skipinitialwait \ 
    215                and (os.environ.get("PYKOTAPHASE") == "BEFORE") : 
    216                 self.parent.filter.logdebug("No need to wait for the printer to be idle, this should be the case already.") 
    217                 return  
    218213            pstatusAsString = printerStatusValues.get(self.printerStatus) 
    219214            dstatusAsString = deviceStatusValues.get(self.deviceStatus) 
     
    225220                idle_flag = 1       # Standby / Powersave is considered idle 
    226221            if idle_flag :     
     222                if (self.printerInternalPageCounter is not None) \ 
     223                   and self.skipinitialwait \ 
     224                   and (os.environ.get("PYKOTAPHASE") == "BEFORE") : 
     225                    self.parent.filter.logdebug("No need to wait for the printer to be idle, it is the case already.") 
     226                    return  
    227227                idle_num += 1 
    228228                if idle_num >= STABILIZATIONDELAY :