Changeset 927 for pykota/trunk/bin/edpykota
- Timestamp:
- 04/16/03 14:35:49 (21 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/edpykota
r924 r927 23 23 # 24 24 # $Log$ 25 # Revision 1.41 2003/04/16 12:35:49 jalet 26 # Groups quota work now ! 27 # 25 28 # Revision 1.40 2003/04/16 08:22:09 jalet 26 29 # More strict error detection. … … 340 343 if not names : 341 344 if options["add"] and not printeradded : 342 raise PyKotaToolError, _("You have to pass user names on the command line")345 raise PyKotaToolError, _("You have to pass user or group names on the command line") 343 346 else : 344 347 names = [ "*" ] # all users … … 366 369 if limitby and (limitby not in ('quota', 'balance')) : 367 370 raise PyKotaToolError, _("Invalid limitby value %s" % options["limitby"]) 371 372 if options["ingroups"] : 373 groupnames = [gname.strip() for gname in options["ingroups"].split(',')] 374 else : 375 groupnames = [] 368 376 369 377 for (printerid, printer) in printers : … … 393 401 if softlimit is not None : 394 402 self.logger.log_message(_("Undefined soft limit set to hard limit (%s) on printer %s.") % (str(softlimit), printer)) 395 if (not options[" reset"] and not options["noquota"] and not options["prototype"] and not options["limitby"] and not options["balance"] and not options["delete"] and not options["charge"]) and ((hardlimit is None) or (softlimit is None)) :403 if (not options["ingroups"] and not options["reset"] and not options["noquota"] and not options["prototype"] and not options["limitby"] and not options["balance"] and not options["delete"] and not options["charge"]) and ((hardlimit is None) or (softlimit is None)) : 396 404 raise PyKotaToolError, _("Both hard and soft limits must be set ! Aborting.") 397 405 if options["add"] : … … 458 466 else : 459 467 self.storage.setUserBalance(ident, balancevalue) 468 for groupname in groupnames : 469 groupid = self.storage.getGroupId(groupname) 470 if groupid is not None : 471 self.storage.addUserToGroup(ident, groupid) 460 472 self.warnUserPQuota(name, printer) 461 473 … … 506 518 elif options["groups"] and (options["balance"] or options["ingroups"]) : 507 519 raise PyKotaToolError, _("incompatible options, see help.") 508 elif options["groups"] :509 raise PyKotaToolError, _("option --groups is currently not implemented.")510 520 else : 511 521 sys.exit(editor.main(args, options))