Table of Contents

Class: Stream em.py

A wrapper around an (output) file object which supports diversions and filtering.

Methods   
__init__
attach
close
create
divert
flush
install
last
purge
purgeAll
retrieve
revert
shortcut
undivert
undivertAll
write
writelines
  __init__ 
__init__ ( self,  file )

  attach 
attach ( self,  shortcut )

Attached a solitary filter (no sequences allowed here) at the end of the current filter chain.

  close 
close ( self )

  create 
create ( self,  name )

Create a diversion if one does not already exist, but do not divert to it yet.

Exceptions   
DiversionError, "diversion name must be non-None"
  divert 
divert ( self,  name )

Start diverting.

Exceptions   
DiversionError, "diversion name must be non-None"
  flush 
flush ( self )

  install 
install ( self,  shortcut=None )

Install a new filter; None means no filter. Handle all the special shortcuts for filters here.

  last 
last ( self )

Find the last filter in the current filter chain, or None if there are no filters installed.

  purge 
purge ( self,  name )

Purge the specified diversion.

Exceptions   
DiversionError, "diversion name must be non-None"
  purgeAll 
purgeAll ( self )

Eliminate all existing diversions.

  retrieve 
retrieve ( self,  name )

Retrieve the given diversion.

Exceptions   
DiversionError, "diversion name must be non-None"
DiversionError, "nonexistent diversion: %s" % name
  revert 
revert ( self )

Reset any current diversions.

  shortcut 
shortcut ( self,  shortcut )

Take a filter shortcut and translate it into a filter, returning it. Sequences don't count here; these should be detected independently.

Exceptions   
NotImplementedError, "mapping filters not yet supported"
  undivert 
undivert (
        self,
        name,
        purgeAfterwards=False,
        )

Undivert a particular diversion.

Exceptions   
DiversionError, "diversion name must be non-None"
DiversionError, "nonexistent diversion: %s" % name
  undivertAll 
undivertAll ( self,  purgeAfterwards=True )

Undivert all pending diversions.

  write 
write ( self,  data )

  writelines 
writelines ( self,  lines )


Table of Contents

This document was automatically generated on Mon Oct 27 01:29:13 2003 by HappyDoc version 2.1