Index: /pykota/trunk/pykota/loggers/system.py
===================================================================
--- /pykota/trunk/pykota/loggers/system.py (revision 952)
+++ /pykota/trunk/pykota/loggers/system.py (revision 1068)
@@ -21,4 +21,7 @@
 #
 # $Log$
+# Revision 1.7  2003/07/07 11:49:24  jalet
+# Lots of small fixes with the help of PyChecker
+#
 # Revision 1.6  2003/04/23 22:13:57  jalet
 # Preliminary support for LPRng added BUT STILL UNTESTED.
@@ -44,5 +47,4 @@
 #
 
-import sys
 import syslog
 
Index: /pykota/trunk/pykota/requesters/snmp.py
===================================================================
--- /pykota/trunk/pykota/requesters/snmp.py (revision 999)
+++ /pykota/trunk/pykota/requesters/snmp.py (revision 1068)
@@ -21,4 +21,7 @@
 #
 # $Log$
+# Revision 1.11  2003/07/07 11:49:24  jalet
+# Lots of small fixes with the help of PyChecker
+#
 # Revision 1.10  2003/05/22 12:56:06  jalet
 # Uses SNMP version 1 instead of version 2c by default, which is probably
@@ -66,5 +69,5 @@
 class Requester :
     """A class to send queries to printers via SNMP."""
-    def __init__(self, config, printername, arguments) :
+    def __init__(self, printername, arguments) :
         """Sets instance vars depending on the current printer."""
         self.printername = printername
Index: /pykota/trunk/pykota/requesters/external.py
===================================================================
--- /pykota/trunk/pykota/requesters/external.py (revision 952)
+++ /pykota/trunk/pykota/requesters/external.py (revision 1068)
@@ -21,4 +21,7 @@
 #
 # $Log$
+# Revision 1.8  2003/07/07 11:49:24  jalet
+# Lots of small fixes with the help of PyChecker
+#
 # Revision 1.7  2003/04/23 22:13:57  jalet
 # Preliminary support for LPRng added BUT STILL UNTESTED.
@@ -53,5 +56,5 @@
 class Requester :
     """A class to send queries to printers via external commands."""
-    def __init__(self, config, printername, arguments) :
+    def __init__(self, printername, arguments) :
         """Sets instance vars depending on the current printer."""
         self.printername = printername
Index: /pykota/trunk/pykota/tool.py
===================================================================
--- /pykota/trunk/pykota/tool.py (revision 1061)
+++ /pykota/trunk/pykota/tool.py (revision 1068)
@@ -21,4 +21,7 @@
 #
 # $Log$
+# Revision 1.44  2003/07/07 11:49:24  jalet
+# Lots of small fixes with the help of PyChecker
+#
 # Revision 1.43  2003/07/04 09:06:32  jalet
 # Small bug fix wrt undefined "LimitBy" field.
@@ -181,5 +184,4 @@
 
 import sys
-import os
 import fnmatch
 import getopt
@@ -458,5 +460,5 @@
         adminmail = self.config.getAdminMail(printer.Name)
         mailto = self.config.getMailTo(printer.Name)
-        action = self.checkGroupPQuota(grouppquota, printer)
+        action = self.checkGroupPQuota(grouppquota)
         if action.startswith("POLICY_") :
             action = action[7:]
Index: /pykota/trunk/pykota/reporters/text.py
===================================================================
--- /pykota/trunk/pykota/reporters/text.py (revision 1062)
+++ /pykota/trunk/pykota/reporters/text.py (revision 1068)
@@ -21,4 +21,7 @@
 #
 # $Log$
+# Revision 1.4  2003/07/07 11:49:24  jalet
+# Lots of small fixes with the help of PyChecker
+#
 # Revision 1.3  2003/07/05 07:46:50  jalet
 # The previous bug fix was incomplete.
@@ -32,6 +35,4 @@
 #
 #
-
-import sys
 
 from mx import DateTime
Index: /pykota/trunk/pykota/accounters/external.py
===================================================================
--- /pykota/trunk/pykota/accounters/external.py (revision 1041)
+++ /pykota/trunk/pykota/accounters/external.py (revision 1068)
@@ -21,4 +21,7 @@
 #
 # $Log$
+# Revision 1.5  2003/07/07 11:49:24  jalet
+# Lots of small fixes with the help of PyChecker
+#
 # Revision 1.4  2003/06/25 14:10:01  jalet
 # Hey, it may work (edpykota --reset excepted) !
@@ -88,7 +91,16 @@
             
         # launches external accounter
-        infilename = tempfile.mktemp()
-        outfilename = tempfile.mktemp()
-        errfilename = tempfile.mktemp()
+        try :
+            infilename = tempfile.mkstemp()     # Python 2.3
+        except AttributeError :    
+            infilename = tempfile.mktemp()
+        try :
+            outfilename = tempfile.mkstemp()    # Python 2.3
+        except AttributeError :    
+            outfilename = tempfile.mktemp()
+        try :
+            errfilename = tempfile.mkstemp()    # Python 2.3
+        except AttributeError :    
+            errfilename = tempfile.mktemp()
         
         try :
Index: /pykota/trunk/pykota/accounters/querying.py
===================================================================
--- /pykota/trunk/pykota/accounters/querying.py (revision 1041)
+++ /pykota/trunk/pykota/accounters/querying.py (revision 1068)
@@ -21,4 +21,7 @@
 #
 # $Log$
+# Revision 1.5  2003/07/07 11:49:24  jalet
+# Lots of small fixes with the help of PyChecker
+#
 # Revision 1.4  2003/06/25 14:10:01  jalet
 # Hey, it may work (edpykota --reset excepted) !
