log_source.py
changeset 64 cdb6403c2498
parent 63 416560b82116
child 65 8b50694f841e
--- a/log_source.py	Mon Feb 09 07:32:11 2009 +0200
+++ b/log_source.py	Mon Feb 09 11:05:53 2009 +0200
@@ -76,11 +76,11 @@
     
     def read_full (self) :
         """
-            Reads all LogLines
+            Reads all LogLines. The LogLines will have a valid offset
         """
         
         # just use our __iter__
-        return self.parser.parse_lines(self, self.start_date)
+        return self.parser.parse_lines(self, self.start_date, starting_offset=1)
 
     def read_from (self, dt) :
         """
@@ -368,7 +368,14 @@
 
         # if they're the same, just pull the full log for that date
         if d_begin == d_end :
-            return self._get_logfile_date(d_begin).read_full()
+            # open that log
+            logfile = self._get_logfile_date(d_begin)
+            
+            if not logfile :
+                raise Exception("No logfile for date=%r" % (dt, ))
+            
+            # return the full data
+            return logfile.read_full()
         
         # otherwise, we need to pull two partial logs
         else :