Show
Ignore:
Timestamp:
12/02/04 22:24:51 (19 years ago)
Author:
jalet
Message:

Integrated the patch by Wilson Roberto Afonso and Matt Hyclak to allow
edpykota to accept the -U | --used value command line option.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storage.py

    r1875 r1967  
    2222# 
    2323# $Log$ 
     24# Revision 1.66  2004/12/02 21:24:50  jalet 
     25# Integrated the patch by Wilson Roberto Afonso and Matt Hyclak to allow 
     26# edpykota to accept the -U | --used value command line option. 
     27# 
    2428# Revision 1.65  2004/10/25 14:12:25  jalet 
    2529# For URGENT legal reasons (Italy), a new "privacy" directive was added to pykota.conf 
     
    439443        self.DateLimit = None 
    440444         
     445    def setUsage(self, used) : 
     446        """Sets the PageCounter and LifePageCounter to used, or if used is + or - prefixed, changes the values of {Life,}PageCounter by that amount.""" 
     447        vused = int(used) 
     448        if used.startswith("+") or used.startswith("-") : 
     449           self.parent.increaseUserPQuotaPagesCounters(self, vused) 
     450           self.PageCounter += vused 
     451           self.LifePageCounter += vused 
     452        else : 
     453           self.parent.writeUserPQuotaPagesCounters(self, vused, vused) 
     454           self.PageCounter = self.LifePageCounter = vused 
     455 
    441456    def reset(self) :     
    442457        """Resets page counter to 0."""