[Biopython-dev] reusable code in Genbank

Brad Chapman chapmanb at arches.uga.edu
Sat Mar 10 14:19:45 EST 2001

> _EventGenerator in GenBank looks like generic glue code that
> could be used in my Kabat parser.  I could cut and paste it but duplicate
> code adds to the maintenance load.  Andrew, I suggest moving it to Tools??

> Looks more appropriate for Bio/ParserSupport.py.

I'm glad this code can be of more general use. I just cleaned up
_EventGenerator a bit (it had some ugly GenBank-specific stuff in it)
and moved it into ParserSupport.py, as Jeff suggested. It's called
EventGenerator(), and now GenBank uses it from ParserSupport.

One thing I was worried about is that EventGenerator is an XML
handler, so it derives from an XML handler class. I didn't want to
make ParserSupport only be usable if the user had XML installed (since 
non-Martel-based parsers use ParserSupport) so EventGenerator will
only be conditionally created if the XML import goes okay, otherwise
an error message will be printed.

Let me know if this works for your needs, Cayte, and if it seems okay
to everyone else.


More information about the Biopython-dev mailing list