Changeset 1749

Show
Ignore:
Timestamp:
09/27/04 22:09:30 (20 years ago)
Author:
jalet
Message:

Lowered timeout delay for PJL queries

Files:
1 modified

Legend:

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

    r1748 r1749  
    2222# 
    2323# $Log$ 
     24# Revision 1.28  2004/09/27 20:09:30  jalet 
     25# Lowered timeout delay for PJL queries 
     26# 
    2427# Revision 1.27  2004/09/27 20:00:35  jalet 
    2528# Typo 
     
    125128from pykota.accounter import AccounterBase, PyKotaAccounterError 
    126129 
     130ITERATIONDELAY = 2.0   # 2 Seconds 
     131STABILIZATIONDELAY = 3 # We must read three times the same value to consider it to be stable 
     132 
    127133try : 
    128134    from pysnmp.mapping.udp.error import SnmpOverUdpError 
     
    133139else :     
    134140    hasSNMP = 1 
    135     SNMPDELAY = 2.0             # 2 Seconds 
    136     STABILIZATIONDELAY = 3      # We must read three times the same value to consider it to be stable 
    137141    pageCounterOID = ".1.3.6.1.2.1.43.10.2.1.4.1.1" 
    138142    hrPrinterStatusOID = ".1.3.6.1.2.1.25.3.5.1.1.1" 
     
    196200                # In reality, and if I'm not mistaken, we will NEVER get there.     
    197201                self.parent.filter.logdebug(_("Waiting for printer %s to be idle or printing...") % self.parent.filter.printername)     
    198                 time.sleep(SNMPDELAY) 
     202                time.sleep(ITERATIONDELAY) 
    199203             
    200204        def waitIdle(self) : 
     
    215219                    idle_num = 0 
    216220                self.parent.filter.logdebug(_("Waiting for printer %s's idle status to stabilize...") % self.parent.filter.printername)     
    217                 time.sleep(SNMPDELAY) 
     221                time.sleep(ITERATIONDELAY) 
    218222                 
    219223pjlMessage = "\033%-12345X@PJL USTATUSOFF\r\n@PJL USTATUS DEVICE=ON\r\n@PJL INFO STATUS\r\n@PJL INFO PAGECOUNT\r\n\033%-12345X" 
     
    259263                while (self.timedout == 0) or (actualpagecount is None) or (self.printerStatus is None) : 
    260264                    signal.signal(signal.SIGALRM, self.alarmHandler) 
    261                     signal.alarm(5) 
     265                    signal.alarm(3) 
    262266                    try : 
    263267                        answer = sock.recv(1024)