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

    r2782 r2783  
    150150            raise PyKotaCommandLineError, "%s : %s" % (pwd.getpwuid(os.geteuid())[0], _("You're not allowed to use this command.")) 
    151151             
     152        if not options["list"] :     
     153            percent = Percent(self) 
     154             
    152155        if not options["add"] : 
    153156            if not options["list"] : 
    154                 self.display(_("Extracting datas...")) 
     157                percent.display(_("Extracting datas...")) 
    155158            if not names :      # NB : can't happen for --delete because it's catched earlier 
    156159                names = ["*"] 
     
    158161            if not printers : 
    159162                raise PyKotaCommandLineError, _("There's no printer matching %s") % " ".join(names) 
     163            if not options["list"] :     
     164                percent.setSize(len(printers)) 
    160165                 
    161166        if options["list"] : 
     
    171176                print     
    172177        elif options["delete"] :     
    173             percent = Percent(self, "\n%s..." % _("Deletion"), len(printers)) 
     178            percent.display("\n%s..." % _("Deletion")) 
    174179            self.storage.deleteManyPrinters(printers) 
    175180            percent.display("\n") 
     
    217222            try : 
    218223                if options["add"] :     
    219                     percent = Percent(self, "%s...\n" % _("Creation"), len(names)) 
     224                    percent.display("%s...\n" % _("Creation")) 
     225                    percent.setSize(len(names)) 
    220226                    for pname in names : 
    221227                        if self.isValidName(pname) : 
     
    244250                        percent.oneMore() 
    245251                else :         
    246                     percent = Percent(self, "\n%s...\n" % _("Modification"), len(printers)) 
     252                    percent.display("\n%s...\n" % _("Modification")) 
    247253                    for printer in printers :         
    248254                        self.modifyPrinter(printer, charges, perpage, perjob, \ 
     
    258264                self.storage.commitTransaction() 
    259265                 
    260         try : 
     266        if not options["list"] : 
    261267            percent.done() 
    262         except NameError :     
    263             pass 
    264268                      
    265269if __name__ == "__main__" :