[Biopython-dev] Martel-0.3 available

Brad Chapman chapmanb at arches.uga.edu
Mon Oct 9 15:49:28 EDT 2000


Andrew wrote:
>  Martel-0.3 is finally available.  

Cool! Thanks for this.

> a tutorial on how to write a parser.

Very nice. I wish my Fasta parser looked as nice as yours :-). One thing
that had me concerned about your parser, though, was the use of Str("\n")
to detect end of new lines. I was using this with lots o' luck with all
of my unix formatted files, but it didn't seem to work right for me when
I was using it on the Windows formatted (I think) files in the Fasta test
directory. I ended up having to use Martel.MaxRepeat(Martel.Re("[\s]"),
0, 2) to detect end o' lines, which seems to work properly, but it pretty
ugly looking.

Yours seemed to work okay though at detecting the end of the lines, so
I'm not positive what is going on... Hmmm, I don't know, I'll have to
look at this more, I guess. I don't really know anything at all about
line-break madness.

>  Excepting bug fixes, this is the last version which will work with
>  Python
>  1.5.2.	The next one will work with 2.0 and use its new xml
package.

Since I'm using 2.0 right now, I made the necessary changes to get it
working for me with just the xml packages. The changes I made were in
Parser.py, and are attached as Parser.diff, in case they will be of any
use to you in making these changes. BTW, pyXML-0.6.1 is out, so hopefully
now 1.5.2 with PyXML should work interchangably with python2.0 alone.

>  mostly so that the SAX names are correct (eg, now
>  using DocumentHandler instead of ContentHandler, which was just
>  wrong).

Really? I didn't even see DocumentHandler in 2.0 -- I think that
ContentHandler is DocumentHandler (at least in 2.0), but I'm not
positive. Hard to follow all of the changes in that stuff...

Thanks again for the new version -- I'm looking forward to having some
time to play around with it more :-).

Brad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Parser.diff
Type: application/x-unknown
Size: 9161 bytes
Desc: not available
Url : http://portal.open-bio.org/pipermail/biopython-dev/attachments/20001009/a2109b64/Parser.bin


More information about the Biopython-dev mailing list