Changeset 3180 for pykota/trunk/pykota/constants.py
- Timestamp:
- 05/29/07 23:03:12 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/constants.py
r3175 r3180 24 24 """This module contains the definitions of constants used by PyKota.""" 25 25 26 ITERATIONDELAY = 4# time to sleep between two loops27 STA BILIZATIONDELAY = 5 # number of consecutive times the idlestatus must be seen before we consider it to be stable26 STATUSSTABILIZATIONDELAY = 4.0 # time to sleep between two loops 27 STATUSSTABILIZATIONLOOPS = 5 # number of consecutive times the 'idle' status must be seen before we consider it to be stable 28 28 NOPRINTINGMAXDELAY = 60 # The printer must begin to print within 60 seconds by default. 29 30 def get(application, varname) : 31 """Retrieves the value of a particular printer variable from configuration file, else a constant defined here.""" 32 pname = application.PrinterName 33 try : 34 value = getattr(application.config, "get%(varname)s" % locals())(pname) 35 if value is None : 36 raise TypeError # Use hardcoded value 37 except (TypeError, AttributeError) : # NB : AttributeError in testing mode because I'm lazy ! 38 value = globals().get(varname.upper()) 39 application.logdebug("No value defined for %(varname)s for printer %(pname)s, using %(value)s." % locals()) 40 return value