Index: /pykota/trunk/pykota/reporters/html.py
===================================================================
--- /pykota/trunk/pykota/reporters/html.py (revision 1236)
+++ /pykota/trunk/pykota/reporters/html.py (revision 1239)
@@ -22,4 +22,7 @@
 #
 # $Log$
+# Revision 1.2  2003/12/27 15:43:36  uid67467
+# Savannah is back online...
+#
 # Revision 1.1  2003/12/02 14:41:17  jalet
 # And as always, I forgot most of the new files :-)
@@ -38,19 +41,25 @@
         self.report = []
         for printer in self.printers :
-            self.report.append("<h1>%s</h1>" % self.getPrinterTitle(printer))
-            self.report.append("<h2>%s</h2>" % self.getPrinterGraceDelay(printer))
+            self.report.append('<h2 class="printername">%s</h2>' % self.getPrinterTitle(printer))
+            self.report.append('<h3 class="printergracedelay">%s</h3>' % self.getPrinterGraceDelay(printer))
             (pjob, ppage) = self.getPrinterPrices(printer)
-            self.report.append("<h3>%s</h3>" % pjob)
-            self.report.append("<h3>%s</h3>" % ppage)
+            self.report.append('<h4 class="priceperjob">%s</h4>' % pjob)
+            self.report.append('<h4 class="priceperpage">%s</h4>' % ppage)
             total = 0
             totalmoney = 0.0
-            self.report.append('<table border="1">')
+            self.report.append('<table class="pykotatable" border="1">')
             headers = self.getReportHeader().split()
-	    headers.insert(1, "LimitBy")
-            self.report.append('<tr bgcolor="gold">%s</tr>' % "".join(["<th>%s</th>" % h for h in headers]))
+            headers.insert(1, "LimitBy")
+            self.report.append('<tr class="pykotacolsheader">%s</tr>' % "".join(["<th>%s</th>" % h for h in headers]))
+            oddeven = 0
             if self.isgroup :
                 for (group, grouppquota) in self.tool.storage.getPrinterGroupsAndQuotas(printer, self.ugnames) :
+                    oddeven += 1
+                    if oddeven % 1 :
+                        oddevenclass = "odd"
+                    else :    
+                        oddevenclass = "even"
                     (pages, money, name, reached, soft, hard, balance, datelimit, lifepagecounter, lifetimepaid) = self.getQuota(group, grouppquota)
-                    self.report.append("<tr>%s</tr>" % "".join(["<td>%s</td>" % h for h in (name, reached, pagecounter, soft, hard, balance, datelimit or "&nbsp;", lifepagecounter, lifetimepaid)]))
+                    self.report.append('<tr class="%s">%s</tr>' % (oddevenclass, "".join(["<td>%s</td>" % h for h in (name, reached, pagecounter, soft, hard, balance, datelimit or "&nbsp;", lifepagecounter, lifetimepaid)])))
                     total += pages
                     totalmoney += money
@@ -58,15 +67,20 @@
                 # default is user quota report
                 for (user, userpquota) in self.tool.storage.getPrinterUsersAndQuotas(printer, self.ugnames) :
+                    oddeven += 1
+                    if oddeven % 1 :
+                        oddevenclass = "odd"
+                    else :    
+                        oddevenclass = "even"
                     (pages, money, name, reached, pagecounter, soft, hard, balance, datelimit, lifepagecounter, lifetimepaid) = self.getQuota(user, userpquota)
-                    self.report.append("<tr>%s</tr>" % "".join(["<td>%s</td>" % h for h in (name, reached, pagecounter, soft, hard, balance, datelimit or "&nbsp;", lifepagecounter, lifetimepaid)]))
+                    self.report.append('<tr class="%s">%s</tr>' % (oddevenclass, "".join(["<td>%s</td>" % h for h in (name, reached, pagecounter, soft, hard, balance, datelimit or "&nbsp;", lifepagecounter, lifetimepaid)])))
                     total += pages
                     totalmoney += money
             if total or totalmoney :        
                 (tpage, tmoney) = self.getTotals(total, totalmoney)
