Package xdp :: Package io :: Module sff
[show private | hide private]
[frames | no frames]

Module xdp.io.sff

Read and write files using Mx's Simple File Format.
Classes
Sff The contents of the header of an SFF file.

Function Summary
  _sff_parseHeaderField(line, fields)
Parse one SFF header field from a line.
string _sff_read_header_line(stream)
Read single line of an SFF header from an input stream.
2-tuple of the form (header_type, fields_dict) _sff_readHeader(stream)
Read an SFF header from an input stream.
2-tuple of the form (header, data) readSffFile(stream)
Read an SFF header and data from an input stream.
  SffFieldError(Exception)
Exception raised to indicate that an invalid field name was specified.

Function Details

_sff_parseHeaderField(line, fields)

Parse one SFF header field from a line.

The %devices field is split by whitespace into a list of the column names. Other fields that being with a percent sign are not modified.

The field name and value are stored in fields.
Parameters:
line - one line from an SFF header
           (type=string)
fields - field names and values
           (type=dict)
Raises:
IOError - the SFF header is missing or malformed

To Do: refactor this function

_sff_read_header_line(stream)

Read single line of an SFF header from an input stream.
Parameters:
stream - input stream
           (type=file)
Returns:
the contents of the next header line of the stream
           (type=string)
Raises:
IOError - end-of-file was encountered

_sff_readHeader(stream)

Read an SFF header from an input stream.
Parameters:
stream - input stream
           (type=file)
Returns:
header type and fields
           (type=2-tuple of the form (header_type, fields_dict))
Raises:
IOError - the SFF header was missing or malformed

readSffFile(stream)

Read an SFF header and data from an input stream.
Parameters:
stream - input stream
           (type=file)
Returns:
header and data
           (type=2-tuple of the form (header, data))
Raises:
IOError - the SFF header or data was malformed

Note: Only SFF files that have a single header are supported.

SffFieldError(Exception)

Exception raised to indicate that an invalid field name was specified.

Generated by Epydoc 2.1 on Wed Jul 20 11:51:05 2005 http://epydoc.sf.net