Changeset 2775

Show
Ignore:
Timestamp:
03/02/06 17:39:29 (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/sql.py

    r2773 r2775  
    470470        if result : 
    471471            patterns = billingcodepattern.split(",") 
     472            try : 
     473                patdict = {}.fromkeys(patterns) 
     474            except AttributeError :     
     475                # Python v2.2 or earlier 
     476                patdict = {} 
     477                for p in patterns : 
     478                    patdict[p] = None 
    472479            for record in result : 
    473480                codename = self.databaseToUserCharset(record["billingcode"]) 
    474                 if self.tool.matchString(codename, patterns) : 
     481                if patdict.has_key(codename) or self.tool.matchString(codename, patterns) : 
    475482                    code = StorageBillingCode(self, codename) 
    476483                    code.ident = record.get("id")