Changeset 3046

Show
Ignore:
Timestamp:
10/18/06 08:34:15 (18 years ago)
Author:
jerome
Message:

Fixed ink accounting when there are several copies.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/accounters/ink.py

    r3042 r3046  
    7272                    parser = analyzer.PDLAnalyzer(self.filter.DataFile, options) 
    7373                    (cspace, pages) = parser.getInkCoverage() 
     74                except pdlparser.PDLParserError, msg :     
     75                    # Here we just log the failure, but 
     76                    # we finally ignore it and return 0 since this 
     77                    # computation is just an indication of what the 
     78                    # job's size MAY be. 
     79                    self.filter.printInfo(_("Unable to precompute the job's size and ink coverage with the generic PDL analyzer : %s") % msg, "warn") 
     80                else :     
    7481                    cspacelabels = self.cspaceExpanded[cspace] 
    7582                    for page in pages : 
     
    7986                        self.inkUsage.append(colordict)     
    8087                    jobsize = len(pages) 
    81                     self.filter.logdebug("Ink usage : %s ===> %s" % (cspace, repr(self.inkUsage))) 
    82                 except pdlparser.PDLParserError, msg :     
    83                     # Here we just log the failure, but 
    84                     # we finally ignore it and return 0 since this 
    85                     # computation is just an indication of what the 
    86                     # job's size MAY be. 
    87                     self.filter.printInfo(_("Unable to precompute the job's size with the generic PDL analyzer : %s") % msg, "warn") 
    88                 else :     
    8988                    if self.filter.InputFile is not None : 
    9089                        # when a filename is passed as an argument, the backend  
    9190                        # must generate the correct number of copies. 
    9291                        jobsize *= self.filter.Copies 
     92                        self.inkUsage *= self.filter.Copies 
     93                    self.filter.logdebug("Ink usage : %s ===> %s" % (cspace, repr(self.inkUsage))) 
    9394        return jobsize