Index: pykota/trunk/bin/edpykota
===================================================================
--- pykota/trunk/bin/edpykota (revision 2789)
+++ pykota/trunk/bin/edpykota (revision 2829)
@@ -26,9 +26,7 @@
 
 import sys
-import os
-
-from pykota.tool import Percent, PyKotaTool, PyKotaToolError, PyKotaCommandLineError, crashed, N_
-from pykota.config import PyKotaConfigError
-from pykota.storage import PyKotaStorageError, StorageUserPQuota, StorageGroupPQuota
+
+from pykota.tool import Percent, PyKotaTool, PyKotaCommandLineError, crashed, N_
+from pykota.storage import StorageUserPQuota, StorageGroupPQuota
 
 __doc__ = N_("""edpykota v%(__version__)s (c) %(__years__)s %(__author__)s
Index: pykota/trunk/bin/pykotme
===================================================================
--- pykota/trunk/bin/pykotme (revision 2622)
+++ pykota/trunk/bin/pykotme (revision 2829)
@@ -29,5 +29,5 @@
 import pwd
 
-from pykota.tool import PyKotaTool, PyKotaToolError, PyKotaCommandLineError, crashed, N_
+from pykota.tool import PyKotaTool, PyKotaCommandLineError, crashed, N_
 
 try :
Index: pykota/trunk/bin/pkbcodes
===================================================================
--- pykota/trunk/bin/pkbcodes (revision 2789)
+++ pykota/trunk/bin/pkbcodes (revision 2829)
@@ -29,5 +29,5 @@
 import pwd
 
-from pykota.tool import Percent, PyKotaTool, PyKotaToolError, PyKotaCommandLineError, crashed, N_
+from pykota.tool import Percent, PyKotaTool, PyKotaCommandLineError, crashed, N_
 from pykota.storage import StorageBillingCode
 
Index: pykota/trunk/bin/pkusers
===================================================================
--- pykota/trunk/bin/pkusers (revision 2792)
+++ pykota/trunk/bin/pkusers (revision 2829)
@@ -25,10 +25,9 @@
 #
 
-import os
 import sys
 import pwd
 import grp
 
-from pykota.tool import Percent, PyKotaTool, PyKotaToolError, PyKotaCommandLineError, crashed, N_
+from pykota.tool import Percent, PyKotaTool, PyKotaCommandLineError, crashed, N_
 from pykota.storage import StorageUser, StorageGroup
 
Index: pykota/trunk/bin/pkturnkey
===================================================================
--- pykota/trunk/bin/pkturnkey (revision 2745)
+++ pykota/trunk/bin/pkturnkey (revision 2829)
@@ -223,5 +223,4 @@
         try :
             from pysnmp.asn1.encoding.ber.error import TypeMismatchError
-            from pysnmp.mapping.udp.error import SnmpOverUdpError
             from pysnmp.mapping.udp.role import Manager
             from pysnmp.proto.api import alpha
@@ -247,10 +246,10 @@
             tsp.close()
         
-        def handleAnswer(wholeMsg, notusedhere, req):
+        def handleAnswer(wholemsg, notusedhere, req):
             """Decodes and handles the SNMP answer."""
             ver = alpha.protoVersions[alpha.protoVersionId1]
             rsp = ver.Message()
             try :
-                rsp.berDecode(wholeMsg)
+                rsp.berDecode(wholemsg)
             except TypeMismatchError, msg :    
                 raise "No SNMP !"
@@ -364,5 +363,5 @@
         """Intializes PyKota's database."""
         if not self.config.isAdmin :
-            raise PyKotaCommandLineError, "%s : %s" % (pwd.getpwuid(os.geteuid())[0],\
+            raise PyKotaCommandLineError, "%s : %s" % (pwd.getpwuid(os.geteuid())[0], \
                                    _("You're not allowed to use this command."))
             
Index: pykota/trunk/bin/warnpykota
===================================================================
--- pykota/trunk/bin/warnpykota (revision 2692)
+++ pykota/trunk/bin/warnpykota (revision 2829)
@@ -29,7 +29,5 @@
 import pwd
 
-from pykota.tool import PyKotaTool, PyKotaToolError, PyKotaCommandLineError, crashed, N_
-from pykota.config import PyKotaConfigError
-from pykota.storage import PyKotaStorageError
+from pykota.tool import PyKotaTool, PyKotaCommandLineError, crashed, N_
 
 __doc__ = N_("""warnpykota v%(__version__)s (c) %(__years__)s %(__author__)s
Index: pykota/trunk/bin/pkprinters
===================================================================
--- pykota/trunk/bin/pkprinters (revision 2789)
+++ pykota/trunk/bin/pkprinters (revision 2829)
@@ -29,5 +29,5 @@
 import pwd
 
-from pykota.tool import Percent, PyKotaTool, PyKotaToolError, PyKotaCommandLineError, crashed, N_
+from pykota.tool import Percent, PyKotaTool, PyKotaCommandLineError, crashed, N_
 from pykota.storage import StoragePrinter
 
@@ -227,5 +227,5 @@
                         if self.isValidName(pname) :
                             printer = StoragePrinter(self.storage, pname)
-                            self.modifyPrinter(printer, charges, perpage, perjob,\
+                            self.modifyPrinter(printer, charges, perpage, perjob, \
                                            description, passthrough, \
                                            nopassthrough, maxjobsize)
Index: pykota/trunk/bin/cupspykota
===================================================================
--- pykota/trunk/bin/cupspykota (revision 2803)
+++ pykota/trunk/bin/cupspykota (revision 2829)
@@ -47,7 +47,7 @@
 from pykota.accounter import openAccounter
 from pykota.ipp import IPPRequest, IPPError
-from pykota.storage import PyKotaStorageError
         
 class FakeObject :        
+    """Fake object."""
     def __init__(self, name) :
         """Fake init."""
@@ -135,6 +135,6 @@
                 # see if the pid contained in the lock file is still running
                 os.kill(pid, 0)
-            except OSError, e :    
-                if e.errno != errno.EPERM :
+            except OSError, err :
+                if err.errno != errno.EPERM :
                     # process doesn't exist anymore
                     os.remove(lockfilename)
@@ -318,18 +318,21 @@
             self.regainPriv()                         
             inputfile = os.popen(jobticketcommand, "r")
-            for line in inputfile.xreadlines() :
-                line = line.strip()
-                if line in ("DENY", "AUTH=NO", "AUTH=IMPOSSIBLE") :
-                    self.logdebug("Seen %s command." % line)
-                    action = "DENY"
-                elif line == "CANCEL" :
-                    self.logdebug("Seen CANCEL command.")
-                    action = "CANCEL"
-                elif line.startswith("USERNAME=") :    
-                    username = line.split("=", 1)[1].strip()
-                    self.logdebug("Seen new username [%s]" % username)
-                elif line.startswith("BILLINGCODE=") :    
-                    billingcode = line.split("=", 1)[1].strip()
-                    self.logdebug("Seen new billing code [%s]" % billingcode)
+            try :
+                for line in inputfile.xreadlines() :
+                    line = line.strip()
+                    if line in ("DENY", "AUTH=NO", "AUTH=IMPOSSIBLE") :
+                        self.logdebug("Seen %s command." % line)
+                        action = "DENY"
+                    elif line == "CANCEL" :
+                        self.logdebug("Seen CANCEL command.")
+                        action = "CANCEL"
+                    elif line.startswith("USERNAME=") :    
+                        username = line.split("=", 1)[1].strip()
+                        self.logdebug("Seen new username [%s]" % username)
+                    elif line.startswith("BILLINGCODE=") :    
+                        billingcode = line.split("=", 1)[1].strip()
+                        self.logdebug("Seen new billing code [%s]" % billingcode)
+            except IOError, msg :            
+                self.logdebug("IOError while reading subprocess' output : %s" % msg)
             inputfile.close()    
             self.dropPriv()
@@ -452,4 +455,5 @@
         
         class DummyClass :
+            """Class used to avoid errors."""
             operation_attributes = {}
             job_attributes = {}
@@ -1254,6 +1258,6 @@
             wrapper.printInfo(_("Job %s interrupted by the administrator !") % wrapper.JobId, "warn")
             retcode = 0
-        except SystemExit, e :    
-            retcode = e.code
+        except SystemExit, err :    
+            retcode = err.code
         except :    
             try :
Index: pykota/trunk/bin/pknotify
===================================================================
--- pykota/trunk/bin/pknotify (revision 2825)
+++ pykota/trunk/bin/pknotify (revision 2829)
@@ -26,6 +26,4 @@
 
 import sys
-import os
-import popen2
 import socket
 import signal
@@ -39,5 +37,5 @@
     hasPAM = 1
 
-from pykota.tool import Tool, PyKotaToolError, PyKotaCommandLineError, crashed, N_
+from pykota.tool import Tool, PyKotaCommandLineError, crashed, N_
 
 __doc__ = N_("""pknotify v%(__version__)s (c) %(__years__)s %(__author__)s
Index: pykota/trunk/bin/pykosd
===================================================================
--- pykota/trunk/bin/pykosd (revision 2692)
+++ pykota/trunk/bin/pykosd (revision 2829)
@@ -79,4 +79,5 @@
 
 class PyKOSD(PyKotaTool) :
+    """A class for an On Screen Display print quota monitor."""
     def main(self, args, options) :
         """Main function starts here."""
Index: pykota/trunk/bin/pkmail
===================================================================
--- pykota/trunk/bin/pkmail (revision 2622)
+++ pykota/trunk/bin/pkmail (revision 2829)
@@ -31,5 +31,5 @@
 import email
 
-from pykota.tool import PyKotaTool, PyKotaToolError, PyKotaCommandLineError, crashed, N_
+from pykota.tool import PyKotaTool, PyKotaCommandLineError, crashed, N_
     
 __doc__ = N_("""pkmail v%(__version__)s (c) %(__years__)s %(__author__)s
Index: pykota/trunk/bin/dumpykota
===================================================================
--- pykota/trunk/bin/dumpykota (revision 2622)
+++ pykota/trunk/bin/dumpykota (revision 2829)
@@ -26,8 +26,6 @@
 
 import sys
-import os
 
-from pykota import version
-from pykota.tool import PyKotaToolError, PyKotaCommandLineError, crashed, N_
+from pykota.tool import PyKotaCommandLineError, crashed, N_
 from pykota.dumper import DumPyKota
 
