Show
Ignore:
Timestamp:
08/31/07 09:27:44 (17 years ago)
Author:
jerome
Message:

Now the pykotme command line tool computes size and price based on the preaccounter
define for each printer instead of always using the internal page counter.
IMPORTANT : pykotme.cgi still uses the old behavior.

Location:
pykota/trunk/pykota/accounters
Files:
3 modified

Legend:

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

    r3162 r3245  
    3131 
    3232class Accounter(AccounterBase) : 
    33     def __init__(self, kotabackend, arguments, ispreaccounter=0) : 
     33    def __init__(self, kotabackend, arguments, ispreaccounter=0, name="hardware") : 
    3434        """Initializes querying accounter.""" 
    35         AccounterBase.__init__(self, kotabackend, arguments) 
     35        AccounterBase.__init__(self, kotabackend, arguments, ispreaccounter, name) 
    3636        self.isSoftware = 0 
    3737         
  • pykota/trunk/pykota/accounters/ink.py

    r3133 r3245  
    8787                        self.inkUsage.append(colordict)     
    8888                    jobsize = len(pages) 
    89                     if self.filter.InputFile is not None : 
    90                         # when a filename is passed as an argument, the backend  
    91                         # must generate the correct number of copies. 
    92                         jobsize *= self.filter.Copies 
    93                         self.inkUsage *= self.filter.Copies 
     89                    try : 
     90                        if self.filter.InputFile is not None : 
     91                            # when a filename is passed as an argument, the backend  
     92                            # must generate the correct number of copies. 
     93                            jobsize *= self.filter.Copies 
     94                            self.inkUsage *= self.filter.Copies 
     95                    except AttributeError : # When not run from the cupspykota backend  
     96                        pass 
    9497                    self.filter.logdebug("Ink usage : %s ===> %s" % (cspace, repr(self.inkUsage))) 
    9598        return jobsize         
  • pykota/trunk/pykota/accounters/software.py

    r3133 r3245  
    6666                    self.filter.printInfo(_("Unable to precompute the job's size with the generic PDL analyzer : %s") % msg, "warn") 
    6767                else :     
    68                     if self.filter.InputFile is not None : 
    69                         # when a filename is passed as an argument, the backend  
    70                         # must generate the correct number of copies. 
    71                         jobsize *= self.filter.Copies 
     68                    try : 
     69                        if self.filter.InputFile is not None : 
     70                            # when a filename is passed as an argument, the backend  
     71                            # must generate the correct number of copies. 
     72                            jobsize *= self.filter.Copies 
     73                    except AttributeError : # When not run from the cupspykota backend         
     74                        pass 
    7275                infile.close()         
    7376        return jobsize