- Timestamp:
- 06/03/05 10:49:34 (19 years ago)
- Location:
- pykota/trunk
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/NEWS
r2276 r2277 22 22 PyKota NEWS : 23 23 24 - 1.23alpha7 : 25 26 - Improvements to the internal PJL and SNMP accounter : now should 27 support more printers and waste less time. 28 24 29 - 1.23alpha6 : 25 30 -
pykota/trunk/pykota/accounters/pjl.py
r2205 r2277 29 29 import signal 30 30 31 ITERATIONDELAY = 1.0 # 1 Second 31 # NB : in fact these variables don't do much, since the time 32 # is in fact wasted in the sock.recv() blocking call, with the timeout 33 ITERATIONDELAY = 1 # 1 Second 32 34 STABILIZATIONDELAY = 3 # We must read three times the same value to consider it to be stable 33 35 34 pjlMessage = "\033%-12345X@PJL USTATUSOFF\r\n@PJL INFO STATUS\r\n@PJL INFO PAGECOUNT\r\n\033%-12345X" 36 # Here's the real thing : 37 TIMEOUT = 3 38 39 # Old method : pjlMessage = "\033%-12345X@PJL USTATUSOFF\r\n@PJL INFO STATUS\r\n@PJL INFO PAGECOUNT\r\n\033%-12345X" 40 # Here's a new method, which seems to work fine on my HP2300N, while the 41 # previous one didn't. 42 # TODO : We could also experiment with USTATUS JOB=ON and we would know for sure 43 # when the job is finished, without having to poll the printer repeatedly. 44 pjlMessage = "\033%-12345X@PJL USTATUS DEVICE=ON\r\n@PJL INFO STATUS\r\n@PJL INFO PAGECOUNT\r\n@PJL USTATUS DEVICE=OFF\033%-12345X" 35 45 pjlStatusValues = { 36 46 "10000" : "Powersave Mode", … … 76 86 while (self.timedout == 0) or (actualpagecount is None) or (self.printerStatus is None) : 77 87 signal.signal(signal.SIGALRM, self.alarmHandler) 78 signal.alarm( 3)88 signal.alarm(TIMEOUT) 79 89 try : 80 90 answer = sock.recv(1024) … … 83 93 else : 84 94 readnext = 0 95 self.parent.filter.logdebug("PJL answer : %s" % repr(answer)) 85 96 for line in [l.strip() for l in answer.split()] : 86 97 if line.startswith("CODE=") : … … 128 139 if idle_flag : 129 140 idle_num += 1 130 if idle_num > STABILIZATIONDELAY :141 if idle_num >= STABILIZATIONDELAY : 131 142 # printer status is stable, we can exit 132 143 break -
pykota/trunk/pykota/accounters/snmp.py
r2205 r2277 23 23 # 24 24 25 ITERATIONDELAY = 1. 0 # 1Second25 ITERATIONDELAY = 1.5 # 1.5 Second 26 26 STABILIZATIONDELAY = 3 # We must read three times the same value to consider it to be stable 27 27 … … 159 159 if idle_flag : 160 160 idle_num += 1 161 if idle_num > STABILIZATIONDELAY :161 if idle_num >= STABILIZATIONDELAY : 162 162 # printer status is stable, we can exit 163 163 break -
pykota/trunk/pykota/version.py
r2276 r2277 22 22 # 23 23 24 __version__ = "1.23alpha 6_unofficial"24 __version__ = "1.23alpha7_unofficial" 25 25 26 26 __doc__ = "PyKota : a complete Printing Quota Solution for CUPS and LPRng."