Index: pykota/trunk/bin/edpykota
===================================================================
--- pykota/trunk/bin/edpykota (revision 1546)
+++ pykota/trunk/bin/edpykota (revision 1584)
@@ -24,4 +24,7 @@
 #
 # $Log$
+# Revision 1.76  2004/07/01 19:56:40  jalet
+# Better dispatching of error messages
+#
 # Revision 1.75  2004/06/18 13:34:47  jalet
 # Now all tracebacks include PyKota's version number
@@ -463,5 +466,5 @@
             if (softlimit is not None) and (hardlimit is not None) and (hardlimit < softlimit) :        
                 # error, exchange them
-                self.logger.log_message(_("Hard limit %i is less than soft limit %i, values will be exchanged.") % (hardlimit, softlimit))
+                self.printInfo(_("Hard limit %i is less than soft limit %i, values will be exchanged.") % (hardlimit, softlimit))
                 (softlimit, hardlimit) = (hardlimit, softlimit)
             
@@ -541,10 +544,10 @@
                     protoquota = getattr(self.storage, "get%sPQuota" % suffix)(protoentry, printer)
                     if not protoquota.Exists :
-                        self.logger.log_message(_("Prototype %s not found in Quota Storage for printer %s.") % (protoentry.Name, printer.Name))
+                        self.printInfo(_("Prototype %s not found in Quota Storage for printer %s.") % (protoentry.Name, printer.Name))
                         continue    # skip this printer
                     else :    
                         (softlimit, hardlimit) = (protoquota.SoftLimit, protoquota.HardLimit)
                 else :        
-                    self.logger.log_message(_("Prototype object %s not found in Quota Storage.") % protoentry.Name)
+                    self.printInfo(_("Prototype object %s not found in Quota Storage.") % protoentry.Name)
                     
             if not options["noquota"] :    
@@ -552,9 +555,9 @@
                     hardlimit = softlimit
                     if hardlimit is not None :
-                        self.logger.log_message(_("Undefined hard limit set to soft limit (%s) on printer %s.") % (str(hardlimit), printer.Name))
+                        self.printInfo(_("Undefined hard limit set to soft limit (%s) on printer %s.") % (str(hardlimit), printer.Name))
                 if softlimit is None :    
                     softlimit = hardlimit
                     if softlimit is not None :
-                        self.logger.log_message(_("Undefined soft limit set to hard limit (%s) on printer %s.") % (str(softlimit), printer.Name))
+                        self.printInfo(_("Undefined soft limit set to hard limit (%s) on printer %s.") % (str(softlimit), printer.Name))
                         
             if options["add"] :    
@@ -568,5 +571,5 @@
                         (name, email) = splitname
                         if email and (email.count('@') != 1) :
-                            self.logger.log_message(_("Invalid email address %s") % email)
+                            self.printInfo(_("Invalid email address %s") % email)
                             email = ""
                     entry = getattr(self.storage, "get%s" % suffix)(name)
@@ -595,7 +598,7 @@
                         else :    
                             if options["groups"] :
-                                self.logger.log_message(_("Invalid group name %s") % entry.Name)
+                                self.printInfo(_("Invalid group name %s") % entry.Name)
                             else :    
-                                self.logger.log_message(_("Invalid user name %s") % entry.Name)
+                                self.printInfo(_("Invalid user name %s") % entry.Name)
                 elif options["delete"] :                
                     todelete[entry.Name] = entry
@@ -607,5 +610,5 @@
                         
                 if not entrypquota.Exists :     
-                    self.logger.log_message(_("Quota not found for object %s on printer %s.") % (entry.Name, printer.Name))
+                    self.printInfo(_("Quota not found for object %s on printer %s.") % (entry.Name, printer.Name))
                 else :    
                     if options["noquota"] or options["prototype"] or ((softlimit is not None) and (hardlimit is not None)) :
@@ -640,5 +643,5 @@
                                     changed[entry.Name]["ingroups"].append(groupname)
                                 else :
-                                    self.logger.log_message(_("Group %s not found in the PyKota Storage.") % groupname)
+                                    self.printInfo(_("Group %s not found in the PyKota Storage.") % groupname)
                                     
                     # This line disabled to prevent sending of unwanted email                 
Index: pykota/trunk/bin/pkprinters
===================================================================
--- pykota/trunk/bin/pkprinters (revision 1582)
+++ pykota/trunk/bin/pkprinters (revision 1584)
@@ -24,4 +24,7 @@
 #
 # $Log$
+# Revision 1.13  2004/07/01 19:56:41  jalet
+# Better dispatching of error messages
+#
 # Revision 1.12  2004/07/01 17:45:47  jalet
 # Added code to handle the description field for printers
