Changeset 2776 for pykota/trunk

Show
Ignore:
Timestamp:
03/02/06 17:42:31 (19 years ago)
Author:
jerome
Message:

Fixed billing code extraction : it didn't have the speed improvements
that was added to printers, users and groups.

Files:
1 modified

Legend:

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

    r2773 r2776  
    17531753        if result : 
    17541754            patterns = billingcodepattern.split(",") 
     1755            try : 
     1756                patdict = {}.fromkeys(patterns) 
     1757            except AttributeError :     
     1758                # Python v2.2 or earlier 
     1759                patdict = {} 
     1760                for p in patterns : 
     1761                    patdict[p] = None 
    17551762            for (codeid, fields) in result : 
    17561763                codename = self.databaseToUserCharset(fields.get("pykotaBillingCode", [""])[0]) 
    1757                 if self.tool.matchString(codename, patterns) : 
     1764                if patdict.has_key(codename) or self.tool.matchString(codename, patterns) : 
    17581765                    code = StorageBillingCode(self, codename) 
    17591766                    code.ident = codeid