Changeset 1240 for pykota/trunk/pykota/reporter.py
- Timestamp:
- 12/27/03 17:49:25 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/reporter.py
r1239 r1240 22 22 # 23 23 # $Log$ 24 # Revision 1. 5 2003/12/27 15:43:36uid6746725 # S avannah is back online...24 # Revision 1.6 2003/12/27 16:49:25 uid67467 25 # Should be ok now. 26 26 # 27 27 # Revision 1.4 2003/12/02 14:40:21 jalet … … 41 41 # 42 42 # 43 44 from mx import DateTime 43 45 44 46 class PyKotaReporterError(Exception): … … 96 98 datelimit = "DENY" 97 99 reached = "+B" 100 elif balance <= self.tool.config.getPoorMan() : 101 datelimit = "WARNING" 102 reached = "?B" 98 103 else : 99 104 datelimit = "" 100 105 reached = "-B" 101 106 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 : 103 112 now = DateTime.now() 104 113 datelimit = DateTime.ISO.ParseDateTime(quota.DateLimit) 105 114 if now >= datelimit : 106 115 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"111 116 else : 112 117 datelimit = "" … … 124 129 raise PyKotaReporterError, _("Unsupported reporter backend %s") % reporttype 125 130 else : 126 return getattr(reporterbackend, "Reporter")(tool, printers, ugnames, isgroup)131 return reporterbackend.Reporter(tool, printers, ugnames, isgroup)