@@ -197,7 +200,7 @@
                 if printer.Exists :
                     if options["skipexisting"] :
-                        self.printError(_("Printer %s already exists, skipping.") % printer.Name)
+                        self.printInfo(_("Printer %s already exists, skipping.") % printer.Name)
                     else :    
-                        self.printError(_("Printer %s already exists, will be modified.") % printer.Name)
+                        self.printInfo(_("Printer %s already exists, will be modified.") % printer.Name)
                         printers.append(printer)
                 else :
Index: pykota/trunk/bin/cupspykota
===================================================================
--- pykota/trunk/bin/cupspykota (revision 1562)
+++ pykota/trunk/bin/cupspykota (revision 1584)
@@ -24,4 +24,7 @@
 #
 # $Log$
+# Revision 1.66  2004/07/01 19:56:25  jalet
+# Better dispatching of error messages
+#
 # Revision 1.65  2004/06/22 09:31:17  jalet
 # Always send some debug info to CUPS' back channel stream (stderr) as
@@ -381,5 +384,5 @@
             # we deny the job in this case (nothing to print anyway)
             if not self.jobSizeBytes :
-                self.logger.log_message(_("Job contains no data. Printing is denied."), "warn")
+                self.printInfo(_("Job contains no data. Printing is denied."), "warn")
                 action = "DENY"
             
@@ -446,5 +449,5 @@
             pollobj.unregister(fileno)
         except KeyError :    
-            self.logger.log_message(_("File number %s unregistered twice from polling object, ignored.") % fileno, "warn")
+            self.printInfo(_("File number %s unregistered twice from polling object, ignored.") % fileno, "warn")
         except :    
             self.logdebug("Error while unregistering file number %s from polling object." % fileno)
@@ -471,6 +474,5 @@
     def sendBackChannelData(self, message) :    
         """Sends an informational message to CUPS via back channel stream (stderr)."""
-        sys.stderr.write("INFO: PyKota (PID %s) : %s\n" % (os.getpid(), message.strip()))
-        sys.stderr.flush()
+        self.printInfo("PyKota (PID %s) : %s" % (os.getpid(), message.strip()))
         
     def handleData(self) :                    
@@ -651,5 +653,5 @@
             retcode = os.WEXITSTATUS(status)
         elif not killed :    
-            self.logger.log_message(_("CUPS backend %s died abnormally.") % realbackend, "error")
+            self.printInfo(_("CUPS backend %s died abnormally.") % realbackend, "error")
             retcode = -1
         else :    
Index: pykota/trunk/bin/pykotme
===================================================================
--- pykota/trunk/bin/pykotme (revision 1546)
+++ pykota/trunk/bin/pykotme (revision 1584)
@@ -24,4 +24,7 @@
 #
 # $Log$
+# Revision 1.13  2004/07/01 19:56:42  jalet
+# Better dispatching of error messages
+#
 # Revision 1.12  2004/06/18 13:34:49  jalet
 # Now all tracebacks include PyKota's version number
@@ -151,6 +154,5 @@
                 totalsize += parser.getJobSize()
             except PDLAnalyzerError, msg :    
-                sys.stderr.write("%s\n" % msg)
-                sys.stderr.flush()
+                self.printInfo(msg)
             
         # get current user
Index: pykota/trunk/bin/pkhint
===================================================================
--- pykota/trunk/bin/pkhint (revision 1579)
+++ pykota/trunk/bin/pkhint (revision 1584)
@@ -24,4 +24,7 @@
 #
 # $Log$
+# Revision 1.14  2004/07/01 19:56:40  jalet
+# Better dispatching of error messages
+#
 # Revision 1.13  2004/06/29 07:55:18  jalet
 # Doesn't output the warning message when --help or --version is asked
@@ -226,5 +229,5 @@
                 device = self.extractDeviceFromURI(deviceuri)
                 if devicetype is None :
-                    sys.stderr.write("Unknown device %s for printer %s\n" % (device, printer))
+                    self.printInfo(_("Unknown device %s for printer %s") % (device, printer))
                 elif devicetype == "network" :
                     try :
@@ -245,10 +248,4 @@
                         else :    
                             configuration.append((printer, "software(/usr/bin/pkpgcounter)"))
-                # elif devicetype == "direct" : 
-                #    sys.stderr.write("Can't currently handle device %s for printer %s\n" % (device, printer))
-                #elif devicetype == "serial" : 
-                #    sys.stderr.write("Can't currently handle device %s for printer %s\n" % (device, printer))
-                #else :
-                #    sys.stderr.write("Can't currently handle device %s for printer %s\n" % (device, printer))
                 else :
                     configuration.append((printer, "software(/usr/bin/pkpgcounter)"))
