Show
Ignore:
Timestamp:
02/08/03 23:39:46 (21 years ago)
Author:
jalet
Message:

--reset command line option added

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/edpykota

    r767 r768  
    1717# 
    1818# $Log$ 
     19# Revision 1.16  2003/02/08 22:39:46  jalet 
     20# --reset command line option added 
     21# 
    1922# Revision 1.15  2003/02/08 22:20:01  jalet 
    2023# Clarification on why we don't check with /etc/passwd to see if the user 
     
    98101  -p | --prototype u|g Uses user u or group g as a prototype to set 
    99102                       print quotas 
     103                        
     104  -r | --reset         Resets the printed page counter for the user 
     105                       or group to zero. The life time page counter  
     106                       is kept unchanged. 
    100107                        
    101108  -S | --softlimit sl  Sets the quota soft limit to sl pages.                        
     
    223230                    if options["users"] : 
    224231                        self.storage.setUserPQuota(name, printer, softlimit, hardlimit) 
     232                        if options["reset"] : 
     233                            self.storage.resetUserPQuota(name, printer) 
    225234                    else : 
    226235                        self.storage.setGroupPQuota(name, printer, softlimit, hardlimit) 
     236                        if options["reset"] : 
     237                            self.storage.resetGroupPQuota(name, printer) 
    227238                      
    228239if __name__ == "__main__" :  
     
    233244                     "printer" : "*", \ 
    234245                   } 
    235         short_options = "vhaugp:P:S:H:" 
    236         long_options = ["help", "version", "add", "users", "groups", "prototype=", "printer=", "softlimit=", "hardlimit="] 
     246        short_options = "vhaugrp:P:S:H:" 
     247        long_options = ["help", "version", "add", "users", "groups", "reset", "prototype=", "printer=", "softlimit=", "hardlimit="] 
    237248         
    238249        # Initializes the command line tool 
     
    252263        options["softlimit"] = options["S"] or options["softlimit"] 
    253264        options["hardlimit"] = options["H"] or options["hardlimit"]  
     265        options["reset"] = options["r"] or options["reset"]  
    254266         
    255267        if options["help"] :