-                self.report.append('<tr><td colspan="7">&nbsp;</td><td align="right">%s</td><td align="right">%s</td></tr>' % (tpage, tmoney))
-            self.report.append('<tr><td colspan="7">&nbsp;</td><td align="right">%s</td></tr>' % self.getPrinterRealPageCounter(printer))
+                self.report.append('<tr class="totals"><td colspan="7">&nbsp;</td><td align="right">%s</td><td align="right">%s</td></tr>' % (tpage, tmoney))
+            self.report.append('<tr class="realpagecounter"><td colspan="7">&nbsp;</td><td align="right">%s</td></tr>' % self.getPrinterRealPageCounter(printer))
             self.report.append('</table>')
         if self.isgroup :    
-            self.report.append("<p>%s</p>" % _("Totals may be inaccurate if some users are members of several groups."))
+            self.report.append('<p class="warning">%s</p>' % _("Totals may be inaccurate if some users are members of several groups."))
         return "\n".join(self.report)    
                         
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
             
Index: /pykota/trunk/pykota/reporter.py
===================================================================
--- /pykota/trunk/pykota/reporter.py (revision 1235)
+++ /pykota/trunk/pykota/reporter.py (revision 1239)
@@ -22,4 +22,7 @@
 #
 # $Log$
+# Revision 1.5  2003/12/27 15:43:36  uid67467
+# Savannah is back online...
+#
 # Revision 1.4  2003/12/02 14:40:21  jalet
 # Some code refactoring.
@@ -58,5 +61,5 @@
         
     def getPrinterTitle(self, printer) :     
-        return _("*** Report for %s quota on printer %s") % ((self.isgroup and "group") or "user", printer.Name)
+        return _("Report for %s quota on printer %s") % ((self.isgroup and "group") or "user", printer.Name)
         
     def getPrinterGraceDelay(self, printer) :    
Index: /pykota/trunk/pykota/accounter.py
===================================================================
--- /pykota/trunk/pykota/accounter.py (revision 1219)
+++ /pykota/trunk/pykota/accounter.py (revision 1239)
@@ -22,4 +22,7 @@
 #
 # $Log$
+# Revision 1.8  2003/12/27 15:43:36  uid67467
+# Savannah is back online...
+#
 # Revision 1.7  2003/11/25 23:46:40  jalet
 # Don't try to verify if module name is valid, Python does this better than us.
@@ -89,7 +92,55 @@
             infile.close()
             
-    def doAccounting(self, printer, user) :    
-        """Does the real accounting."""
-        raise PyKotaAccounterError, "Accounter not implemented !"
+    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 openAccounter(kotafilter) :
Index: /pykota/trunk/pykota/version.py
===================================================================
--- /pykota/trunk/pykota/version.py (revision 1227)
+++ /pykota/trunk/pykota/version.py (revision 1239)
@@ -22,5 +22,5 @@
 #
 
-__version__ = "1.16alpha16_unofficial"
+__version__ = "1.16alpha17_unofficial"
 
 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""
Index: /pykota/trunk/cgi-bin/printquota.cgi
===================================================================
--- /pykota/trunk/cgi-bin/printquota.cgi (revision 1235)
+++ /pykota/trunk/cgi-bin/printquota.cgi (revision 1239)
@@ -1,3 +1,3 @@
-#! /usr/bin/python
+#! /usr/bin/python2.2
 
 # PyKota Print Quota Reports generator
@@ -23,4 +23,7 @@
 #
 # $Log$
+# Revision 1.17  2003/12/27 15:43:36  uid67467
+# Savannah is back online...
+#
 # Revision 1.16  2003/12/02 14:40:20  jalet
 # Some code refactoring.
@@ -91,4 +94,5 @@
   <head>
     <title>PyKota Reports</title>
+    <link rel="stylesheet" type="text/css" href="pykota.css" />
   </head>
   <body>
