Show
Ignore:
Timestamp:
07/06/05 20:11:00 (19 years ago)
Author:
jerome
Message:

The pkbcodes command line tool now works fine with the PostgreSQL
backend. The dumpykota command can now dump billing codes too.
Still no code for LDAP though.
NB : a database upgrade is necessary AGAIN !
Severity : no need to play with this until there's LDAP support.

Files:
1 modified

Legend:

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

    r2340 r2342  
    431431        self.Exists = 0 
    432432         
    433     def reset(self, pagecounter=0, balance=0.0) :     
     433    def reset(self, balance=0.0, pagecounter=0) :     
    434434        """Resets the pagecounter and balance for this billing code.""" 
    435         self.parent.setBillingCodeValues(self, pagecounter, balance) 
     435        self.parent.setBillingCodeValues(self, balance, pagecounter) 
     436        self.Balance = balance 
    436437        self.PageCounter = pagecounter 
    437         self.Balance = balance 
    438438         
    439439    def setDescription(self, description=None) : 
     
    464464        if self.usecache : 
    465465            self.tool.logdebug("Caching enabled.") 
    466             self.caches = { "USERS" : {}, "GROUPS" : {}, "PRINTERS" : {}, "USERPQUOTAS" : {}, "GROUPPQUOTAS" : {}, "JOBS" : {}, "LASTJOBS" : {} } 
     466            self.caches = { "USERS" : {}, "GROUPS" : {}, "PRINTERS" : {}, "USERPQUOTAS" : {}, "GROUPPQUOTAS" : {}, "JOBS" : {}, "LASTJOBS" : {}, "BILLINGCODES" : {} } 
    467467         
    468468    def close(self) :     
     
    539539            self.cacheEntry("LASTJOBS", printer.Name, lastjob) 
    540540        return lastjob     
     541         
     542    def getBillingCode(self, label) :         
     543        """Returns the user from cache.""" 
     544        code = self.getFromCache("BILLINGCODES", label) 
     545        if code is None : 
     546            code = self.getBillingCodeFromBackend(label) 
     547            self.cacheEntry("BILLINGCODES", label, code) 
     548        return code 
    541549         
    542550    def getParentPrinters(self, printer) :