fixbot/logwatch/sources.py
changeset 64 8574aeff9b36
parent 63 a849c00b63f8
--- a/fixbot/logwatch/sources.py	Sat Feb 20 22:32:18 2010 +0200
+++ b/fixbot/logwatch/sources.py	Sat Feb 20 23:06:43 2010 +0200
@@ -37,6 +37,13 @@
         log.err(msg)
         self.module.error(msg)
 
+    def connectionLost (self, reason) :
+        """
+            The transport we were connected to has dropped, possibly as a result of our handlers raising an error?
+        """
+
+        self.handleError("lost LogSource for %s: %s" % (self.name, reason.getErrorMessage()))
+
     def handleData (self, data) :
         """
             Feed binary data into the buffer, processing all lines via handleLine()
@@ -109,6 +116,9 @@
             else :
                 raise ValueError(out)
 
+    def logPrefix (self) :
+        return "LogSource(%s)" % (self.name, )
+
 class File (LogSource, protocol.ProcessProtocol) :
     """
         Stream lines from a regular file using /usr/bin/tail -f
@@ -149,11 +159,7 @@
 
     def handleEOF (self) :
         self.handleError("!!! EOF on fifo %s, re-opening" % self.name)
-        self.reopen()
-    
-    def connectionLost (self, reason) :
-        super(Fifo, self).connectionLost(reason)
-        self.handleError("lost fifo for %s: %s" % (self.name, reason.getErrorMessage()))
+        self.reopen()    
 
 class UnixDatagramSocket (LogSource, protocol.DatagramProtocol) :
     """
@@ -180,6 +186,4 @@
         # handle it as a line of data
         self.handleLine(data)
 
-    def logPrefix (self) :
-        return "LogSource(%s)" % (self.name, )