Changeset 2685

Show
Ignore:
Timestamp:
02/12/06 12:43:30 (18 years ago)
Author:
jerome
Message:

Additionnal things removed from inner loop.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pkbcodes

    r2684 r2685  
    138138            else :                
    139139                self.display("%s...\n" % _("Modification")) 
    140                 if options["description"] or options["reset"] : # optimize when nothing to do 
     140                reset = options["reset"] 
     141                if reset or options["description"] : # optimize when nothing to do 
     142                    if options["description"] : 
     143                        description = options["description"].strip() 
    141144                    nbtotal = len(billingcodes)             
    142145                    for i in range(nbtotal) :         
    143146                        billingcode = billingcodes[i] 
    144                         if options["reset"] : 
     147                        if reset : 
    145148                            billingcode.reset()     
    146                         if options["description"] is not None : 
    147                             billingcode.setDescription(options["description"].strip()) 
     149                        if description is not None : # NB : "" is allowed ! 
     150                            billingcode.setDescription(description) 
    148151                        billingcode.save()     
    149152                        percent = 100.0 * float(i) / float(nbtotal)