Changeset 1272

Show
Ignore:
Timestamp:
01/12/04 00:43:31 (21 years ago)
Author:
jalet
Message:

Bug wrt number of copies with CUPS should be fixed.

Location:
pykota/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/NEWS

    r1271 r1272  
    2424    - 1.16alpha24 : 
    2525     
     26        - Bug wrt number of copies should be fixed. 
     27         
    2628        - Major code refactoring => It is now possible to 
    2729          automatically add printers on first print. 
  • pykota/trunk/pykota/accounter.py

    r1271 r1272  
    2222# 
    2323# $Log$ 
     24# Revision 1.12  2004/01/11 23:43:31  jalet 
     25# Bug wrt number of copies with CUPS should be fixed. 
     26# 
    2427# Revision 1.11  2004/01/11 23:22:42  jalet 
    2528# Major code refactoring, it's way cleaner, and now allows automated addition 
     
    8689        # computes job's size 
    8790        self.JobSize = self.computeJobSize() 
     91        if ((self.filter.printingsystem == "CUPS") \ 
     92            and (self.filter.preserveinputfile is not None)) \ 
     93            or (self.filter.printingsystem != "CUPS") : 
     94                self.JobSize *= self.filter.copies 
    8895         
    8996        # get last job information for this printer 
     
    109116         
    110117    def doAccounting(self, userpquota) : 
    111         """Delegates the computation of the job size to an external command. 
    112          
    113            The command must print the job size on its standard output and exit successfully. 
    114         """ 
     118        """Does accounting for current job.""" 
    115119        self.beginJob(userpquota) 
    116          
    117         # get the job size, which is real job size * number of copies. 
    118         # TODO : Double check with CUPS documentation : this is not always correct 
    119         jobsize = self.getJobSize() * self.filter.copies 
    120120             
    121121        # Is the current user allowed to print at all ? 
     
    126126            jobsize = 0 
    127127        else :     
     128            # get the job size 
     129            jobsize = self.getJobSize() 
    128130            userpquota.increasePagesUsage(jobsize) 
    129131