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/storage.py

    r952 r1021  
    2121# 
    2222# $Log$ 
     23# Revision 1.13  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.12  2003/04/23 22:13:57  jalet 
    2430# Preliminary support for LPRng added BUT STILL UNTESTED. 
     
    7884    __str__ = __repr__ 
    7985         
    80 def openConnection(config, asadmin=0) : 
     86def openConnection(pykotatool) : 
    8187    """Returns a connection handle to the appropriate Quota Storage Database.""" 
    82     backendinfo = config.getStorageBackend() 
     88    backendinfo = pykotatool.config.getStorageBackend() 
    8389    backend = backendinfo["storagebackend"] 
    8490    try : 
     
    8692            # don't trust user input 
    8793            raise ImportError 
     94        #     
     95        # TODO : descending compatibility 
     96        #  
     97        if backend == "postgresql" : 
     98            backend = "pgstorage"       # TODO : delete, this is for descending compatibility only 
    8899        exec "from pykota.storages import %s as storagebackend" % backend.lower()     
    89100    except ImportError : 
     
    93104        database = backendinfo["storagename"] 
    94105        admin = backendinfo["storageadmin"] 
    95         user = backendinfo["storageuser"] 
    96106        adminpw = backendinfo["storageadminpw"] 
    97         userpw = backendinfo["storageuserpw"] 
    98         if asadmin : 
    99             return getattr(storagebackend, "Storage")(host, database, admin, adminpw) 
    100         else :     
    101             return getattr(storagebackend, "Storage")(host, database, user, userpw) 
     107        return getattr(storagebackend, "Storage")(pykotatool, host, database, admin, adminpw) 
    102108