Changeset 3413 for pykota/trunk/pykota/reporters
- Timestamp:
- 09/27/08 22:02:37 (16 years ago)
- Location:
- pykota/trunk/pykota/reporters
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/reporters/html.py
r3411 r3413 8 8 # the Free Software Foundation, either version 3 of the License, or 9 9 # (at your option) any later version. 10 # 10 # 11 11 # This program is distributed in the hope that it will be useful, 12 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 # GNU General Public License for more details. 15 # 15 # 16 16 # You should have received a copy of the GNU General Public License 17 17 # along with this program. If not, see <http://www.gnu.org/licenses/>. … … 27 27 28 28 from pykota.reporter import BaseReporter 29 30 class Reporter(BaseReporter) : 29 30 class Reporter(BaseReporter) : 31 31 """HTML reporter.""" 32 32 def generateReport(self) : … … 35 35 if self.isgroup : 36 36 prefix = "Group" 37 else : 37 else : 38 38 prefix = "User" 39 39 for printer in self.printers : … … 55 55 if oddeven % 2 : 56 56 oddevenclass = "odd" 57 else : 57 else : 58 58 oddevenclass = "even" 59 59 (pages, money, name, reached, pagecounter, soft, hard, balance, datelimit, lifepagecounter, lifetimepaid, overcharge, warncount) = self.getQuota(entry, entrypquota) … … 61 61 if datelimit == "DENY" : 62 62 oddevenclass = "deny" 63 else : 63 else : 64 64 oddevenclass = "warn" 65 65 if (not self.tool.config.getDisableHistory()) and (not self.isgroup) : … … 68 68 total += pages 69 69 totalmoney += money 70 71 if total or totalmoney : 70 71 if total or totalmoney : 72 72 (tpage, tmoney) = self.getTotals(total, totalmoney) 73 73 self.report.append('<tr class="totals"><td colspan="8"> </td><td align="right">%s</td><td align="right">%s</td><td> </td></tr>' % (tpage, tmoney)) 74 74 self.report.append('<tr class="realpagecounter"><td colspan="8"> </td><td align="right">%s</td><td> </td></tr>' % self.getPrinterRealPageCounter(printer)) 75 75 self.report.append('</table>') 76 if self.isgroup : 76 if self.isgroup : 77 77 self.report.append('<p class="warning">%s</p>' % _("Totals may be inaccurate if some users are members of several groups.")) 78 return "\n".join(self.report) 79 78 return "\n".join(self.report) 79 -
pykota/trunk/pykota/reporters/__init__.py
r3411 r3413 8 8 # the Free Software Foundation, either version 3 of the License, or 9 9 # (at your option) any later version. 10 # 10 # 11 11 # This program is distributed in the hope that it will be useful, 12 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 # GNU General Public License for more details. 15 # 15 # 16 16 # You should have received a copy of the GNU General Public License 17 17 # along with this program. If not, see <http://www.gnu.org/licenses/>. -
pykota/trunk/pykota/reporters/text.py
r3411 r3413 8 8 # the Free Software Foundation, either version 3 of the License, or 9 9 # (at your option) any later version. 10 # 10 # 11 11 # This program is distributed in the hope that it will be useful, 12 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 # GNU General Public License for more details. 15 # 15 # 16 16 # You should have received a copy of the GNU General Public License 17 17 # along with this program. If not, see <http://www.gnu.org/licenses/>. … … 24 24 25 25 from pykota.reporter import BaseReporter 26 27 class Reporter(BaseReporter) : 26 27 class Reporter(BaseReporter) : 28 28 """Text reporter.""" 29 29 def generateReport(self) : … … 32 32 if self.isgroup : 33 33 prefix = "Group" 34 else : 34 else : 35 35 prefix = "User" 36 36 for printer in self.printers : … … 40 40 self.report.append(pjob) 41 41 self.report.append(ppage) 42 42 43 43 total = 0 44 44 totalmoney = 0.0 … … 51 51 total += pages 52 52 totalmoney += money 53 54 if total or totalmoney : 53 54 if total or totalmoney : 55 55 (tpage, tmoney) = self.getTotals(total, totalmoney) 56 56 self.report.append((" " * 62) + tpage + tmoney) 57 57 self.report.append((" " * 63) + self.getPrinterRealPageCounter(printer)) 58 self.report.append("") 59 if self.isgroup : 58 self.report.append("") 59 if self.isgroup : 60 60 self.report.append(_("Totals may be inaccurate if some users are members of several groups.")) 61 return "\n".join(self.report) 62 61 return "\n".join(self.report) 62