Show
Ignore:
Timestamp:
12/27/03 17:49:25 (20 years ago)
Author:
uid67467
Message:

Should be ok now.

Files:
1 modified

Legend:

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

    r1239 r1240  
    2222# 
    2323# $Log$ 
    24 # Revision 1.5  2003/12/27 15:43:36  uid67467 
    25 # Savannah is back online... 
     24# Revision 1.6  2003/12/27 16:49:25  uid67467 
     25# Should be ok now. 
    2626# 
    2727# Revision 1.4  2003/12/02 14:40:21  jalet 
     
    4141# 
    4242# 
     43 
     44from mx import DateTime 
    4345 
    4446class PyKotaReporterError(Exception): 
     
    9698                datelimit = "DENY" 
    9799                reached = "+B" 
     100            elif balance <= self.tool.config.getPoorMan() : 
     101                datelimit = "WARNING" 
     102                reached = "?B" 
    98103            else :     
    99104                datelimit = "" 
    100105                reached = "-B" 
    101106        else : 
    102             if quota.DateLimit is not None : 
     107            if (quota.HardLimit is not None) and (pagecounter >= quota.HardLimit) :     
     108                datelimit = "DENY" 
     109            elif (quota.HardLimit is None) and (quota.SoftLimit is not None) and (pagecounter >= quota.SoftLimit) : 
     110                datelimit = "DENY" 
     111            elif quota.DateLimit is not None : 
    103112                now = DateTime.now() 
    104113                datelimit = DateTime.ISO.ParseDateTime(quota.DateLimit) 
    105114                if now >= datelimit : 
    106115                    datelimit = "DENY" 
    107             elif (quota.HardLimit is not None) and (pagecounter >= quota.HardLimit) :     
    108                 datelimit = "DENY" 
    109             elif (quota.HardLimit is None) and (quota.SoftLimit is not None) and (pagecounter >= quota.SoftLimit) : 
    110                 datelimit = "DENY" 
    111116            else :     
    112117                datelimit = "" 
     
    124129        raise PyKotaReporterError, _("Unsupported reporter backend %s") % reporttype 
    125130    else :     
    126         return getattr(reporterbackend, "Reporter")(tool, printers, ugnames, isgroup) 
     131        return reporterbackend.Reporter(tool, printers, ugnames, isgroup)