Index: pykota/trunk/pykota/accounters/stupid.py
===================================================================
--- pykota/trunk/pykota/accounters/stupid.py (revision 1203)
+++ pykota/trunk/pykota/accounters/stupid.py (revision 1239)
@@ -22,4 +22,7 @@
 #
 # $Log$
+# Revision 1.9  2003/12/27 15:43:36  uid67467
+# Savannah is back online...
+#
 # Revision 1.8  2003/11/23 19:01:37  jalet
 # Job price added to history
@@ -55,66 +58,4 @@
 
 class Accounter(AccounterBase) :
-    def beginJob(self) :    
-        """Saves the computed job size."""
-        self.JobSize = self.computeJobSize()
-        
-        # get last job information for this printer
-        if not printer.LastJob.Exists :
-            # The printer hasn't been used yet, from PyKota's point of view
-            self.LastPageCounter = 0
-        else :    
-            # get last job size and page counter from Quota Storage
-            # Last lifetime page counter before actual job is 
-            # last page counter + last job size
-            self.LastPageCounter = int(printer.LastJob.PrinterPageCounter or 0) + int(printer.LastJob.JobSize or 0)
-        
-    def endJob(self) :    
-        """Do nothing."""
-        pass
-        
-    def getJobSize(self) :    
-        """Returns the actual job size."""
-        try :
-            return self.JobSize
-        except AttributeError :    
-            return 0
-        
-    def doAccounting(self, printer, user) :
-        """Does print accounting by stupidly counting the 'showpage' postscript instructions in the document.
-        
-           This method is essentially unreliable, but shows how to create a simple accounter.
-        """
-        # first we log a message because using this accounting method is not recommended.
-        self.filter.logger.log_message(_("Using the 'stupid' accounting method is unreliable."), "warn")
-        
-        # get the job size    
-        jobsize = self.computeJobSize() * self.filter.copies
-            
-        # get last job information for this printer
-        if not printer.LastJob.Exists :
-            # The printer hasn't been used yet, from PyKota's point of view
-            counterbeforejob = 0
-        else :    
-            # get last job size and page counter from Quota Storage
-            # Last lifetime page counter before actual job is 
-            # last page counter + last job size
-            counterbeforejob = int(printer.LastJob.PrinterPageCounter or 0) + int(printer.LastJob.JobSize or 0)
-            
-        # Is the current user allowed to print at all ?
-        userpquota = self.filter.storage.getUserPQuota(user, printer)
-        action = self.filter.warnUserPQuota(userpquota)
-        
-        # update the quota for the current user on this printer, if allowed to print
-        if action == "DENY" :
-            jobsize = 0
-        else :    
-            userpquota.increasePagesUsage(jobsize)
-        
-        # adds the current job to history    
-        jobprice = (float(printer.PricePerPage or 0.0) * jobsize) + float(printer.PricePerJob or 0.0)
-        printer.addJobToHistory(self.filter.jobid, user, counterbeforejob, action, jobsize, jobprice, self.filter.preserveinputfile, self.filter.title, self.filter.copies, self.filter.options)
-            
-        return action
-        
     def computeJobSize(self) :    
         """Computes the job size and return its value.
@@ -122,4 +63,7 @@
            THIS METHOD IS COMPLETELY UNRELIABLE BUT SERVES AS AN EXAMPLE.
         """
+        # first we log a message because using this accounting method is not recommended.
+        self.filter.logger.log_message(_("Using the 'stupid' accounting method is unreliable."), "warn")
+        
         temporary = None    
         if self.filter.inputfile is None :    
@@ -146,5 +90,3 @@
         else :
             infile.close()
-            
         return pagecount    
-            
Index: pykota/trunk/pykota/accounters/external.py
===================================================================
--- pykota/trunk/pykota/accounters/external.py (revision 1203)
+++ pykota/trunk/pykota/accounters/external.py (revision 1239)
@@ -22,4 +22,7 @@
 #
 # $Log$
+# Revision 1.11  2003/12/27 15:43:36  uid67467
+# Savannah is back online...
+#
 # Revision 1.10  2003/11/23 19:01:36  jalet
 # Job price added to history
@@ -63,58 +66,4 @@
 
 class Accounter(AccounterBase) :
-    def beginJob(self, printer, user) :    
-        """Saves the computed job size."""
-        # computes job's size
-        self.JobSize = self.computeJobSize()
-        
-        # get last job information for this printer
-        if not printer.LastJob.Exists :
-            # The printer hasn't been used yet, from PyKota's point of view
-            self.LastPageCounter = 0
-        else :    
-            # get last job size and page counter from Quota Storage
-            # Last lifetime page counter before actual job is 
-            # last page counter + last job size
-            self.LastPageCounter = int(printer.LastJob.PrinterPageCounter or 0) + int(printer.LastJob.JobSize or 0)
-        
-    def endJob(self, printer, user) :    
-        """Do nothing."""
-        pass
-        
-    def getJobSize(self) :    
-        """Returns the actual job size."""
-        try :
-            return self.JobSize
-        except AttributeError :    
-            return 0
-        
-    def doAccounting(self, printer, user) :
-        """Deletgates the computation of the job size to an external command.
-        
-           The command must print the job size on its standard output and exit successfully.
-        """
-        self.beginJob(printer, user)
-        
-        # get the job size, which is real job size * number of copies.
-        jobsize = self.getJobSize() * self.filter.copies
-            
-        # Is the current user allowed to print at all ?
-        userpquota = self.filter.storage.getUserPQuota(user, printer)
-        action = self.filter.warnUserPQuota(userpquota)
-        
-        # update the quota for the current user on this printer, if allowed to print
-        if action == "DENY" :
-            jobsize = 0
-        else :    
-            userpquota.increasePagesUsage(jobsize)
-        
-        # adds the current job to history    
-        jobprice = (float(printer.PricePerPage or 0.0) * jobsize) + float(printer.PricePerJob or 0.0)
-        printer.addJobToHistory(self.filter.jobid, user, self.getLastPageCounter(), action, jobsize, jobprice, self.filter.preserveinputfile, self.filter.title, self.filter.copies, self.filter.options)
-        
-        self.endJob(printer, user)
-            
-        return action
-        
     def computeJobSize(self) :    
         """Feeds an external command with our datas to let it compute the job size, and return its value."""
@@ -181,5 +130,4 @@
         else :
             infile.close()
-            
         return pagecount    
             
Index: pykota/trunk/pykota/accounters/querying.py
===================================================================
--- pykota/trunk/pykota/accounters/querying.py (revision 1200)
+++ pykota/trunk/pykota/accounters/querying.py (revision 1239)
@@ -22,4 +22,7 @@
 #
 # $Log$
+# Revision 1.9  2003/12/27 15:43:36  uid67467
+# Savannah is back online...
+#
 # Revision 1.8  2003/11/21 14:28:46  jalet
 # More complete job history.
@@ -182,5 +185,4 @@
         # adds the current job to history    
         printer.addJobToHistory(self.filter.jobid, user, counterbeforejob, action, filename=self.filter.preserveinputfile, title=self.filter.title, copies=self.filter.copies, options=self.filter.options)
-            
         return action
             
