Changeset 3548

Show
Ignore:
Timestamp:
08/17/10 23:11:00 (14 years ago)
Author:
jerome
Message:

During SNMP accounting, I forgot to decrease the waiting delay at the
time the printer went back to a normal status, when it
was increased because the printer was down.

Files:
1 modified

Legend:

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

    r3546 r3548  
    157157        """Waits for printer status being 'printing'.""" 
    158158        statusstabilizationdelay = constants.get(self.parent.filter, "StatusStabilizationDelay") 
    159         increment = 1 
    160159        noprintingmaxdelay = constants.get(self.parent.filter, "NoPrintingMaxDelay") 
    161160        if not noprintingmaxdelay : 
     
    165164        previousValue = self.parent.getLastPageCounter() 
    166165        firstvalue = None 
     166        increment = 1 
     167        waitdelay = statusstabilizationdelay * increment 
    167168        while True : 
    168169            self.retrieveSNMPValues() 
    169             waitdelay = statusstabilizationdelay * increment 
    170170            error = self.checkIfError(self.printerDetectedErrorState) 
    171171            pstatusAsString = printerStatusValues.get(self.printerStatus) 
     
    206206                        if waitdelay < constants.FIVEMINUTES : 
    207207                            increment *= 2 
    208             self.parent.filter.logdebug("Waiting %s seconds for printer %s to be printing..." % (waitdelay, self.parent.filter.PrinterName)) 
     208                    else : 
     209                        increment = 1 
     210            self.parent.filter.logdebug("Waiting %s seconds for printer %s to be printing..." % (waitdelay, 
     211                                                                                                 self.parent.filter.PrinterName)) 
    209212            time.sleep(waitdelay) 
     213            waitdelay = statusstabilizationdelay * increment 
    210214 
    211215    def waitIdle(self) : 
     
    214218        statusstabilizationloops = constants.get(self.parent.filter, "StatusStabilizationLoops") 
    215219        increment = 1 
     220        waitdelay = statusstabilizationdelay * increment 
    216221        idle_num = 0 
    217222        while True : 
    218223            self.retrieveSNMPValues() 
    219             waitdelay = statusstabilizationdelay * increment 
    220224            error = self.checkIfError(self.printerDetectedErrorState) 
    221225            pstatusAsString = printerStatusValues.get(self.printerStatus) 
     
    242246                if waitdelay < constants.FIVEMINUTES : 
    243247                    increment *= 2 
     248            else : 
     249                increment = 1 
    244250            self.parent.filter.logdebug("Waiting %s seconds for printer %s's idle status to stabilize..." % (waitdelay, 
    245251                                                                                                             self.parent.filter.PrinterName)) 
    246252            time.sleep(waitdelay) 
     253            waitdelay = statusstabilizationdelay * increment 
    247254 
    248255    def retrieveInternalPageCounter(self) :