Changeset 3124

Show
Ignore:
Timestamp:
12/13/06 20:51:10 (17 years ago)
Author:
matt
Message:

If a job is cancelled (e.g. by pknotify/pykoticon), make printing start and end banners optional.

Location:
pykota/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r3123 r3124  
    827827                self.UserPQuota.incDenyBannerCounter() # increments the warning counter 
    828828                self.exportUserInfo() 
    829             getattr(self, "%sBanner" % bannertype)(withaccounting) 
     829            if (self.Action == 'CANCEL' and not self.config.getPrintCancelledBanners()) : 
     830                self.logdebug("Print job cancelled, not printing a banner.", "warn") 
     831            else : 
     832                getattr(self, "%sBanner" % bannertype)(withaccounting) 
    830833        self.logdebug("%s banner done." % bannertype.title()) 
    831834         
  • pykota/trunk/conf/pykota.conf.sample

    r3122 r3124  
    10461046 
    10471047 
     1048# If a job is cancelled, should any start or end banners still be printed 
     1049# 
     1050# This option can be set either globally or on a per printer basis. 
     1051# If set to yes, any defined banners will be printed 
     1052# If set to no, no banners will be printed 
     1053# 
     1054# This value defaults to yes 
     1055# printcancelledbanners: yes 
     1056 
     1057 
    10481058# StartingBanner : if defined will print a banner before the rest of the job  
    10491059# is printed. The argument can be a printable file, or an executable file. 
  • pykota/trunk/pykota/config.py

    r3035 r3124  
    439439        else :     
    440440            return value 
    441              
     441 
     442    def getPrintCancelledBanners(self, printername) : 
     443        """Returns 1 if a banner should be printed when a job is cancelled, else 0.""" 
     444        try : 
     445            return self.isTrue(self.getPrinterOption(printername, "printcancelledbanners")) 
     446        except PyKotaConfigError : 
     447            return 0 
     448              
    442449    def getGraceDelay(self, printername) :     
    443450        """Returns the grace delay in days."""