Changeset 2414

Show
Ignore:
Timestamp:
09/01/05 01:16:48 (19 years ago)
Author:
jerome
Message:

Fixed banner accounting

Location:
pykota/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r2412 r2414  
    564564        self.logger.log_message(self.improveMessage(message), level) 
    565565     
    566     def startingBanner(self) : 
     566    def startingBanner(self, withaccounting) : 
    567567        """Retrieves a starting banner for current printer and returns its content.""" 
    568568        self.logdebug("Retrieving starting banner...") 
    569         self.printBanner(self.config.getStartingBanner(self.PrinterName)) 
     569        self.printBanner(self.config.getStartingBanner(self.PrinterName), withaccounting) 
    570570        self.logdebug("Starting banner retrieved.") 
    571571     
    572     def endingBanner(self) : 
     572    def endingBanner(self, withaccounting) : 
    573573        """Retrieves an ending banner for current printer and returns its content.""" 
    574574        self.logdebug("Retrieving ending banner...") 
    575         self.printBanner(self.config.getEndingBanner(self.PrinterName)) 
     575        self.printBanner(self.config.getEndingBanner(self.PrinterName), withaccounting) 
    576576        self.logdebug("Ending banner retrieved.") 
    577577         
    578     def printBanner(self, bannerfileorcommand) : 
     578    def printBanner(self, bannerfileorcommand, withaccounting) : 
    579579        """Reads a banner or generates one through an external command. 
    580580         
     
    597597                self.printInfo(_("Banner generator %s exit code is %s") \ 
    598598                                         % (bannerfileorcommand, str(status))) 
     599                if withaccounting : 
     600                    if self.accounter.isSoftware : 
     601                        self.BannerSize += 1 # TODO : fix this by passing the banner's content through software accounting 
    599602            else : 
    600603                self.logdebug("Using %s as the banner." % bannerfileorcommand) 
     
    607610                    self.runOriginalBackend(fh, isBanner=1) 
    608611                    fh.close() 
     612                    if withaccounting : 
     613                        if self.accounter.isSoftware : 
     614                            self.BannerSize += 1 # TODO : fix this by passing the banner's content through software accounting 
    609615        self.logdebug("Banner printed...") 
    610616                 
     
    627633                self.UserPQuota.incDenyBannerCounter() # increments the warning counter 
    628634                self.exportUserInfo() 
    629             getattr(self, "%sBanner" % bannertype)() 
    630             if withaccounting : 
    631                 if self.accounter.isSoftware : 
    632                     self.BannerSize += 1 # TODO : fix this by passing the banner's content through software accounting 
     635            getattr(self, "%sBanner" % bannertype)(withaccounting) 
    633636        self.logdebug("%s banner done." % bannertype.title()) 
    634637         
  • pykota/trunk/NEWS

    r2413 r2414  
    2424    - 1.23alpha23 : 
    2525     
     26        - Fixed a problem with banner accounting. 
     27     
    2628        - Introduction of the new 'pkturnkey' command line tool. 
    2729