Changeset 733

Show
Ignore:
Timestamp:
02/07/03 09:34:16 (21 years ago)
Author:
jalet
Message:

Test wrt date limit was wrong

Location:
pykota/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/repykota

    r732 r733  
    1717# 
    1818# $Log$ 
     19# Revision 1.4  2003/02/07 08:34:15  jalet 
     20# Test wrt date limit was wrong 
     21# 
    1922# Revision 1.3  2003/02/07 00:08:52  jalet 
    2023# Typos 
     
    9497            if options["users"] : 
    9598                print "User            used    soft    hard  grace" 
    96                 print "-----------------------------------------------------------" 
     99                print "------------------------------------------------" 
    97100                for name in self.storage.getPrinterUsers(printer) : 
    98101                    quota = self.storage.getUserPQuota(name, printer) 
     
    100103            else : 
    101104                print "Group           used    soft    hard  grace" 
    102                 print "-----------------------------------------------------------" 
     105                print "------------------------------------------------" 
    103106                for name in self.storage.getPrinterGroups(printer) : 
    104107                    quota = self.storage.getGroupPQuota(name, printer)  
     
    115118                now = DateTime.now() 
    116119                datelimit = DateTime.ISO.ParseDateTime(datelimit) 
    117                 if datelimit <= now : 
     120                if now >= datelimit : 
    118121                    datelimit = "DENY" 
    119122            else :     
    120123                datelimit = "" 
    121124            reached = ((pagecounter >= softlimit) and "+") or "-" 
    122             print "%-10.10s %c %7i %7i %7i %s" % (name, reached, pagecounter, softlimit, hardlimit, datelimit) 
     125            print "%-10.10s %c %7i %7i %7i %s" % (name, reached, pagecounter, softlimit, hardlimit, datelimit[:10]) 
    123126         
    124127                     
  • pykota/trunk/pykota/tool.py

    r729 r733  
    1515# 
    1616# $Log$ 
     17# Revision 1.13  2003/02/07 08:34:16  jalet 
     18# Test wrt date limit was wrong 
     19# 
    1720# Revision 1.12  2003/02/06 23:20:02  jalet 
    1821# warnpykota doesn't need any user/group name argument, mimicing the 
     
    177180    def checkUserPQuota(self, username, printername) : 
    178181        """Checks the user quota on a printer and deny or accept the job.""" 
    179         now = DateTime.now() 
    180182        quota = self.storage.getUserPQuota(username, printername) 
    181183        if quota is None : 
     
    199201                    action = "ALLOW" 
    200202                elif hardlimit is not None : 
    201                      gracedelay = self.config.getGraceDelay() 
    202203                     if softlimit <= pagecounter < hardlimit :     
     204                         now = DateTime.now() 
    203205                         if datelimit is None : 
    204                              datelimit = now + gracedelay 
     206                             datelimit = now + self.config.getGraceDelay() 
    205207                             self.storage.setDateLimit(username, printername, datelimit) 
    206                          if (now + gracedelay) < datelimit : 
     208                         if now < datelimit : 
    207209                             action = "WARN" 
    208210                         else :     
  • pykota/trunk/pykota/version.py

    r715 r733  
    1515# 
    1616 
    17 __version__ = "0.1-unofficial" 
     17__version__ = "0.9-unofficial" 
    1818 
    1919__doc__ = """PyKota : a complete Printing Quota Solution for CUPS."""