Show
Ignore:
Timestamp:
09/17/05 16:29:43 (19 years ago)
Author:
jerome
Message:

Upgraded database schema.
Added -i | --ingroups command line option to repykota.
Added -C | --comment command line option to edpykota.
Added 'noquota', 'noprint', and 'nochange' as switches for edpykota's
-l | --limitby command line option.
Severity : entirely new features, in need of testers :-)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/repykota

    r2344 r2452  
    5555  -g | --groups        Generates a report on group quota instead of users. 
    5656   
     57  -i | --ingroups g1[,g2...]  Only lists users who are members of these 
     58                              groups. Reserved to PyKota Administrators. 
     59   
    5760  -P | --printer p     Report quotas on this printer only. Actually p can 
    5861                       use wildcards characters to select only 
     
    9295                # no username, means all usernames 
    9396                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) ] 
    94109        else :         
    95             # not the root user 
    96110            # reports only the current user 
     111            if options["ingroups"] : 
     112                raise PyKotaToolError, _("Option --ingroups is reserved to PyKota Administrators.") 
     113                 
    97114            username = pwd.getpwuid(os.geteuid())[0] 
    98115            if options["groups"] : 
     
    118135                     "printer" : "*", \ 
    119136                   } 
    120         short_options = "vhugP:" 
    121         long_options = ["help", "version", "users", "groups", "printer="] 
     137        short_options = "vhugi:P:" 
     138        long_options = ["help", "version", "users", "groups", "ingroups=", "printer="] 
    122139         
    123140        # Initializes the command line tool 
     
    134151        options["groups"] = options["g"] or options["groups"] 
    135152        options["printer"] = options["P"] or options["printer"] or defaults["printer"] 
     153        options["ingroups"] = options["i"] or options["ingroups"] 
    136154         
    137155        if options["help"] :