Changeset 3180 for pykota/trunk/pykota/accounters/snmp.py
- Timestamp:
- 05/29/07 23:03:12 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/accounters/snmp.py
r3175 r3180 154 154 def waitPrinting(self) : 155 155 """Waits for printer status being 'printing'.""" 156 try : 157 noprintingmaxdelay = int(self.parent.filter.config.getNoPrintingMaxDelay(self.parent.filter.PrinterName)) 158 except (TypeError, AttributeError) : # NB : AttributeError in testing mode because I'm lazy ! 159 noprintingmaxdelay = constants.NOPRINTINGMAXDELAY 160 self.parent.filter.logdebug("No max delay defined for printer %s, using %i seconds." % (self.parent.filter.PrinterName, noprintingmaxdelay)) 156 statusstabilizationdelay = constants.get(self.parent.filter, "StatusStabilizationDelay") 157 noprintingmaxdelay = constants.get(self.parent.filter, "NoPrintingMaxDelay") 161 158 if not noprintingmaxdelay : 162 159 self.parent.filter.logdebug("Will wait indefinitely until printer %s is in 'printing' state." % self.parent.filter.PrinterName) … … 203 200 break 204 201 self.parent.filter.logdebug(_("Waiting for printer %s to be printing...") % self.parent.filter.PrinterName) 205 time.sleep( constants.ITERATIONDELAY)202 time.sleep(statusstabilizationdelay) 206 203 207 204 def waitIdle(self) : 208 205 """Waits for printer status being 'idle'.""" 206 statusstabilizationdelay = constants.get(self.parent.filter, "StatusStabilizationDelay") 207 statusstabilizationloops = constants.get(self.parent.filter, "StatusStabilizationLoops") 209 208 idle_num = idle_flag = 0 210 209 while 1 : … … 225 224 return 226 225 idle_num += 1 227 if idle_num >= constants.STABILIZATIONDELAY:226 if idle_num >= statusstabilizationloops : 228 227 # printer status is stable, we can exit 229 228 break … … 231 230 idle_num = 0 232 231 self.parent.filter.logdebug(_("Waiting for printer %s's idle status to stabilize...") % self.parent.filter.PrinterName) 233 time.sleep( constants.ITERATIONDELAY)232 time.sleep(statusstabilizationdelay) 234 233 235 234 def retrieveInternalPageCounter(self) :