Show
Ignore:
Timestamp:
02/15/05 00:39:50 (19 years ago)
Author:
jalet
Message:

Introduces the new 'trustjobsize' directive to workaround some printers
generating unstable internal page counter values when queried through SNMP.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/lprngpykota

    r2060 r2062  
    2424# 
    2525# $Log$ 
     26# Revision 1.16  2005/02/14 23:39:50  jalet 
     27# Introduces the new 'trustjobsize' directive to workaround some printers 
     28# generating unstable internal page counter values when queried through SNMP. 
     29# 
    2630# Revision 1.15  2005/02/14 22:53:44  jalet 
    2731# Now always precomputes the job's size with the internal PDL parser, and not 
     
    254258            if self.softwareJobSize and (jobsize != self.softwareJobSize) : 
    255259                self.printInfo(_("Beware : computed job size (%s) != precomputed job size (%s)") % (jobsize, self.softwareJobSize), "error") 
     260                (limit, replacement) = self.config.getTrustJobSize(printer.Name) 
     261                if limit is None : 
     262                    self.printInfo(_("The job size will be trusted anyway according to the 'trustjobsize' directive"), "warn") 
     263                else : 
     264                    if jobsize <= limit : 
     265                        self.printInfo(_("The job size will be trusted because it is inferior to the 'trustjobsize' directive's limit %s") % limit, "warn") 
     266                    else : 
     267                        self.printInfo(_("The job size will be modified according to the 'trustjobsize' directive : %s") % replacement, "warn") 
     268                        if replacement == "PRECOMPUTED" : 
     269                            jobsize = self.softwareJobSize 
     270                        else :     
     271                            jobsize = replacement 
    256272             
    257273            self.printMoreInfo(user, printer, _("Job size : %i") % jobsize)