Changeset 1218
- Timestamp:
- 11/25/03 23:37:22 (21 years ago)
- Location:
- pykota/trunk/pykota
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/logger.py
r1144 r1218 22 22 # 23 23 # $Log$ 24 # Revision 1.10 2003/11/25 22:37:22 jalet 25 # Small code move 26 # 24 27 # Revision 1.9 2003/10/07 09:07:28 jalet 25 28 # Character encoding added to please latest version of Python … … 66 69 __str__ = __repr__ 67 70 68 def openLogger(pykotatool ) :71 def openLogger(pykotatool, backend) : 69 72 """Returns the appropriate logger subsystem object.""" 70 backend = pykotatool.config.getLoggingBackend()71 73 try : 72 if not backend.isalpha() :73 # don't trust user input74 raise ImportError75 74 exec "from pykota.loggers import %s as loggingbackend" % backend.lower() 76 75 except ImportError : -
pykota/trunk/pykota/tool.py
r1217 r1218 22 22 # 23 23 # $Log$ 24 # Revision 1.62 2003/11/25 22:37:22 jalet 25 # Small code move 26 # 24 27 # Revision 1.61 2003/11/25 22:03:28 jalet 25 28 # No more message on stderr when the translation is not available. … … 251 254 from mx import DateTime 252 255 253 from pykota import version, config, storage, logger 254 from pykota.accounter import openAccounter 256 from pykota import version, config, storage, logger, accounter 255 257 256 258 class PyKotaToolError(Exception): … … 278 280 self.documentation = doc 279 281 self.config = config.PyKotaConfig("/etc/pykota") 280 self.logger = logger.openLogger(self )282 self.logger = logger.openLogger(self, self.config.getLoggingBackend()) 281 283 self.debug = self.config.getDebug() 282 284 self.storage = storage.openConnection(self) … … 639 641 self.username = self.username or 'root' 640 642 self.preserveinputfile = self.inputfile 641 self.accounter = openAccounter(self)643 self.accounter = accounter.openAccounter(self) 642 644 643 645 def extractInfoFromCupsOrLprng(self) :