Show
Ignore:
Timestamp:
02/09/03 00:17:20 (21 years ago)
Author:
jalet
Message:

repykota now outputs life time page counters and the total pages printed by
all users/groups on each printer.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/repykota

    r752 r770  
    1717# 
    1818# $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# 
    1923# Revision 1.6  2003/02/07 23:39:16  jalet 
    2024# Typos 
     
    102106            print "*** Report for %s quota on printer %s" % ((options["users"] and "user") or "group", printer) 
    103107            print "Pages grace time: %idays" % self.config.getGraceDelay() 
     108            total = 0 
    104109            if options["users"] : 
    105                 print "User            used    soft    hard  grace" 
    106                 print "-----------------------------------------------" 
     110                print "User             used     soft     hard   grace        total" 
     111                print "------------------------------------------------------------" 
    107112                for name in self.storage.getPrinterUsers(printer) : 
    108113                    quota = self.storage.getUserPQuota(name, printer) 
    109                     self.printQuota(name, quota) 
     114                    total += self.printQuota(name, quota) 
    110115            else : 
    111                 print "Group           used    soft    hard  grace" 
    112                 print "-----------------------------------------------" 
     116                print "Group            used     soft     hard   grace        total" 
     117                print "------------------------------------------------------------" 
    113118                for name in self.storage.getPrinterGroups(printer) : 
    114119                    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) 
    116123            print         
    117124                         
     
    119126        """Prints the quota information.""" 
    120127        if quota is not None : 
     128            lifepagecounter = quota["lifepagecounter"] 
    121129            pagecounter = quota["pagecounter"] 
    122130            softlimit = quota["softlimit"] or 0 
     
    131139                datelimit = "" 
    132140            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 
    134143         
    135144