Index: /pykota/trunk/pykota/storages/sql.py
===================================================================
--- /pykota/trunk/pykota/storages/sql.py (revision 784)
+++ /pykota/trunk/pykota/storages/sql.py (revision 791)
@@ -15,4 +15,7 @@
 #
 # $Log$
+# Revision 1.18  2003/02/10 12:07:31  jalet
+# Now repykota should output the recorded total page number for each printer too.
+#
 # Revision 1.17  2003/02/10 08:41:36  jalet
 # edpykota's --reset command line option resets the limit date too.
@@ -77,15 +80,15 @@
 class SQLStorage :    
     def getMatchingPrinters(self, printerpattern) :
-        """Returns the list of all printer names which match a certain pattern."""
+        """Returns the list of all printers tuples (name, pagecounter) which match a certain pattern for the printer name."""
         printerslist = []
         # We 'could' do a SELECT printername FROM printers WHERE printername LIKE ...
         # but we don't because other storages semantics may be different, so every
         # storage should use fnmatch to match patterns and be storage agnostic
-        result = self.doQuery("SELECT printername FROM printers;")
+        result = self.doQuery("SELECT printername, pagecounter FROM printers;")
         result = self.doParseResult(result)
         if result is not None :
             for printer in result :
                 if fnmatch.fnmatchcase(printer["printername"], printerpattern) :
-                    printerslist.append(printer["printername"])
+                    printerslist.append((printer["printername"], printer["pagecounter"]))
         return printerslist        
             
@@ -96,5 +99,5 @@
     def getPrinterUsers(self, printername) :        
         """Returns the list of usernames which uses a given printer."""
-        result = self.doQuery("SELECT DISTINCT username FROM users WHERE id IN (SELECT userid FROM userpquota WHERE printerid IN (SELECT printerid FROM printers WHERE printername=%s));" % self.doQuote(printername))
+        result = self.doQuery("SELECT DISTINCT username FROM users WHERE id IN (SELECT userid FROM userpquota WHERE printerid IN (SELECT printerid FROM printers WHERE printername=%s)) ORDER BY username;" % self.doQuote(printername))
         result = self.doParseResult(result)
         if result is None :
Index: /pykota/trunk/pykota/storage.py
===================================================================
--- /pykota/trunk/pykota/storage.py (revision 773)
+++ /pykota/trunk/pykota/storage.py (revision 791)
@@ -15,4 +15,7 @@
 #
 # $Log$
+# Revision 1.7  2003/02/10 12:07:31  jalet
+# Now repykota should output the recorded total page number for each printer too.
+#
 # Revision 1.6  2003/02/09 13:05:43  jalet
 # Internationalization continues...
@@ -48,5 +51,5 @@
     """Base class for all storages."""
     def getMatchingPrinters(self, printerpattern) :
-        """Returns the list of all printer names which match a certain pattern."""
+        """Returns the list of all printers tuples (name, pagecounter) which match a certain pattern for the printer name."""
         pass
             
Index: /pykota/trunk/bin/warnpykota
===================================================================
--- /pykota/trunk/bin/warnpykota (revision 775)
+++ /pykota/trunk/bin/warnpykota (revision 791)
@@ -17,4 +17,7 @@
 #
 # $Log$
+# Revision 1.8  2003/02/10 12:07:30  jalet
+# Now repykota should output the recorded total page number for each printer too.
+#
 # Revision 1.7  2003/02/09 13:40:29  jalet
 # typo
@@ -107,5 +110,5 @@
         if not printernames :
             raise PyKotaToolError, _("There's no printer matching %s") % options["printer"]
-        for printer in printernames :
+        for (printer, printerpagecounter) in printernames :
             if options["users"] :
                 for name in self.storage.getPrinterUsers(printer) :
Index: /pykota/trunk/bin/edpykota
===================================================================
--- /pykota/trunk/bin/edpykota (revision 775)
+++ /pykota/trunk/bin/edpykota (revision 791)
@@ -17,4 +17,7 @@
 #
 # $Log$
+# Revision 1.20  2003/02/10 12:07:30  jalet
+# Now repykota should output the recorded total page number for each printer too.
+#
 # Revision 1.19  2003/02/09 13:40:29  jalet
 # typo
@@ -177,5 +180,5 @@
                 if self.isValidName(pname) :
                     self.storage.addPrinter(pname)
-                    printernames = [ pname ]
+                    printernames = [ (pname, 0) ]
                 else :    
                     raise PyKotaToolError, _("Invalid printer name %s") % pname
@@ -197,5 +200,5 @@
             self.logger.log_message(_("Hard limit %i is less than soft limit %i, values will be exchanged.") % (hardlimit, softlimit), "warn")
             (softlimit, hardlimit) = (hardlimit, softlimit)
-        for printer in printernames :
+        for (printer, printerpagecounter) in printernames :
             if options["prototype"] :
                 if options["users"] :
Index: /pykota/trunk/bin/repykota
===================================================================
--- /pykota/trunk/bin/repykota (revision 775)
+++ /pykota/trunk/bin/repykota (revision 791)
@@ -17,4 +17,7 @@
 #
 # $Log$
+# Revision 1.10  2003/02/10 12:07:30  jalet
+# Now repykota should output the recorded total page number for each printer too.
+#
 # Revision 1.9  2003/02/09 13:40:29  jalet
 # typo
@@ -109,5 +112,5 @@
         if not printernames :
             raise PyKotaToolError, _("There's no printer matching %s") % options["printer"]
-        for printer in printernames :
+        for (printer, printerpagecounter) in printernames :
             print _("*** Report for %s quota on printer %s") % ((options["users"] and "user") or "group", printer)
             print _("Pages grace time: %idays") % self.config.getGraceDelay()
@@ -127,4 +130,5 @@
             if total :        
                 print (" " * 43) + ("Total : %9i" % total)
+            print (" " * 44) + ("Real : %9i" % printerpagecounter)
             print        
                         
