Show
Ignore:
Timestamp:
06/10/03 18:37:54 (21 years ago)
Author:
jalet
Message:

Deletion of the second user which is not needed anymore.
Added a debug configuration field in /etc/pykota.conf
All queries can now be sent to the logger in debug mode, this will
greatly help improve performance when time for this will come.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storages/ldapstorage.py

    r1020 r1021  
    2121# 
    2222# $Log$ 
     23# Revision 1.5  2003/06/10 16:37:54  jalet 
     24# Deletion of the second user which is not needed anymore. 
     25# Added a debug configuration field in /etc/pykota.conf 
     26# All queries can now be sent to the logger in debug mode, this will 
     27# greatly help improve performance when time for this will come. 
     28# 
    2329# Revision 1.4  2003/06/10 10:45:32  jalet 
    2430# Not implemented methods now raise an exception when called. 
     
    5561     
    5662class Storage : 
    57     def __init__(self, host, dbname, user, passwd) : 
     63    def __init__(self, pykotatool, host, dbname, user, passwd) : 
    5864        """Opens the LDAP connection.""" 
    5965        # raise PyKotaStorageError, "Sorry, the LDAP backend for PyKota is not yet implemented !" 
     66        self.tool = pykotatool 
     67        self.debug = pykotatool.config.getDebug() 
    6068        self.closed = 1 
    6169        try : 
     
    6775        else :     
    6876            self.closed = 0 
     77            if self.debug : 
     78                self.tool.logger.log_message("Database opened (host=%s, dbname=%s, user=%s)" % (host, dbname, user), "debug") 
    6979             
    7080    def __del__(self) :         
     
    7383            del self.database 
    7484            self.closed = 1 
     85            if self.debug : 
     86                self.tool.logger.log_message("Database closed.", "debug") 
    7587         
    7688    def doSearch(self, key, fields, base="", scope=ldap.SCOPE_SUBTREE) : 
     
    7890        try : 
    7991            # prepends something more restrictive at the beginning of the base dn 
     92            if self.debug : 
     93                self.tool.logger.log_message("QUERY : BaseDN : %s, Scope : %s, Filter : %s, Attributes : %s" % ((base or self.basedn), scope, key, fields), "debug") 
    8094            result = self.database.search_s(base or self.basedn, scope, key, fields) 
    8195        except ldap.NO_SUCH_OBJECT :