Changeset 3175 for pykota/trunk/pykota/accounters/snmp.py
- Timestamp:
- 05/28/07 18:47:32 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/accounters/snmp.py
r3163 r3175 29 29 """ 30 30 31 ITERATIONDELAY = 4 # time to sleep between two loops32 STABILIZATIONDELAY = 5 # number of consecutive times the idle status must be seen before we consider it to be stable33 NOPRINTINGMAXDELAY = 60 # The printer must begin to print within 60 seconds by default.34 31 35 32 import sys … … 52 49 else : 53 50 hasV4 = True 51 52 from pykota import constants 54 53 55 54 # … … 158 157 noprintingmaxdelay = int(self.parent.filter.config.getNoPrintingMaxDelay(self.parent.filter.PrinterName)) 159 158 except (TypeError, AttributeError) : # NB : AttributeError in testing mode because I'm lazy ! 160 noprintingmaxdelay = NOPRINTINGMAXDELAY159 noprintingmaxdelay = constants.NOPRINTINGMAXDELAY 161 160 self.parent.filter.logdebug("No max delay defined for printer %s, using %i seconds." % (self.parent.filter.PrinterName, noprintingmaxdelay)) 162 161 if not noprintingmaxdelay : … … 204 203 break 205 204 self.parent.filter.logdebug(_("Waiting for printer %s to be printing...") % self.parent.filter.PrinterName) 206 time.sleep( ITERATIONDELAY)205 time.sleep(constants.ITERATIONDELAY) 207 206 208 207 def waitIdle(self) : … … 226 225 return 227 226 idle_num += 1 228 if idle_num >= STABILIZATIONDELAY :227 if idle_num >= constants.STABILIZATIONDELAY : 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( ITERATIONDELAY)233 time.sleep(constants.ITERATIONDELAY) 235 234 236 235 def retrieveInternalPageCounter(self) :