From: Karol L. <kar...@kn...> - 2007-01-30 08:50:35
|
On Tuesday 30 of January 2007 09:04, Noel O'Boyle wrote: > Some thoughts: The final conversion of attributes to arrays may be > different in each case, and so cannot be shared across parsers. Any > additional shared code, e.g. final progress update, should be called > from the end of the .parse(), rather than having the user call it. Can you give an example of when the conversion of attributes to arrays would be different between two parsers? I thought the idea was for attributes to be the same for all parsers. As to calling the function(s) I'm proposing, I wasn't thinking exactly what you said - calling them from the beginning/end of .parse(). The user sees no changes here. 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. Karol Karol -- written by Karol Langner Tue Jan 30 09:43:45 CET 2007 |