From: Karol L. <kar...@kn...> - 2007-03-26 14:51:55
|
Now that 0.7 is out, I wanted to return to the discussion about refactoring the parsers. The 'parser-refactoring' branch has a working version of the new Gaussian parser that I wrote up some time ago. The major change is that the parser loop is in the LogFile class, and calls the method of the child class (i called it "_extract"). This allows generic changes to be done to all the parsers in parallel. Temporary variables need to be attributes in order to survive between iterations, and I added code that deletes them after parsing (everything that's not in _attrlist and wasn't there before parsing). There are a few other additions that should make writing parsers easier. For example, the __setattr__ can take care of issuing messages to the logger when new attributes are created. Most of these smaller changes can and probalby should be discussed separately. Let me know how you feel about how to proceed. I would prefer not to work too long in a branch on something that is so fundamental to cclib (not like a new, specific parser) where the files keep changing. I think it would be more efficient and reasonable to stretch out the "refactoring" but keep it alive. That is, to take up one issue at a time on this list and to work in small steps in the trunk (following consensus). Karol -- written by Karol Langner Mon Mar 26 16:30:38 CEST 2007 |