Changeset 770
- Timestamp:
- 02/09/03 00:17:20 (22 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/repykota
r752 r770 17 17 # 18 18 # $Log$ 19 # Revision 1.7 2003/02/08 23:17:20 jalet 20 # repykota now outputs life time page counters and the total pages printed by 21 # all users/groups on each printer. 22 # 19 23 # Revision 1.6 2003/02/07 23:39:16 jalet 20 24 # Typos … … 102 106 print "*** Report for %s quota on printer %s" % ((options["users"] and "user") or "group", printer) 103 107 print "Pages grace time: %idays" % self.config.getGraceDelay() 108 total = 0 104 109 if options["users"] : 105 print "User used soft hard grace"106 print "----------------------------------------------- "110 print "User used soft hard grace total" 111 print "------------------------------------------------------------" 107 112 for name in self.storage.getPrinterUsers(printer) : 108 113 quota = self.storage.getUserPQuota(name, printer) 109 self.printQuota(name, quota)114 total += self.printQuota(name, quota) 110 115 else : 111 print "Group used soft hard grace"112 print "----------------------------------------------- "116 print "Group used soft hard grace total" 117 print "------------------------------------------------------------" 113 118 for name in self.storage.getPrinterGroups(printer) : 114 119 quota = self.storage.getGroupPQuota(name, printer) 115 self.printQuota(name, quota) 120 total += self.printQuota(name, quota) 121 if total : 122 print (" " * 43) + ("Total : %9i" % total) 116 123 print 117 124 … … 119 126 """Prints the quota information.""" 120 127 if quota is not None : 128 lifepagecounter = quota["lifepagecounter"] 121 129 pagecounter = quota["pagecounter"] 122 130 softlimit = quota["softlimit"] or 0 … … 131 139 datelimit = "" 132 140 reached = ((pagecounter >= softlimit) and "+") or "-" 133 print "%-10.10s %c %7i %7i %7i %s" % (name, reached, pagecounter, softlimit, hardlimit, str(datelimit)[:10]) 141 print "%-10.10s %c %8i %8i %8i %10s %9i" % (name, reached, pagecounter, softlimit, hardlimit, str(datelimit)[:10], lifepagecounter) 142 return lifepagecounter 134 143 135 144