Changeset 1749
- Timestamp:
- 09/27/04 22:09:30 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/accounters/hardware.py
r1748 r1749 22 22 # 23 23 # $Log$ 24 # Revision 1.28 2004/09/27 20:09:30 jalet 25 # Lowered timeout delay for PJL queries 26 # 24 27 # Revision 1.27 2004/09/27 20:00:35 jalet 25 28 # Typo … … 125 128 from pykota.accounter import AccounterBase, PyKotaAccounterError 126 129 130 ITERATIONDELAY = 2.0 # 2 Seconds 131 STABILIZATIONDELAY = 3 # We must read three times the same value to consider it to be stable 132 127 133 try : 128 134 from pysnmp.mapping.udp.error import SnmpOverUdpError … … 133 139 else : 134 140 hasSNMP = 1 135 SNMPDELAY = 2.0 # 2 Seconds136 STABILIZATIONDELAY = 3 # We must read three times the same value to consider it to be stable137 141 pageCounterOID = ".1.3.6.1.2.1.43.10.2.1.4.1.1" 138 142 hrPrinterStatusOID = ".1.3.6.1.2.1.25.3.5.1.1.1" … … 196 200 # In reality, and if I'm not mistaken, we will NEVER get there. 197 201 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) 199 203 200 204 def waitIdle(self) : … … 215 219 idle_num = 0 216 220 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) 218 222 219 223 pjlMessage = "\033%-12345X@PJL USTATUSOFF\r\n@PJL USTATUS DEVICE=ON\r\n@PJL INFO STATUS\r\n@PJL INFO PAGECOUNT\r\n\033%-12345X" … … 259 263 while (self.timedout == 0) or (actualpagecount is None) or (self.printerStatus is None) : 260 264 signal.signal(signal.SIGALRM, self.alarmHandler) 261 signal.alarm( 5)265 signal.alarm(3) 262 266 try : 263 267 answer = sock.recv(1024)