Index: pykota/trunk/pykota/tool.py
===================================================================
--- pykota/trunk/pykota/tool.py (revision 1545)
+++ pykota/trunk/pykota/tool.py (revision 1546)
@@ -22,4 +22,7 @@
 #
 # $Log$
+# Revision 1.104  2004/06/18 13:34:49  jalet
+# Now all tracebacks include PyKota's version number
+#
 # Revision 1.103  2004/06/18 13:17:26  jalet
 # Now includes PyKota's version number in messages sent by the crashrecipient
@@ -411,4 +414,15 @@
     __str__ = __repr__
     
+def crashed(message) :    
+    """Minimal crash method."""
+    import traceback
+    lines = []
+    for line in traceback.format_exception(*sys.exc_info()) :
+        lines.extend([l for l in line.split("\n") if l])
+    msg = "ERROR: ".join(["%s\n" % l for l in (["ERROR: PyKota v%s" % version.__version__, message] + lines)])
+    sys.stderr.write(msg)
+    sys.stderr.flush()
+    return msg
+
 class PyKotaTool :    
     """Base class for all PyKota command line tools."""
@@ -470,21 +484,17 @@
     def crashed(self, message) :    
         """Outputs a crash message, and optionally sends it to software author."""
-        import traceback
-        lines = []
-        for line in traceback.format_exception(*sys.exc_info()) :
-            lines.extend([l for l in line.split("\n") if l])
-        msg = "ERROR: ".join(["%s\n" % l for l in ([message] + lines)])
-        sys.stderr.write(msg)
-        sys.stderr.flush()
+        msg = crashed(message)
         try :
             crashrecipient = self.config.getCrashRecipient()
             if crashrecipient :
                 admin = self.config.getAdminMail("global") # Nice trick, isn't it ?
