Changeset 2463 for pykota

Show
Ignore:
Timestamp:
09/19/05 09:08:55 (19 years ago)
Author:
jerome
Message:

Now honors the passthrough mode for printers (although it can't be set with pkprinters for now).
The output format for pkprinters --list has changed.
Severity : can be high if thrid party tools rely on the old pkprinters' output format.

Location:
pykota/trunk/bin
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r2455 r2463  
    822822        self.exportPhaseInfo("BEFORE") 
    823823         
     824        if self.Action != "DENY" :  
     825            if self.Printer.MaxJobSize and (self.softwareJobSize > self.Printer.MaxJobSize) : 
     826                # This printer was set to refuse jobs this large. 
     827                self.printInfo(_("Precomputed job size (%s pages) too large for printer %s.") % (self.softwareJobSize, self.PrinterName), "warn") 
     828                self.Action = "DENY" 
     829             
    824830        if self.Action != "DENY" : 
    825831            if self.User.LimitBy == "noprint" : 
     
    848854            if self.User.LimitBy in ('noquota', 'nochange') : 
    849855                self.logdebug("User %s is allowed to print with no limit, no need to check quota." % self.UserName) 
     856            elif self.Printer.PassThrough :     
     857                self.logdebug("Printer %s is in PassThrough mode, no need to check quota." % self.PrinterName) 
    850858            else : 
    851859                self.logdebug("Checking user %s print quota entry on printer %s" \ 
     
    920928            self.printInfo(_("Job size : %i") % self.JobSize) 
    921929             
    922             if self.User.LimitBy == "nochange" : 
     930            if (self.User.LimitBy == "nochange") or self.Printer.PassThrough : 
    923931                # no need to update the quota for the current user on this printer 
    924932                self.printInfo(_("User %s's quota on printer %s won't be modified") % (self.UserName, self.PrinterName)) 
  • pykota/trunk/bin/pkprinters

    r2344 r2463  
    169169                if parents :  
    170170                    parents = "%s %s" % (_("in"), parents) 
    171                 print "%s [%s] (%s + #*%s) %s" % \ 
     171                print "%s [%s] (%s + #*%s)" % \ 
    172172                      (printer.Name, printer.Description, printer.PricePerJob, \ 
    173                        printer.PricePerPage, parents) 
     173                       printer.PricePerPage) 
     174                print "    %s" % (_("Passthrough mode : %s") % ((printer.PassThrough and _("ON")) or _("OFF"))) 
     175                print "    %s" % (_("Maximum job size : %s") % ((printer.MaxJobSize and (_("%s pages") % printer.MaxJobSize)) or _("Unlimited"))) 
     176                if parents :        
     177                    print "    %s" % parents 
    174178            else :     
    175179                if options["charge"] :