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/pkusers

    r2782 r2783  
    193193        suffix = (options["groups"] and "Group") or "User"         
    194194         
     195        if not options["list"] : 
     196            percent = Percent(self) 
     197             
    195198        if not options["add"] : 
    196199            if not options["list"] : 
    197                 self.display(_("Extracting datas...")) 
     200                percent.display(_("Extracting datas...")) 
    198201            if not names :      # NB : can't happen for --delete because it's catched earlier 
    199202                names = ["*"] 
     
    201204            if not entries : 
    202205                raise PyKotaCommandLineError, _("There's no %s matching %s") % (_(suffix.lower()), " ".join(names)) 
     206            if not options["list"] :     
     207                percent.setSize(len(entries)) 
    203208                 
    204209        if options["list"] : 
     
    235240                    print 
    236241        elif options["delete"] :     
    237             percent = Percent(self, "\n%s..." % _("Deletion"), len(entries)) 
     242            percent.display("\n%s..." % _("Deletion")) 
    238243            getattr(self.storage, "deleteMany%ss" % suffix)(entries) 
    239244            percent.display("\n") 
     
    287292                if options["add"] :     
    288293                    rejectunknown = self.config.getRejectUnknown()     
    289                     percent = Percent(self, "%s...\n" % _("Creation"), len(names)) 
     294                    percent.display("%s...\n" % _("Creation")) 
     295                    percent.setSize(len(names)) 
    290296                    for ename in names : 
    291297                        email = None 
     
    347353                        percent.oneMore() 
    348354                else : 
    349                     percent = Percent(self, "\n%s...\n" % _("Modification"), len(entries))  
     355                    percent.display("\n%s...\n" % _("Modification")) 
    350356                    for entry in entries : 
    351357                        if groups : 
     
    364370                self.storage.commitTransaction() 
    365371                 
    366         try : 
     372        if not options["list"] : 
    367373            percent.done() 
    368         except NameError :     
    369             pass 
    370374                      
    371375if __name__ == "__main__" :