-                fullmessage = "========== Traceback for PyKota v%s :\n\n%s\n\n========== sys.argv :\n\n%s\n\n========== Environment :\n\n%s\n" % \
-                                (version.__version__, msg, \
+                fullmessage = "========== Traceback :\n\n%s\n\n========== sys.argv :\n\n%s\n\n========== Environment :\n\n%s\n" % \
+                                (msg, \
                                  "\n".join(["    %s" % repr(a) for a in sys.argv]), \
                                  "\n".join(["    %s=%s" % (k, v) for (k, v) in os.environ.items()]))
                 server = smtplib.SMTP(self.smtpserver)
-                server.sendmail(admin, [admin, crashrecipient], "From: %s\nTo: %s\nCc: %s\nSubject: PyKota crash traceback !\n\n%s" % (admin, crashrecipient, admin, fullmessage))
+                server.sendmail(admin, [admin, crashrecipient], \
+                                       "From: %s\nTo: %s\nCc: %s\nSubject: PyKota crash traceback !\n\n%s" % \
+                                       (admin, crashrecipient, admin, fullmessage))
                 server.quit()
         except :
Index: pykota/trunk/bin/warnpykota
===================================================================
--- pykota/trunk/bin/warnpykota (revision 1526)
+++ pykota/trunk/bin/warnpykota (revision 1546)
@@ -24,4 +24,7 @@
 #
 # $Log$
+# Revision 1.29  2004/06/18 13:34:49  jalet
+# Now all tracebacks include PyKota's version number
+#
 # Revision 1.28  2004/06/07 18:43:41  jalet
 # Fixed over-verbose exits when displaying help or version number
@@ -121,5 +124,5 @@
 
 from pykota import version
-from pykota.tool import PyKotaTool, PyKotaToolError
+from pykota.tool import PyKotaTool, PyKotaToolError, crashed
 from pykota.config import PyKotaConfigError
 from pykota.storage import PyKotaStorageError
@@ -261,5 +264,5 @@
             sender.crashed("warnpykota failed")
         except :    
-            pass
+            crashed("warnpykota failed")
         retcode = -1
         
Index: pykota/trunk/bin/edpykota
===================================================================
--- pykota/trunk/bin/edpykota (revision 1526)
+++ pykota/trunk/bin/edpykota (revision 1546)
@@ -24,4 +24,7 @@
 #
 # $Log$
+# Revision 1.75  2004/06/18 13:34:47  jalet
+# Now all tracebacks include PyKota's version number
+#
 # Revision 1.74  2004/06/07 18:43:40  jalet
 # Fixed over-verbose exits when displaying help or version number
@@ -267,5 +270,5 @@
 
 from pykota import version
-from pykota.tool import PyKotaTool, PyKotaToolError
+from pykota.tool import PyKotaTool, PyKotaToolError, crashed
 from pykota.config import PyKotaConfigError
 from pykota.storage import PyKotaStorageError
@@ -704,5 +707,5 @@
             editor.crashed("edpykota failed")
         except :    
-            pass
+            crashed("edpykota failed")
         retcode = -1
 
Index: pykota/trunk/bin/pkprinters
===================================================================
--- pykota/trunk/bin/pkprinters (revision 1526)
+++ pykota/trunk/bin/pkprinters (revision 1546)
@@ -24,4 +24,7 @@
 #
 # $Log$
+# Revision 1.11  2004/06/18 13:34:48  jalet
+# Now all tracebacks include PyKota's version number
+#
 # Revision 1.10  2004/06/07 18:43:40  jalet
 # Fixed over-verbose exits when displaying help or version number
@@ -63,5 +66,5 @@
 
 from pykota import version
-from pykota.tool import PyKotaTool, PyKotaToolError
+from pykota.tool import PyKotaTool, PyKotaToolError, crashed
 from pykota.config import PyKotaConfigError
 from pykota.storage import PyKotaStorageError
@@ -269,5 +272,5 @@
             manager.crashed("pkprinters failed")
         except :    
-            pass
+            crashed("pkprinters failed")
         retcode = -1
 
Index: pykota/trunk/bin/cupspykota
===================================================================
--- pykota/trunk/bin/cupspykota (revision 1542)
+++ pykota/trunk/bin/cupspykota (revision 1546)
@@ -24,4 +24,7 @@
 #
 # $Log$
+# Revision 1.64  2004/06/18 13:34:46  jalet
+# Now all tracebacks include PyKota's version number
+#
 # Revision 1.63  2004/06/17 13:26:50  jalet
 # Better exception handling code
@@ -252,5 +255,5 @@
 import time
 
-from pykota.tool import PyKotaFilterOrBackend, PyKotaToolError
+from pykota.tool import PyKotaFilterOrBackend, PyKotaToolError, crashed
 from pykota.config import PyKotaConfigError
 from pykota.storage import PyKotaStorageError
@@ -645,14 +648,4 @@
         return retcode    
     
-def crashed(message) :    
-    """Minimal crash method."""
-    import traceback
-    lines = []
-    for line in traceback.format_exception(*sys.exc_info()) :
-        lines.extend([l for l in line.split("\n") if l])
-    msg = "ERROR: ".join(["%s\n" % l for l in ([message] + lines)])
-    sys.stderr.write(msg)
-    sys.stderr.flush()
-
 if __name__ == "__main__" :    
     # This is a CUPS backend, we should act and die like a CUPS backend
Index: pykota/trunk/bin/pykotme
===================================================================
--- pykota/trunk/bin/pykotme (revision 1526)
+++ pykota/trunk/bin/pykotme (revision 1546)
@@ -24,4 +24,7 @@
 #
 # $Log$
+# Revision 1.12  2004/06/18 13:34:49  jalet
+# Now all tracebacks include PyKota's version number
+#
 # Revision 1.11  2004/06/07 18:43:40  jalet
 # Fixed over-verbose exits when displaying help or version number
@@ -72,5 +75,5 @@
 
 from pykota import version
-from pykota.tool import PyKotaTool, PyKotaToolError
+from pykota.tool import PyKotaTool, PyKotaToolError, crashed
 from pykota.config import PyKotaConfigError
 from pykota.storage import PyKotaStorageError
@@ -200,5 +203,5 @@
             sender.crashed("pykotme failed")
         except :    
-            pass
+            crashed("pykotme failed")
         retcode = -1
 
Index: pykota/trunk/bin/pkhint
===================================================================
--- pykota/trunk/bin/pkhint (revision 1526)
+++ pykota/trunk/bin/pkhint (revision 1546)
@@ -24,4 +24,7 @@
 #
 # $Log$
+# Revision 1.11  2004/06/18 13:34:48  jalet
+# Now all tracebacks include PyKota's version number
+#
 # Revision 1.10  2004/06/07 18:43:40  jalet
 # Fixed over-verbose exits when displaying help or version number
@@ -65,5 +68,5 @@
 
 from pykota import version
-from pykota.tool import PyKotaTool,PyKotaToolError
+from pykota.tool import PyKotaTool, PyKotaToolError, crashed
 from pykota.config import PyKotaConfigError
 from pykota.storage import PyKotaStorageError
@@ -280,5 +283,5 @@
             manager.crashed("pkhint failed")
         except :    
-            pass
+            crashed("pkhint failed")
         retcode = -1
 
Index: pykota/trunk/bin/repykota
===================================================================
--- pykota/trunk/bin/repykota (revision 1526)
+++ pykota/trunk/bin/repykota (revision 1546)
@@ -24,4 +24,7 @@
 #
 # $Log$
+# Revision 1.49  2004/06/18 13:34:49  jalet
+# Now all tracebacks include PyKota's version number
+#
 # Revision 1.48  2004/06/07 18:43:41  jalet
 # Fixed over-verbose exits when displaying help or version number
@@ -189,5 +192,5 @@
 
 from pykota import version
-from pykota.tool import PyKotaTool, PyKotaToolError
+from pykota.tool import PyKotaTool, PyKotaToolError, crashed
 from pykota.config import PyKotaConfigError
 from pykota.storage import PyKotaStorageError
@@ -322,5 +325,5 @@
             reportTool.crashed("repykota failed")
         except :    
-            pass
+            crashed("repykota failed")
         retcode = -1
 
Index: pykota/trunk/NEWS
===================================================================
--- pykota/trunk/NEWS (revision 1545)
+++ pykota/trunk/NEWS (revision 1546)
@@ -24,6 +24,5 @@
     - 1.19alpha23 :
     
-        - Messages sent by the crashrecipient directive now include
-          PyKota's version number.
+        - All tracebacks now include PyKota's version number.
           
     - 1.19alpha22 :
