Show
Ignore:
Timestamp:
02/12/06 00:05:15 (18 years ago)
Author:
jerome
Message:

The duration for the modification of billing codes has been more than halved.

Files:
1 modified

Legend:

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

    r2665 r2676  
    4040        self.parent = parent 
    4141        self.ident = None 
    42         self.Exists = 0 
     42        self.isDirty = False 
     43        self.Exists = False 
    4344         
    4445class StorageUser(StorageObject) :         
     
    452453        self.parent.deleteBillingCode(self) 
    453454        self.parent.flushEntry("BILLINGCODES", self.BillingCode) 
    454         self.Exists = 0 
     455        self.Exists = False 
     456        self.isDirty = False 
    455457         
    456458    def reset(self, balance=0.0, pagecounter=0) :     
    457459        """Resets the pagecounter and balance for this billing code.""" 
    458         self.parent.setBillingCodeValues(self, pagecounter, balance) 
    459         self.Balance = balance 
    460         self.PageCounter = pagecounter 
     460        if self.Balance != balance : 
     461            self.Balance = balance 
     462            self.isDirty = True 
     463        if self.PageCounter != pagecounter : 
     464            self.PageCounter = pagecounter 
     465            self.isDirty = True 
    461466         
    462467    def setDescription(self, description=None) : 
     
    466471        else :     
    467472            self.Description = str(description) 
    468         self.parent.writeBillingCodeDescription(self) 
     473        self.isDirty = True     
     474         
     475    def save(self) :     
     476        """Saves the billing code to disk in a single operation.""" 
     477        if self.isDirty : 
     478            self.parent.saveBillingCode(self) 
     479            self.isDirty = False 
    469480         
    470481    def consume(self, pages, price) :