Changeset 3027

Show
Ignore:
Timestamp:
10/05/06 11:41:05 (18 years ago)
Author:
jerome
Message:

Improved the detection of a stable idle status in snmp accounting
stuff, because "lp *.pdf" would make only the first job to be
accounted correctly. PJL stuff needs some work.

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

Legend:

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

    r3025 r3027  
    3333ITERATIONDELAY = 1   # 1 Second 
    3434STABILIZATIONDELAY = 3 # We must read three times the same value to consider it to be stable 
    35 NOPRINTINGMAXDELAY = 60 # The printer must begin to print within 60 seconds. 
     35NOPRINTINGMAXDELAY = 60 # The printer must begin to print within 60 seconds byb default. 
    3636 
    3737# Here's the real thing : 
  • pykota/trunk/pykota/accounters/snmp.py

    r3025 r3027  
    2929""" 
    3030 
    31 ITERATIONDELAY = 1.5   # 1.5 Second 
    32 STABILIZATIONDELAY = 3 # We must read three times the same value to consider it to be stable 
    33 NOPRINTINGMAXDELAY = 60 # The printer must begin to print within 60 seconds. 
     31ITERATIONDELAY = 4      # time to sleep between two loops 
     32STABILIZATIONDELAY = 5  # number of consecutive times the idle status must be seen before we consider it to be stable 
     33NOPRINTINGMAXDELAY = 60 # The printer must begin to print within 60 seconds by default. 
    3434 
    3535import sys 
     
    257257                                                                        varBinds[int(errorIndex)-1]), \ 
    258258                                             "error") 
     259                self.initValues() 
    259260            else :                                  
    260261                self.printerInternalPageCounter = max(self.printerInternalPageCounter, int(varBinds[0][1].prettyPrint())) 
     
    290291            except (SnmpOverUdpError, select.error), msg :     
    291292                self.parent.filter.printInfo(_("Network error while doing SNMP queries on printer %s : %s") % (self.printerHostname, msg), "warn") 
     293                self.initValues() 
    292294            tsp.close() 
    293295         
     
    300302            except TypeMismatchError, msg :     
    301303                self.parent.filter.printInfo(_("SNMP message decoding error for printer %s : %s") % (self.printerHostname, msg), "warn") 
     304                self.initValues() 
    302305            else : 
    303306                if req.apiAlphaMatch(rsp):