Changeset 2358 for pykota

Show
Ignore:
Timestamp:
07/11/05 23:12:27 (19 years ago)
Author:
jerome
Message:

More work done on billing codes + LDAP.
Severity: minor.

Files:
1 modified

Legend:

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

    r2302 r2358  
    12061206                 
    12071207    def deletePrinter(self, printer) :     
    1208         """Completely deletes an user from the Quota Storage.""" 
     1208        """Completely deletes a printer from the Quota Storage.""" 
    12091209        result = self.doSearch("(&(objectClass=pykotaLastJob)(pykotaPrinterName=%s))" % printer.Name, base=self.info["lastjobbase"]) 
    12101210        for (ident, fields) in result : 
     
    12391239        self.doDelete(printer.ident)     
    12401240         
     1241    def deleteBillingCode(self, code) : 
     1242        """Deletes a billing code from the Quota Storage (no entries are deleted from the history)""" 
     1243        self.doDelete(code.ident) 
     1244         
    12411245    def extractPrinters(self, extractonly={}) : 
    12421246        """Extracts all printer records.""" 
     
    12571261            for entry in entries : 
    12581262                result.append((entry.ident, entry.Name, entry.AccountBalance, entry.LifeTimePaid, entry.LimitBy, entry.Email)) 
     1263            return result  
     1264         
     1265    def extractBillingcodes(self, extractonly={}) : 
     1266        """Extracts all billing codes records.""" 
     1267        billingcode = extractonly.get("billingcode") 
     1268        entries = [b for b in [self.getBillingCode(label) for label in self.getAllBillingCodes(billingcode)] if b.Exists] 
     1269        if entries : 
     1270            result = [ ("dn", "billingcode", "balance", "pagecounter", "description") ] 
     1271            for entry in entries : 
     1272                result.append((entry.ident, entry.BillingCode, entry.Balance, entry.PageCounter, entry.Description)) 
    12591273            return result  
    12601274         
     
    13501364            for entry in entries : 
    13511365                result.append((entry.UserName, entry.PrinterName, entry.ident, entry.JobId, entry.PrinterPageCounter, entry.JobSize, entry.JobAction, entry.JobDate, entry.JobFileName, entry.JobTitle, entry.JobCopies, entry.JobOptions, entry.JobPrice, entry.JobHostName, entry.JobSizeBytes, entry.JobMD5Sum, entry.JobPages, entry.JobBillingCode))  
    1352             return result     
     1366            return result 
     1367             
     1368             
     1369# def getBillingCodeFromBackend(self, label) :         
     1370# def getMatchingBillingCodes(self, billingcodepattern) : 
     1371# def addBillingCode(self, label) :         
     1372# def writeBillingCodeDescription(self, code) : 
     1373# def setBillingCodeValues(self, code, newbalance, newpagecounter) :     
     1374# def consumeBillingCode(self, code, balance, pagecounter) : 
     1375