Changeset 2452 for pykota/trunk/bin/repykota
- Timestamp:
- 09/17/05 16:29:43 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/repykota
r2344 r2452 55 55 -g | --groups Generates a report on group quota instead of users. 56 56 57 -i | --ingroups g1[,g2...] Only lists users who are members of these 58 groups. Reserved to PyKota Administrators. 59 57 60 -P | --printer p Report quotas on this printer only. Actually p can 58 61 use wildcards characters to select only … … 92 95 # no username, means all usernames 93 96 ugnames = [ "*" ] 97 98 if options["ingroups"] : 99 groupsnames = options["ingroups"].split(",") 100 groups = [self.storage.getGroup(gname) for gname in groupsnames] 101 members = {} 102 for group in groups : 103 if not group.Exists : 104 self.printInfo("Group %s doesn't exist." % group.Name, "warn") 105 else : 106 for user in self.storage.getGroupMembers(group) : 107 members[user.Name] = user 108 ugnames = [ m for m in members.keys() if self.matchString(m, ugnames) ] 94 109 else : 95 # not the root user96 110 # reports only the current user 111 if options["ingroups"] : 112 raise PyKotaToolError, _("Option --ingroups is reserved to PyKota Administrators.") 113 97 114 username = pwd.getpwuid(os.geteuid())[0] 98 115 if options["groups"] : … … 118 135 "printer" : "*", \ 119 136 } 120 short_options = "vhug P:"121 long_options = ["help", "version", "users", "groups", " printer="]137 short_options = "vhugi:P:" 138 long_options = ["help", "version", "users", "groups", "ingroups=", "printer="] 122 139 123 140 # Initializes the command line tool … … 134 151 options["groups"] = options["g"] or options["groups"] 135 152 options["printer"] = options["P"] or options["printer"] or defaults["printer"] 153 options["ingroups"] = options["i"] or options["ingroups"] 136 154 137 155 if options["help"] :