Changeset 769 for pykota/trunk/bin

Show
Ignore:
Timestamp:
02/08/03 23:47:23 (22 years ago)
Author:
jalet
Message:

Option --reset can now be used without having to use soft and hard limits
on the command line.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/edpykota

    r768 r769  
    1717# 
    1818# $Log$ 
     19# Revision 1.17  2003/02/08 22:47:23  jalet 
     20# Option --reset can now be used without having to use soft and hard limits 
     21# on the command line. 
     22# 
    1923# Revision 1.16  2003/02/08 22:39:46  jalet 
    2024# --reset command line option added 
     
    135139  This will set print quota soft limit to 500 pages and hard limit 
    136140  to 550 pages for groups financial and support on all printers. 
     141   
     142  $ edpykota --reset jerome  
     143   
     144  This will reset jerome's page counter to zero on all printers.  
     145  His life time page counter on each printer will be kept unchanged. 
    137146 
    138147This program is free software; you can redistribute it and/or modify 
     
    199208                softlimit = hardlimit 
    200209                self.logger.log_message("Undefined soft limit set to hard limit (%s) on printer %s." % (str(softlimit), printer)) 
    201             if (hardlimit is None) or (softlimit is None) :         
     210            if (not options["reset"]) and ((hardlimit is None) or (softlimit is None)) :         
    202211                raise PyKotaToolError, "Both hard and soft limits must be set ! Aborting." 
    203212            for name in names : 
     
    229238                else :     
    230239                    if options["users"] : 
    231                         self.storage.setUserPQuota(name, printer, softlimit, hardlimit) 
     240                        if (softlimit is not None) and (hardlimit is not None) : 
     241                            self.storage.setUserPQuota(name, printer, softlimit, hardlimit) 
    232242                        if options["reset"] : 
    233243                            self.storage.resetUserPQuota(name, printer) 
    234244                    else : 
    235                         self.storage.setGroupPQuota(name, printer, softlimit, hardlimit) 
     245                        if (softlimit is not None) and (hardlimit is not None) : 
     246                            self.storage.setGroupPQuota(name, printer, softlimit, hardlimit) 
    236247                        if options["reset"] : 
    237248                            self.storage.resetGroupPQuota(name, printer)