Changeset 2783 for pykota/trunk/bin/pkusers
- Timestamp:
- 03/05/06 09:36:47 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pkusers
r2782 r2783 193 193 suffix = (options["groups"] and "Group") or "User" 194 194 195 if not options["list"] : 196 percent = Percent(self) 197 195 198 if not options["add"] : 196 199 if not options["list"] : 197 self.display(_("Extracting datas..."))200 percent.display(_("Extracting datas...")) 198 201 if not names : # NB : can't happen for --delete because it's catched earlier 199 202 names = ["*"] … … 201 204 if not entries : 202 205 raise PyKotaCommandLineError, _("There's no %s matching %s") % (_(suffix.lower()), " ".join(names)) 206 if not options["list"] : 207 percent.setSize(len(entries)) 203 208 204 209 if options["list"] : … … 235 240 print 236 241 elif options["delete"] : 237 percent = Percent(self, "\n%s..." % _("Deletion"), len(entries))242 percent.display("\n%s..." % _("Deletion")) 238 243 getattr(self.storage, "deleteMany%ss" % suffix)(entries) 239 244 percent.display("\n") … … 287 292 if options["add"] : 288 293 rejectunknown = self.config.getRejectUnknown() 289 percent = Percent(self, "%s...\n" % _("Creation"), len(names)) 294 percent.display("%s...\n" % _("Creation")) 295 percent.setSize(len(names)) 290 296 for ename in names : 291 297 email = None … … 347 353 percent.oneMore() 348 354 else : 349 percent = Percent(self, "\n%s...\n" % _("Modification"), len(entries))355 percent.display("\n%s...\n" % _("Modification")) 350 356 for entry in entries : 351 357 if groups : … … 364 370 self.storage.commitTransaction() 365 371 366 try:372 if not options["list"] : 367 373 percent.done() 368 except NameError :369 pass370 374 371 375 if __name__ == "__main__" :