Changeset 909 for pykota/trunk/bin

Show
Ignore:
Timestamp:
04/12/03 19:20:14 (22 years ago)
Author:
jalet
Message:

Better formula for HP workaround

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pykota

    r908 r909  
    2323# 
    2424# $Log$ 
     25# Revision 1.21  2003/04/12 17:20:14  jalet 
     26# Better formula for HP workaround 
     27# 
    2528# Revision 1.20  2003/04/12 16:58:28  jalet 
    2629# The workaround for HP printers was not correct, and there's probably no 
     
    219222                # its primary counter is only saved in a 10 increment, so 
    220223                # it may be lower than the last page counter saved in the 
    221                 # Quota Storage. We unconditionnally set 5 (five) pages 
    222                 # as the last job's size. This is a mean. For more accurate 
    223                 # accounting, don't switch off your HP printers ! 
     224                # Quota Storage.  
     225                # We unconditionnally set the last job's size to  
     226                # abs(int((10 - abs(lastcounter(snmp) - lastcounter(storage)) / 2)) 
     227                # For more accurate accounting, don't switch off your HP printers ! 
    224228                # explanation at : http://web.mit.edu/source/third/lprng/doc/LPRng-HOWTO-15.html 
    225229                kotafilter.logger.log_message(_("Error in page count value %i for user %s on printer %s") % (jobsize, lastusername, kotafilter.printername), "error") 
    226                 jobsize = 5     # Workaround for HP printers' feature ! 
     230                jobsize = abs(int((10 - abs(jobsize)) / 2))     # Workaround for HP printers' feature ! 
    227231                 
    228232            # update the quota for the previous user on this printer