Commits

Mark Roddy committed 74b2465

Added logs property and the ability to iterate over all log records to the PidginLogParser class.

Comments (0)

Files changed (1)

larvotto/convsrc.py

 """
 
 import os,re
+import itertools
 from datetime import datetime
 
 recordre=re.compile(r'^\((\d\d?\:\d\d\:\d\d(\s+[A|P]M)?)\)\s+(.*?)\:\s+(.*)\s*$', re.I|re.L)
 
     _LogItems=None
 
+    logs=property(lambda self: iter(self._LogItems))
+
     def __init__(self,LogFiles):
         """
         LogFiles: Iterable of PidginLog objects
         """
         self._LogItems=LogFiles
+
+    def iterRecords(self):
+        """
+        Iterator of all records in all the logs
+        """
+        return itertools.chain(*list(self._LogItems))
    
     @classmethod
     def fromDirectory(cls,LogDir):