Changeset 2783 for pykota/trunk/bin/pkprinters
- Timestamp:
- 03/05/06 09:36:47 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pkprinters
r2782 r2783 150 150 raise PyKotaCommandLineError, "%s : %s" % (pwd.getpwuid(os.geteuid())[0], _("You're not allowed to use this command.")) 151 151 152 if not options["list"] : 153 percent = Percent(self) 154 152 155 if not options["add"] : 153 156 if not options["list"] : 154 self.display(_("Extracting datas..."))157 percent.display(_("Extracting datas...")) 155 158 if not names : # NB : can't happen for --delete because it's catched earlier 156 159 names = ["*"] … … 158 161 if not printers : 159 162 raise PyKotaCommandLineError, _("There's no printer matching %s") % " ".join(names) 163 if not options["list"] : 164 percent.setSize(len(printers)) 160 165 161 166 if options["list"] : … … 171 176 print 172 177 elif options["delete"] : 173 percent = Percent(self, "\n%s..." % _("Deletion"), len(printers))178 percent.display("\n%s..." % _("Deletion")) 174 179 self.storage.deleteManyPrinters(printers) 175 180 percent.display("\n") … … 217 222 try : 218 223 if options["add"] : 219 percent = Percent(self, "%s...\n" % _("Creation"), len(names)) 224 percent.display("%s...\n" % _("Creation")) 225 percent.setSize(len(names)) 220 226 for pname in names : 221 227 if self.isValidName(pname) : … … 244 250 percent.oneMore() 245 251 else : 246 percent = Percent(self, "\n%s...\n" % _("Modification"), len(printers))252 percent.display("\n%s...\n" % _("Modification")) 247 253 for printer in printers : 248 254 self.modifyPrinter(printer, charges, perpage, perjob, \ … … 258 264 self.storage.commitTransaction() 259 265 260 try:266 if not options["list"] : 261 267 percent.done() 262 except NameError :263 pass264 268 265 269 if __name__ == "__main__" :