Changeset 729 for pykota/trunk/bin
- Timestamp:
- 02/07/03 00:20:03 (22 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/warnpykota
r728 r729 17 17 # 18 18 # $Log$ 19 # Revision 1.3 2003/02/06 23:20:02 jalet 20 # warnpykota doesn't need any user/group name argument, mimicing the 21 # warnquota disk quota tool. 22 # 19 23 # Revision 1.2 2003/02/06 22:54:33 jalet 20 24 # warnpykota should be ok … … 33 37 command line usage : 34 38 35 warnpykota [options] user1 user2 ... userN 36 warnpykota [options] group1 group2 ... groupN 39 warnpykota [options] 37 40 38 41 options : … … 86 89 class WarnPyKota(PyKotaTool) : 87 90 """A class for warnpykota.""" 88 def main(self, names,options) :91 def main(self, options) : 89 92 """Warn users or groups over print quota.""" 93 90 94 printernames = self.storage.getMatchingPrinters(options["printer"]) 91 95 if not printernames : 92 96 raise PyKotaToolError, "There's no printer matching %s" % options["printer"] 93 97 for printer in printernames : 94 for name in names:95 if options["users"]:98 if options["users"] : 99 for name in self.storage.getPrinterUsers(printer) : 96 100 self.warnUserPQuota(name, printer) 97 else : 101 else : 102 for name in self.storage.getPrinterGroups(printer) : 98 103 self.warnGroupPQuota(name, printer) 99 104 … … 112 117 113 118 # parse and checks the command line 114 (options, args) = sender.parseCommandline(sys.argv[1:], short_options, long_options )119 (options, args) = sender.parseCommandline(sys.argv[1:], short_options, long_options, allownothing=1) 115 120 116 121 # sets long options … … 129 134 elif options["groups"] : 130 135 raise PyKotaToolError, "warnpykota: options --groups is currently not implemented." 136 elif args : 137 raise PyKotaToolError, "warnpykota: unused arguments [%s]. Aborting." % ", ".join(args) 131 138 else : 132 sys.exit(sender.main( args,options))139 sys.exit(sender.main(options)) 133 140 except PyKotaToolError, msg : 134 141 sys.stderr.write("%s\n" % msg)