Class SequentialSequenceWriter
source code
SequenceWriter --+
|
SequentialSequenceWriter
- Known Subclasses:
-
This class should be subclassed.
It is intended for sequential file formats with an (optional) header,
repeated records, and an (optional) footer.
In this case (as with interlaced file formats), the user may simply
call the write_file() method and be done.
However, they may also call the write_header(), followed by multiple
calls to write_record() and/or write_records() followed finally by
write_footer().
Users must call write_header() and write_footer() even when the file
format concerned doesn't have a header or footer. This is to try and make
life as easy as possible when switching the output format.
Note that write_header() cannot require any assumptions about the
number of records.
Creates the writer object
Use the method write_file() to actually record your sequence
records.
- Overrides:
SequenceWriter.__init__
- (inherited documentation)
|
Use this to write an entire file containing the given records.
records - A list or iterator returning SeqRecord objects
This method can only be called once.
- Overrides:
SequenceWriter.write_file
|
Write a single record to the output file.
record - a SeqRecord object
Once you have called write_header() you can call write_record() and/or
write_records() as many times as needed. Then call write_footer() and
close().
|
Write multiple record to the output file.
records - A list or iterator returning SeqRecord objects
Once you have called write_header() you can call write_record() and/or
write_records() as many times as needed. Then call write_footer() and
close().
|