[Biopython-dev] User friendly files

Cayte katel at worldpath.net
Tue May 29 01:58:31 EDT 2001


.  I was thinking of ideas to minimize the need to edit, cut and paste
files.  One idea is to subclass File and add a read_record_line routine.
This would contain a state machine.  The SEARCHING_FOR_RECORD state would
discard lines  up to the start of record tag, and retiurn this line and
advance to the RECORD_FOUND state.  In the RECORD_FOUND state,
read_record_line would call readline.  At the end of record tag it would
advance to the END_RECORD state.  The next call would return an empty state
and return to SEARCHING_FOR_RECORD.  The state would always go to the
END_OF_FILE when the code finished reading all the file contents.  The state
would go to an UNKNOWN state if the user forced the file pointer.

  I feel the easier our tools are the more likey they'll be used.  Please
share your ideas.

                                   Cayte




More information about the Biopython-dev mailing list