Changeset 815 for pykota/trunk/bin
- Timestamp:
- 02/27/03 10:04:46 (22 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/edpykota
r791 r815 17 17 # 18 18 # $Log$ 19 # Revision 1.21 2003/02/27 09:04:46 jalet 20 # user and group names can be passed as wildcards if the --add option 21 # is not set. The default is to act on all users or groups. 22 # 19 23 # Revision 1.20 2003/02/10 12:07:30 jalet 20 24 # Now repykota should output the recorded total page number for each printer too. … … 123 127 -H | --hardlimit hl Sets the quota hard limit to hl pages. 124 128 129 user1 through userN and group1 through groupN can use wildcards 130 if the --add option is not set. 131 125 132 examples : 126 133 … … 149 156 to 550 pages for groups financial and support on all printers. 150 157 151 $ edpykota --reset jerome 152 153 This will reset jerome's page counter to zero on all printers. 154 His life time page counter on each printer will be kept unchanged. 158 $ edpykota --reset jerome "jo*" 159 160 This will reset jerome's page counter to zero on all printers, as 161 well as every user whose name begins with 'jo'. 162 Their life time page counter on each printer will be kept unchanged. 155 163 156 164 This program is free software; you can redistribute it and/or modify … … 200 208 self.logger.log_message(_("Hard limit %i is less than soft limit %i, values will be exchanged.") % (hardlimit, softlimit), "warn") 201 209 (softlimit, hardlimit) = (hardlimit, softlimit) 210 if not names : 211 if options["add"] : 212 raise PyKotaToolError, _("You have to pass user names on the command line") 213 else : 214 names = [ "*" ] # all users 202 215 for (printer, printerpagecounter) in printernames : 203 216 if options["prototype"] : … … 219 232 if (not options["reset"]) and ((hardlimit is None) or (softlimit is None)) : 220 233 raise PyKotaToolError, _("Both hard and soft limits must be set ! Aborting.") 221 for name in names : 234 if options["users"] : 235 allnames = self.storage.getPrinterUsers(printer) 236 else : 237 allnames = self.storage.getPrinterGroups(printer) 238 for name in [n for n in allnames if self.matchString(n, names)]: 222 239 if options["users"] : 223 240 quota = self.storage.getUserPQuota(name, printer)