Show
Ignore:
Timestamp:
03/05/06 09:36:47 (18 years ago)
Author:
jerome
Message:

Now outputs the average speed, so no need to do this in filldb anymore.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pkbcodes

    r2782 r2783  
    9797            raise PyKotaCommandLineError, "%s : %s" % (pwd.getpwuid(os.geteuid())[0], _("You're not allowed to use this command.")) 
    9898             
     99        if not options["list"] :     
     100            percent = Percent(self) 
     101             
    99102        if not options["add"] : 
    100103            if not options["list"] : 
    101                 self.display(_("Extracting datas...")) 
     104                percent.display(_("Extracting datas...")) 
    102105            if not names :      # NB : can't happen for --delete because it's catched earlier 
    103106                names = ["*"] 
     
    105108            if not billingcodes : 
    106109                raise PyKotaCommandLineError, _("There's no billingcode matching %s") % " ".join(names) 
     110            if not options["list"] :     
     111                percent.setSize(len(billingcodes)) 
    107112                         
    108113        if options["list"] : 
     
    116121                       _("credits")) 
    117122        elif options["delete"] :     
    118             percent = Percent(self, "\n%s..." % _("Deletion"), len(billingcodes)) 
     123            percent.display("\n%s..." % _("Deletion")) 
    119124            self.storage.deleteManyBillingCodes(billingcodes) 
    120125            percent.display("\n") 
     
    129134            try : 
    130135                if options["add"] :     
    131                     percent = Percent(self, "%s...\n" % _("Creation"), len(names)) 
     136                    percent.display("%s...\n" % _("Creation")) 
     137                    percent.setSize(len(names)) 
    132138                    for bname in names : 
    133139                        billingcode = StorageBillingCode(self.storage, bname) 
     
    143149                        percent.oneMore() 
    144150                else :         
    145                     percent = Percent(self, "\n%s...\n" % _("Modification"), len(billingcodes)) 
     151                    percent.display("\n%s...\n" % _("Modification")) 
    146152                    for billingcode in billingcodes : 
    147153                        self.modifyBillingCode(billingcode, reset, description) 
     
    154160                self.storage.commitTransaction() 
    155161                         
    156         try : 
     162        if not options["list"] : 
    157163            percent.done() 
    158         except NameError :     
    159             pass 
    160164                      
    161165if __name__ == "__main__" :