@@ -70,10 +73,8 @@
         if not printer.LastJob.Exists :
             # The printer hasn't been used yet, from PyKota's point of view
-            lastjob = None
             lastuser = user
             lastpagecounter = counterbeforejob
         else :    
             # get last values from Quota Storage
-            lastjob = printer.LastJob
             lastuser = printer.LastJob.User
             lastpagecounter = printer.LastJob.PrinterPageCounter
Index: /pykota/trunk/pykota/logger.py
===================================================================
--- /pykota/trunk/pykota/logger.py (revision 1021)
+++ /pykota/trunk/pykota/logger.py (revision 1068)
@@ -21,4 +21,7 @@
 #
 # $Log$
+# Revision 1.8  2003/07/07 11:49:24  jalet
+# Lots of small fixes with the help of PyChecker
+#
 # Revision 1.7  2003/06/10 16:37:54  jalet
 # Deletion of the second user which is not needed anymore.
@@ -50,6 +53,4 @@
 #
 
-import sys
-
 class PyKotaLoggingError(Exception):
     """An exception for logging related stuff."""
Index: /pykota/trunk/pykota/requester.py
===================================================================
--- /pykota/trunk/pykota/requester.py (revision 952)
+++ /pykota/trunk/pykota/requester.py (revision 1068)
@@ -21,4 +21,7 @@
 #
 # $Log$
+# Revision 1.8  2003/07/07 11:49:24  jalet
+# Lots of small fixes with the help of PyChecker
+#
 # Revision 1.7  2003/04/23 22:13:57  jalet
 # Preliminary support for LPRng added BUT STILL UNTESTED.
@@ -68,3 +71,3 @@
         raise PyKotaRequesterError, _("Unsupported requester backend %s") % backend
     else :    
-        return getattr(requesterbackend, "Requester")(config, printername, args)
+        return getattr(requesterbackend, "Requester")(printername, args)
Index: /pykota/trunk/pykota/storages/pgstorage.py
===================================================================
--- /pykota/trunk/pykota/storages/pgstorage.py (revision 1067)
+++ /pykota/trunk/pykota/storages/pgstorage.py (revision 1068)
@@ -21,4 +21,7 @@
 #
 # $Log$
+# Revision 1.6  2003/07/07 11:49:24  jalet
+# Lots of small fixes with the help of PyChecker
+#
 # Revision 1.5  2003/07/07 08:33:19  jalet
 # Bug fix due to a typo in LDAP code
@@ -126,4 +129,6 @@
         except pg.error, msg :    
             raise PyKotaStorageError, msg
+        else :    
+            return result
             
     def doQuote(self, field) :
@@ -329,8 +334,8 @@
     def addUserToGroup(self, user, group) :    
         """Adds an user to a group."""
-        result = self.doModify("SELECT COUNT(*) AS mexists FROM groupsmembers WHERE groupid=%s AND userid=%s" % (self.doQuote(group.ident), self.doQuote(user.ident)))
+        result = self.doSearch("SELECT COUNT(*) AS mexists FROM groupsmembers WHERE groupid=%s AND userid=%s" % (self.doQuote(group.ident), self.doQuote(user.ident)))
         try :
-            mexists = self.doParseResult(result)[0]["mexists"]
-        except TypeError :    
+            mexists = int(result[0].get("mexists"))
+        except (IndexError, TypeError) :    
             mexists = 0
         if not mexists :    
Index: /pykota/trunk/pykota/storages/ldapstorage.py
===================================================================
--- /pykota/trunk/pykota/storages/ldapstorage.py (revision 1067)
+++ /pykota/trunk/pykota/storages/ldapstorage.py (revision 1068)
@@ -21,4 +21,7 @@
 #
 # $Log$
+# Revision 1.15  2003/07/07 11:49:24  jalet
+# Lots of small fixes with the help of PyChecker
+#
 # Revision 1.14  2003/07/07 08:33:18  jalet
 # Bug fix due to a typo in LDAP code
@@ -425,5 +428,5 @@
             for (groupquotaid, fields) in result :
                 group = self.getGroup(fields.get("pykotaGroupName")[0])
-                if (names is None) or self.tool.matchString(user.Name, names) :
+                if (names is None) or self.tool.matchString(group.Name, names) :
                     grouppquota = self.getGroupPQuota(group, printer)
                     groupsandquotas.append((group, grouppquota))
Index: /pykota/trunk/pykota/config.py
===================================================================
--- /pykota/trunk/pykota/config.py (revision 1041)
+++ /pykota/trunk/pykota/config.py (revision 1068)
@@ -21,4 +21,7 @@
 #
 # $Log$
+# Revision 1.31  2003/07/07 11:49:24  jalet
+# Lots of small fixes with the help of PyChecker
+#
 # Revision 1.30  2003/06/25 14:10:01  jalet
 # Hey, it may work (edpykota --reset excepted) !
@@ -142,5 +145,4 @@
 #
 
-import sys
 import os
 import ConfigParser
Index: /pykota/trunk/pykota/version.py
===================================================================
--- /pykota/trunk/pykota/version.py (revision 1067)
+++ /pykota/trunk/pykota/version.py (revision 1068)
@@ -21,5 +21,5 @@
 #
 
-__version__ = "1.13alpha1_unofficial"
+__version__ = "1.13_unofficial"
 
 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""
Index: /pykota/trunk/NEWS
===================================================================
--- /pykota/trunk/NEWS (revision 1067)
+++ /pykota/trunk/NEWS (revision 1068)
@@ -22,4 +22,10 @@
 PyKota NEWS :
 
+    - 1.13 :
+    
+        - The whole module code was passed through PyChecker and
+          several small code inconsistencies were fixed,
+          as well as a bug in the groups code.
+          
     - 1.13alpha1 :
     
