Changeset 1995 for pykota

Show
Ignore:
Timestamp:
12/26/04 15:50:51 (20 years ago)
Author:
jalet
Message:

Normalized fields names in dumpykota's output so that an LDAP or PostgreSQL
dump is parseable the same way.

Location:
pykota/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/NEWS

    r1993 r1995  
    2424    - 1.21alpha15 : 
    2525       
     26        - Normalized field names between LDAP and PostgreSQL backends 
     27          in dumpykota's output. 
     28           
    2629        - dumpykota filtering capabilities are now supported within 
    2730          the LDAP backend too. 
  • pykota/trunk/pykota/storages/ldapstorage.py

    r1993 r1995  
    2222# 
    2323# $Log$ 
     24# Revision 1.92  2004/12/26 14:50:51  jalet 
     25# Normalized fields names in dumpykota's output so that an LDAP or PostgreSQL 
     26# dump is parseable the same way. 
     27# 
    2428# Revision 1.91  2004/12/21 16:46:25  jalet 
    2529# dumpykota's filtering capabilities are now supported within the LDAP 
     
    14191423        entries = [p for p in [self.getPrinter(name) for name in self.getAllPrintersNames(pname)] if p.Exists] 
    14201424        if entries : 
    1421             result = [ ("dn", "pykotaPrinterName", "pykotaPricePerPage", "pykotaPricePerPage", "description") ] 
     1425            result = [ ("dn", "printername", "priceperpage", "priceperjob", "description") ] 
    14221426            for entry in entries : 
    14231427                result.append((entry.ident, entry.Name, entry.PricePerPage, entry.PricePerJob, entry.Description)) 
     
    14291433        entries = [u for u in [self.getUser(name) for name in self.getAllUsersNames(uname)] if u.Exists] 
    14301434        if entries : 
    1431             result = [ ("dn", "pykotaUserName", self.info["usermail"], "pykotaBalance", "pykotaLifeTimePaid", "pykotaLimitBy") ] 
     1435            result = [ ("dn", "username", "balance", "lifetimepaid", "limitby", "email") ] 
    14321436            for entry in entries : 
    1433                 result.append((entry.ident, entry.Name, entry.Email, entry.AccountBalance, entry.LifeTimePaid, entry.LimitBy)) 
     1437                result.append((entry.ident, entry.Name, entry.AccountBalance, entry.LifeTimePaid, entry.LimitBy, entry.Email)) 
    14341438            return result  
    14351439         
     
    14391443        entries = [g for g in [self.getGroup(name) for name in self.getAllGroupsNames(gname)] if g.Exists] 
    14401444        if entries : 
    1441             result = [ ("dn", "pykotaGroupName", "pykotaBalance", "pykotaLifeTimePaid", "pykotaLimitBy") ] 
     1445            result = [ ("dn", "groupname", "limitby", "balance", "lifetimepaid") ] 
    14421446            for entry in entries : 
    1443                 result.append((entry.ident, entry.Name, entry.AccountBalance, entry.LifeTimePaid, entry.LimitBy)) 
     1447                result.append((entry.ident, entry.Name, entry.LimitBy, entry.AccountBalance, entry.LifeTimePaid)) 
    14441448            return result  
    14451449         
     
    14491453        entries = [u for u in [self.getUser(name) for name in self.getAllUsersNames(uname)] if u.Exists] 
    14501454        if entries : 
    1451             result = [ ("pykotaUserName", "date", "amount") ] 
     1455            result = [ ("username", "amount", "date") ] 
    14521456            for entry in entries : 
    14531457                for (date, amount) in entry.Payments : 
    1454                     result.append((entry.Name, date, amount)) 
     1458                    result.append((entry.Name, amount, date)) 
    14551459            return result         
    14561460         
     
    14601464        entries = [p for p in [self.getPrinter(name) for name in self.getAllPrintersNames(pname)] if p.Exists] 
    14611465        if entries : 
    1462             result = [ ("pykotaUserName", "pykotaPrinterName", "dn", "userdn", "printerdn", "pykotaLifePageCounter", "pykotaPageCounter", "pykotaSoftLimit", "pykotaHardLimit", "pykotaDateLimit") ] 
     1466            result = [ ("username", "printername", "dn", "userdn", "printerdn", "lifepagecounter", "pagecounter", "softlimit", "hardlimit", "datelimit") ] 
    14631467            uname = extraconly.get("username") 
    14641468            for entry in entries : 
     
    14731477        entries = [p for p in [self.getPrinter(name) for name in self.getAllPrintersNames(pname)] if p.Exists] 
    14741478        if entries : 
    1475             result = [ ("pykotaGroupName", "pykotaPrinterName", "dn", "groupdn", "printerdn", "pykotaLifePageCounter", "pykotaPageCounter", "pykotaSoftLimit", "pykotaHardLimit", "pykotaDateLimit") ] 
     1479            result = [ ("groupname", "printername", "dn", "groupdn", "printerdn", "lifepagecounter", "pagecounter", "softlimit", "hardlimit", "datelimit") ] 
    14761480            gname = extractonly.get("groupname") 
    14771481            for entry in entries : 
     
    14861490        entries = [g for g in [self.getGroup(name) for name in self.getAllGroupsNames(gname)] if g.Exists] 
    14871491        if entries : 
    1488             result = [ ("pykotaGroupName", "pykotaUserName", "groupdn", "userdn") ] 
     1492            result = [ ("groupname", "username", "groupdn", "userdn") ] 
    14891493            uname = extractonly.get("username") 
    14901494            for entry in entries : 
     
    14991503        entries = [p for p in [self.getPrinter(name) for name in self.getAllPrintersNames(pname)] if p.Exists] 
    15001504        if entries : 
    1501             result = [ ("pykotaPGroupName", "pykotaPrinterName", "pgroupdn", "printerdn") ] 
     1505            result = [ ("pgroupname", "printername", "pgroupdn", "printerdn") ] 
    15021506            pgname = extractonly.get("pgroupname") 
    15031507            for entry in entries : 
     
    15211525        entries = self.retrieveHistory(user, printer, limit=None) 
    15221526        if entries : 
    1523             result = [ ("pykotaUserName", "pykotaPrinterName", "dn", "pykotaJobId", "pykotaPrinterPageCounter", "pykotaJobSize", "pykotaAction", "createTimeStamp", "pykotaFileName", "pykotaTitle", "pykotaCopies", "pykotaOptions", "pykotaJobPrice", "pykotaHostName", "pykotaJobSizeBytes") ]  
     1527            result = [ ("username", "printername", "dn", "jobid", "pagecounter", "jobsize", "action", "jobdate", "filename", "title", "copies", "options", "jobprice", "hostname", "jobsizebytes") ]  
    15241528            for entry in entries : 
    15251529                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))