@@ -104,5 +108,5 @@
           </td>
           <td colspan="2">
-            <h2>PyKota Reports</h2>
+            <h1>PyKota Reports</h1>
           </td>
         </tr>
Index: /pykota/trunk/NEWS
===================================================================
--- /pykota/trunk/NEWS (revision 1235)
+++ /pykota/trunk/NEWS (revision 1239)
@@ -22,5 +22,11 @@
 PyKota NEWS :
 
-    - 1.16alpah16 :
+    - 1.16alpha17 :
+    
+        - Added portugues translation.
+        
+        - Major code refactoring in accounters.
+        
+    - 1.16alpha16 :
     
         - Code refactoring, and addition of a real HTML reporter, to 
Index: /pykota/trunk/po/en/pykota.po
===================================================================
--- /pykota/trunk/po/en/pykota.po (revision 1192)
+++ /pykota/trunk/po/en/pykota.po (revision 1239)
@@ -21,4 +21,7 @@
 #
 # $Log$
+# Revision 1.37  2003/12/27 15:43:36  uid67467
+# Savannah is back online...
+#
 # Revision 1.36  2003/11/18 23:43:11  jalet
 # Mailto can be any external command now, as usual.
@@ -206,5 +209,5 @@
 msgstr ""
 
-msgid "*** Report for %s quota on printer %s"
+msgid "Report for %s quota on printer %s"
 msgstr ""
 
Index: /pykota/trunk/po/es/pykota.po
===================================================================
--- /pykota/trunk/po/es/pykota.po (revision 1238)
+++ /pykota/trunk/po/es/pykota.po (revision 1239)
@@ -21,4 +21,7 @@
 #
 # $Log$
+# Revision 1.5  2003/12/27 15:43:36  uid67467
+# Savannah is back online...
+#
 # Revision 1.4  2003/12/03 18:51:09  jalet
 # Fixed spanish translation
@@ -91,6 +94,6 @@
 msgstr "Impresora %s no encontrada"
 
-msgid "*** Report for %s quota on printer %s"
-msgstr "*** Reporte para la cuota %s en la impresora  %s"
+msgid "Report for %s quota on printer %s"
+msgstr "Reporte para la cuota %s en la impresora  %s"
 
 msgid "Error in page count value %i for user %s on printer %s"
Index: /pykota/trunk/po/fr/pykota.po
===================================================================
--- /pykota/trunk/po/fr/pykota.po (revision 1192)
+++ /pykota/trunk/po/fr/pykota.po (revision 1239)
@@ -21,4 +21,7 @@
 #
 # $Log$
+# Revision 1.36  2003/12/27 15:43:36  uid67467
+# Savannah is back online...
+#
 # Revision 1.35  2003/11/18 23:43:12  jalet
 # Mailto can be any external command now, as usual.
@@ -209,6 +212,6 @@
 msgstr "Aucune imprimante ne correspond �s"
 
-msgid "*** Report for %s quota on printer %s"
-msgstr "*** Rapport pour le quota %s sur l'imprimante %s"
+msgid "Report for %s quota on printer %s"
+msgstr "Rapport pour le quota %s sur l'imprimante %s"
 
 msgid "Error in page count value %i for user %s on printer %s"
Index: /pykota/trunk/po/pykota.pot
===================================================================
--- /pykota/trunk/po/pykota.pot (revision 1192)
+++ /pykota/trunk/po/pykota.pot (revision 1239)
@@ -21,4 +21,7 @@
 #
 # $Log$
+# Revision 1.37  2003/12/27 15:43:36  uid67467
+# Savannah is back online...
+#
 # Revision 1.36  2003/11/18 23:43:11  jalet
 # Mailto can be any external command now, as usual.
@@ -206,5 +209,5 @@
 msgstr ""
 
-msgid "*** Report for %s quota on printer %s"
+msgid "Report for %s quota on printer %s"
 msgstr ""
 
