Changeset 3180 for pykota/trunk/pykota/accounters
- Timestamp:
- 05/29/07 23:03:12 (17 years ago)
- Location:
- pykota/trunk/pykota/accounters
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/accounters/pjl.py
r3177 r3180 169 169 def waitPrinting(self) : 170 170 """Waits for printer status being 'printing'.""" 171 try : 172 noprintingmaxdelay = int(self.parent.filter.config.getNoPrintingMaxDelay(self.parent.filter.PrinterName)) 173 except (TypeError, AttributeError) : # NB : AttributeError in testing mode because I'm lazy ! 174 noprintingmaxdelay = constants.NOPRINTINGMAXDELAY 175 self.parent.filter.logdebug("No max delay defined for printer %s, using %i seconds." % (self.parent.filter.PrinterName, noprintingmaxdelay)) 171 statusstabilizationdelay = constants.get(self.parent.filter, "StatusStabilizationDelay") 172 noprintingmaxdelay = constants.get(self.parent.filter, "NoPrintingMaxDelay") 176 173 if not noprintingmaxdelay : 177 174 self.parent.filter.logdebug("Will wait indefinitely until printer %s is in 'printing' state." % self.parent.filter.PrinterName) … … 212 209 break 213 210 self.parent.filter.logdebug(_("Waiting for printer %s to be printing...") % self.parent.filter.PrinterName) 214 time.sleep( constants.ITERATIONDELAY)211 time.sleep(statusstabilizationdelay) 215 212 216 213 def waitIdle(self) : 217 214 """Waits for printer status being 'idle'.""" 215 statusstabilizationdelay = constants.get(self.parent.filter, "StatusStabilizationDelay") 216 statusstabilizationloops = constants.get(self.parent.filter, "StatusStabilizationLoops") 218 217 idle_num = 0 219 218 while True : … … 226 225 return 227 226 idle_num += 1 228 if idle_num >= constants.STABILIZATIONDELAY:227 if idle_num >= statusstabilizationloops : 229 228 # printer status is stable, we can exit 230 229 break … … 232 231 idle_num = 0 233 232 self.parent.filter.logdebug(_("Waiting for printer %s's idle status to stabilize...") % self.parent.filter.PrinterName) 234 time.sleep( constants.ITERATIONDELAY)233 time.sleep(statusstabilizationdelay) 235 234 236 235 def retrieveInternalPageCounter(self) : -
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) :