Changeset 1218

Show
Ignore:
Timestamp:
11/25/03 23:37:22 (21 years ago)
Author:
jalet
Message:

Small code move

Location:
pykota/trunk/pykota
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/logger.py

    r1144 r1218  
    2222# 
    2323# $Log$ 
     24# Revision 1.10  2003/11/25 22:37:22  jalet 
     25# Small code move 
     26# 
    2427# Revision 1.9  2003/10/07 09:07:28  jalet 
    2528# Character encoding added to please latest version of Python 
     
    6669    __str__ = __repr__ 
    6770 
    68 def openLogger(pykotatool) : 
     71def openLogger(pykotatool, backend) : 
    6972    """Returns the appropriate logger subsystem object.""" 
    70     backend = pykotatool.config.getLoggingBackend() 
    7173    try : 
    72         if not backend.isalpha() : 
    73             # don't trust user input 
    74             raise ImportError 
    7574        exec "from pykota.loggers import %s as loggingbackend" % backend.lower()     
    7675    except ImportError : 
  • pykota/trunk/pykota/tool.py

    r1217 r1218  
    2222# 
    2323# $Log$ 
     24# Revision 1.62  2003/11/25 22:37:22  jalet 
     25# Small code move 
     26# 
    2427# Revision 1.61  2003/11/25 22:03:28  jalet 
    2528# No more message on stderr when the translation is not available. 
     
    251254from mx import DateTime 
    252255 
    253 from pykota import version, config, storage, logger 
    254 from pykota.accounter import openAccounter 
     256from pykota import version, config, storage, logger, accounter 
    255257 
    256258class PyKotaToolError(Exception): 
     
    278280        self.documentation = doc 
    279281        self.config = config.PyKotaConfig("/etc/pykota") 
    280         self.logger = logger.openLogger(self) 
     282        self.logger = logger.openLogger(self, self.config.getLoggingBackend()) 
    281283        self.debug = self.config.getDebug() 
    282284        self.storage = storage.openConnection(self) 
     
    639641        self.username = self.username or 'root'  
    640642        self.preserveinputfile = self.inputfile  
    641         self.accounter = openAccounter(self) 
     643        self.accounter = accounter.openAccounter(self) 
    642644     
    643645    def extractInfoFromCupsOrLprng(self) :