Changeset 2054 for pykota/trunk/pykota/reporter.py
- Timestamp:
- 02/13/05 23:02:29 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/reporter.py
r1692 r2054 22 22 # 23 23 # $Log$ 24 # Revision 1.11 2005/02/13 22:02:29 jalet 25 # Big database structure changes. Upgrade script is now included as well as 26 # the new LDAP schema. 27 # Introduction of the -o | --overcharge command line option to edpykota. 28 # The output of repykota is more complete, but doesn't fit in 80 columns anymore. 29 # Introduction of the new 'maxdenybanners' directive. 30 # 24 31 # Revision 1.10 2004/09/02 10:09:30 jalet 25 32 # Fixed bug in LDAP user deletion code which didn't correctly delete the user's … … 87 94 def getReportHeader(self) : 88 95 if self.isgroup : 89 return _("Group used soft hard balance grace total paid")96 return _("Group overcharge used soft hard balance grace total paid warn") 90 97 else : 91 return _("User used soft hard balance grace total paid")98 return _("User overcharge used soft hard balance grace total paid warn") 92 99 93 100 def getPrinterRealPageCounter(self, printer) : … … 109 116 balance = float(entry.AccountBalance or 0.0) 110 117 lifetimepaid = float(entry.LifeTimePaid or 0.0) 118 if not hasattr(entry, "OverCharge") : 119 overcharge = _("N/A") # Not available for groups 120 else : 121 overcharge = float(entry.OverCharge or 0.0) 122 if not hasattr(quota, "WarnCount") : 123 warncount = _("N/A") # Not available for groups 124 else : 125 warncount = int(quota.WarnCount or 0) 111 126 112 127 #balance … … 199 214 strbalance = ("%5.2f" % balance)[:10] 200 215 strlifetimepaid = ("%6.2f" % lifetimepaid)[:10] 201 return (lifepagecounter, lifetimepaid, entry.Name, reached, pagecounter, str(quota.SoftLimit), str(quota.HardLimit), strbalance, str(datelimit)[:10], lifepagecounter, strlifetimepaid) 216 strovercharge = ("%5s" % overcharge)[:5] 217 strwarncount = ("%4s" % warncount)[:4] 218 return (lifepagecounter, lifetimepaid, entry.Name, reached, \ 219 pagecounter, str(quota.SoftLimit), str(quota.HardLimit), \ 220 strbalance, str(datelimit)[:10], lifepagecounter, \ 221 strlifetimepaid, strovercharge, strwarncount) 202 222 203 223 def openReporter(tool, reporttype, printers, ugnames, isgroup) :