From: Karol L. <kar...@kn...> - 2007-01-30 23:44:39
|
On Tuesday 30 of January 2007 17:39, Adam Tenderholt wrote: > >> I have however, a different idea. What if .parse() were defined > >> for the > >> generic class LogFile, and it did all the "generic" things, and > >> also called > >> self.extract(), which would contain the "for line in > >> self.inputfile" loop > >> that is specific to each parser (effectively replacing the > >> current.parse()). > >> This way, we would have only one function more and all the > >> benifits, and > >> again no change for the user. > > > > Indeed, I prefer this too. > > I agree that this is a good idea. I also think ccopen and others > should check to see if the logfile exists, and if not, print an error/ > warning about it. > > Adam Well, to start this I added a parse() method to the LogFile class and renamed parse() to extract() in the parsers. Take a look if the general idea is suitable. If so, we can start moving things to the generic method. I checked all the tests and regression tests - nothing broken. Karol -- written by Karol Langner Wed Jan 31 00:38:48 CET 2007 |