Show
Ignore:
Timestamp:
11/15/04 23:01:34 (19 years ago)
Author:
jalet
Message:

Improved banner handling.
Fix for raw printing and banners.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r1918 r1923  
    2424# 
    2525# $Log$ 
     26# Revision 1.79  2004/11/15 22:01:34  jalet 
     27# Improved banner handling. 
     28# Fix for raw printing and banners. 
     29# 
    2630# Revision 1.78  2004/11/15 19:59:34  jalet 
    2731# PyKota banners now basically work ! 
     
    526530            self.printMoreInfo(user, printer, _("Job accounting ends.")) 
    527531                 
    528             # handle ending banner pages after accounting ends 
    529             if accountbanner in ["STARTING", "NONE"] : 
    530                 banner = self.endingBanner(printer.Name) 
    531                 if banner : 
    532                     self.logdebug("Printing ending banner after accounting ends.") 
    533                     self.handleData(banner) 
    534   
    535532            # retrieve the job size     
    536533            if action == "DENY" : 
     
    555552            # then re-export user information with new value 
    556553            self.exportUserInfo(userpquota) 
     554             
     555            # handle ending banner pages after accounting ends 
     556            if accountbanner in ["STARTING", "NONE"] : 
     557                banner = self.endingBanner(printer.Name) 
     558                if banner : 
     559                    self.logdebug("Printing ending banner after accounting ends.") 
     560                    self.handleData(banner) 
    557561             
    558562            # Launches the post hook 
     
    595599         
    596600        # And launch it 
    597         self.logdebug("Starting real backend %s with args %s" % (realbackend, " ".join(['"%s"' % a for a in ([os.environ["DEVICE_URI"]] + sys.argv[1:])]))) 
    598         subprocess = PyKotaPopen4([realbackend] + sys.argv[1:], bufsize=0, arg0=os.environ["DEVICE_URI"]) 
     601        if filehandle is None : 
     602            arguments = sys.argv 
     603        else :     
     604            # Here we absolutely WANT to remove any filename from the command line ! 
     605            arguments = [ "Fake this because we are printing a banner" ] + sys.argv[1:6] 
     606        self.logdebug("Starting real backend %s with args %s" % (realbackend, " ".join(['"%s"' % a for a in ([os.environ["DEVICE_URI"]] + arguments)]))) 
     607        subprocess = PyKotaPopen4([realbackend] + arguments, bufsize=0, arg0=os.environ["DEVICE_URI"]) 
    599608         
    600609        # Save file descriptors, we will need them later.